dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 502 forks source link

humidity, temperature sensor TUYA is not getting the battery #7999

Open SvenMartin81 opened 5 days ago

SvenMartin81 commented 5 days ago

Does the issue really belong here?

Is there already an existing issue for this?

Describe the bug

Hi, Phoscon is not getting the battery from this sensor: _TZE200_9yapgbuv - Product: TS0601 - Version 1.0.8

Steps to reproduce the behavior

it is always

Expected behavior

i should have the status of the battery as I have it for other sensors "_TZ3000_saiqcn0y" - Product: TS0201 - Version 1.0.6

Screenshots

Screenshot 2024-10-26 235001 TS601 Screenshot 2024-10-26 235001 TS201

Environment

deCONZ Logs

No response

Additional context

No response

Smanar commented 2 days ago

The model "_TZ3000_saiqcn0y" use the DDF _TZ3000_TS0201_temp_hum_sensor.json (use classic cluster) The model "_TZE200_9yapgbuv" use the DDF _TZE200_TS0601_humidity_temp.json (use tuya cluster)

But I have checked again it seem it use the good dpid (the 0x04)

It's strange there is no value at all, perhaps the value is still "none", can you check direclty in the API ? using Phoscon/help/API Information/sensors.

Else no other way than checking logs if the device don't use another dpid.

SvenMartin81 commented 2 days ago

Hi, I am using the Beta Gateway verion 2.29.0. By looking into the DDF file you are menshen, i can't my version "_TZE200_9yapgbuv". could this be the reason?

I deleted this sensor and learnd it again to the system. but there was no change in the Battery-sensor.....it is still not availible.

Smanar commented 1 day ago

By looking into the DDF file you are menshen, i can't my version "_TZE200_9yapgbuv". could this be the reason?

No I m saying you can't compare yours 2 device, they are not working same. I have see that https://github.com/zigpy/zha-device-handlers/issues/2281

This device don't use the same dpid, If I have understand It use the dpid = 3 and return 3 value for low/medium/high

Can you edit the DDF to have

        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 3, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        },

You have it at 2 position in the DDF, then restart deconz, if it work you will have value 0 (for 25%), 1 for (50%) and 2 (for 100%) It can take time to be updated.

SvenMartin81 commented 15 hours ago

Hi, are you talking about this file: "_TZE200_TS0601_humidity_temp.json" in this folder: /usr/share/deCONZ/devices/tuya

if "yes": do I need to copy this file and change the file name and the dpid to 3

there is this:

      "name": "config/battery",
      "parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" },
      "read": {"fn": "none"},
      "default": 0
Smanar commented 8 hours ago

Yes, It's exaclty that, what is your OS ? not docker ? Easier to just edit the file, change the dpid (4 > 3 ), save and restart deconz.

You can edit direclty the file, it will have an impact on all thoses devices "manufacturername": ["_TZE200_nnrfa68v","_TZE200_znbl8dj5", "_TZE200_qoy0ekbd", "_TZE200_a8sdabtg", "_TZE200_whkgqxse","_TZE200_yjjdcqsq", "_TZE200_9yapgbuv", "_TZE200_utkemkbs", "_TZE200_locansqn", "_TZE204_yjjdcqsq"],

But the rollback is easy, and on next deconz update, the file will be reseted. It's just to test.

Else we can make a DDF just for this device, but need to create a new file and put it on another folder.

SvenMartin81 commented 6 hours ago

Hey,

I changed it to 3. but it is the Same as befor