Battery 0% - TS0044

I have two of the above 4 scene switches and in both cases, the batteries are reported as being 0% irrespective of how new the batteries are.
Using deCONZ v.2.22.2 on Win 11 PC with HS4. The DDF does not show any values for the battery.
I am aware that a recent upgrade in deCONZ removed the issue with rapid battery depletion - which was great, but now I never see a real battery status. Is this being investigated?
Happy to report any data requried.
Thanks.

Good question, what are your devices ? (the manufacture name)
You was impacted by battery leak or not ?

IDK if it’s possible to make an universal DDF usable by old and new model …

Thanks for reply - and yes, I was impacted by the battery leak. One device is a MOES Model No.: ESW-0ZAA-EU. I cannot access the second device as it is fixed to the wall - all I can see on screen is “manufacturername”: “_TZ3000_wkai4ga5” if that makes any sense? And this is the same for both devices.
If not, please tell me how to access the data required.
Thanks for your help.

Yes “_TZ3000_wkai4ga5” is the more usefull information ^^, the reference mean nothing for tuya, so much clone.
If you was impacted, I presume you have the last version. And from what I m reading the reporting need to be native but IDK wich one cluster the device is using …

On the DDF we are using the battery voltage

        {
          "name": "config/battery",
          "refresh.interval": 86400,
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2;",
            "fn": "zcl"
          }
        },

Try using the voltage

        {
          "name": "config/battery",
          "parse": {
            "at": "0x0020",
            "cl": "0x0001",
            "ep": 1,
            "fn": "zcl",
            "eval": "const vmin = 20; const vmax = 30; var bat = Attr.val; if (bat > vmax) { bat = vmax; } else if (bat < vmin) { bat = vmin; } bat = ((bat - vmin) / (vmax - vmin)) * 100; if (bat > 100) { bat = 100; } else if (bat <= 0)  { bat = 1; } Item.val = bat;"
          },
          "refresh.interval": 86400,
          "default": 0
        },

Just need to restart deconz after modification, no need to re-include the device.

Edit:
You have re-included the device after the DDF modification that solve the battery leak ? Need to remove the old binds. I think yes, else you will still have the battery leak.

Many thanks for reply. I can confirm that I no longer have the battery leak. Can you kindly advise me how I can edit the required DDF? This is something that I have never done so help would be appreciated.

So far as I can see, in deCONZ, “Ctrl+E” opens the DDF editor and I can select the battery on the left hand side. If I then click on preview, I can see the relevant code but cannot see any way of changing it / saving any changes.

Thanks for any further help.

Yes it’s possible using the editor.
Select the config/battery field (in blue) , then you will see in “parse” part case to edit the DDF.

But it’s easier and fastest to edit direclty the DDF, this one is devices\tuya\_TZ3000_TS0044_4gang_remote.json it’s just a text file, and some OS are not persistents.
I m seeing you are on windows, but it’s a real windows or you use a virtual machine inside ?

Thanks for reply. I am using a real headless Windows 11 PC and accessing it via AnyDesk. I have located file and made changes - will see if battery updates!!

Many thanks.

I have made the suggested changes and can advise that, following 48hours and a restart of deCONZ (v2.22.2) the battery still shows 0%.
Is there anything else that I can try?
Thanks again.

Do you have access to the GUI ?
If yes can you check in the cluster 0x0001, the attribute list ? (more precisely attributes 0x0020 and 0x0021)

When you will check them in the GUI, it will update the device in the API too.

You have nothing about the cluster 0x0001 in logs for this device ? Visible with “info” “info_l2” or in last try “ZCL”

On Zigpy they are using a flag “TuyaNoBindPowerConfigurationCluster” so I m almost sure we need to don’t make bind, but I realy have no clue which one request is doing naturaly the device.

Edit:
It seem it can work with “battery_percentage_remaining”

Can try to set a reporting, but without setting a bind, but from what I m reading the report need to be skipped too.

image
Have looked at the GUI and the above is, I hope, the attributes you are asking about!

Yep, but it’s defaut value.
You need to get them using the “read” button but problem

  • the device is sleeping
  • the device is lazy

So just select for exemple 0x0020 with double clic, and on the new popup press the “read” button, better for lazy device, and to wake it up, just press a button in same time you make the request (the reset button awake the device too if it don’t work, just a short press on it)

The DDF is using the 0x0021, so when the value wll be updated in deconz IT NEED to be updated too in the API, if it don’t work, something is wrong on the DDF.

Now then - result!!! Many thanks - now showing battery in deCONZ. Voltage value of 30 and percentage of 200…

This, together with the amended DDF from above seems to have sorted the issue out. It has also increased my knowledge of how the system works - albeit slightly!

1 Like

He … I have a bad new for you ^^
Reading the value with the GUI force the value update, but you need to make something for this process was automatic.
At next restart, you can return to a null value, this procedure was just a test to be sure the DDF is working.

On normal device we set a bind and a report. the bind “link” an attribute value to the corrdinator, and the report set the reporting value (min, max, change).
To prevent the battery link we need to don’t make a bind.

But IDK if it’s possible to set a report without a bind, and on other project I don’t see them make a report setting. I will ask to others devs if they have some information …

Edit:
It’s perhpas possible using a 24h poll, I will give you later a new DDF to test with it, but I need to be sure, because I don’t see it on other zigbee project.

Ok so for the “report without bind”, I think it’s useless, have asked on dev channel, and I don’t think it’s something logic.

So can try with poll, try replacing on the official DDF

        {
          "name": "config/battery",
          "refresh.interval": 86400,
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2;",
            "fn": "zcl"
          }
        },

by


        {
          "name": "config/battery",
          "refresh.interval": 86400,
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2;",
            "fn": "zcl"
          },
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0001", "at": "0x0021"}
        },

Every 24h if deconz haven’t received a value it will ask itself for value to the device (as the device is a slepper, deconz need to wait for the device was awake)

(No need to re-include the device, just a deconz restart, it’s not zigbee config but deconz one)

Thanks for this suggestion which I will try early next week. I can advise that, having shut down deCONZ this afternoon, the battery values are still present and showing the same numbers as before I shut deCONZ down. I will see if they are still there in 24 hours!

I have just made a try, you are right, but I think it’s because the value was memorised (deconz store config value).
So I m not sure if the level decrease the device will prevent you.

And it seem, you need too a battery removal sometime Zemismart Wireless Wall Switch _TZ3000_tk3s5tyg Tuya TS0041 - Fast discharge + device announcements · Issue #8072 · Koenkk/zigbee2mqtt · GitHub

I have finally “updated” the official DDF with your suggested code and will wait to see what happens. Thanks also for the link to the “deivce not firing”, but the only issues I have had were with the battery - firstly discharging in a few days and secondly not showing up in deCONZ.
Will report back in due course.