Help adding a variation of Tuya TS0044, TS004F to ZHA

Should I return this device or it might work one day?

It sounds like it is technically possible to get these devices working, so maybe in another 6 months they will work without a ton of hacking. I’m probably going to return mine, and maybe re-order one later in the year if there is better support.

So, after reading through all the posts it seems that there is no easy way of getting the TS004F working with ZHA. Zigbee2MQTT seems to be the better solution, but can we run ZHA and Zigbee2MQTT together using one dongle. I don’t feel like adding all my ZHA devices to Zigbee2MQTT now.

Unfortunately not on one dongle. You can have 2 dongles (coordinators), one for ZHA and one for Zigbee2mqtt. They run fine on the same box/server.

2 Likes

So, it’s impossible to add to zha, considering migrate to z2m

What a pity, zha was so easy…

It works as a dimmer or as a 4 button scene switch. You need Z2M for the 12 scene mode, at least as of now. Personally I just use them for 4 scenes, as I will not migrate away from ZHA.

Sorry @khvej8, you said “it works as a 4 button scene switch” … How do you make it work as 4 button scene switch (not the dimmer mode) ? I did not succeed (even with the right 2+4 switch mode trick). Thx

It is actually the dimmer version, just using the dim+ and dim- as scene selectors. Actually each button can do whatever😏

. Look in this thread

1 Like

If you use NodeRed:
(using ZHA and default “dimmer mode” - detects single press all 4 buttons and hold buttons 2 and 4)
(you need to change device_ieee to match your device in the filter node)

 [{"id":"da84b83785e013cb","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"6fabdb84cb93f923","type":"server-events","z":"da84b83785e013cb","name":"Listen to ZHA events","server":"44f73817.ded598","version":1,"event_type":"zha_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":130,"y":120,"wires":[["177786d53ac616a9"]]},{"id":"177786d53ac616a9","type":"switch","z":"da84b83785e013cb","name":"Filter remote","property":"payload.event.device_ieee","propertyType":"msg","rules":[{"t":"eq","v":"5c:02:72:ff:fe:04:3e:6a","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":120,"wires":[["527f52834bf86b2f"]],"outputLabels":["Scene switch"]},{"id":"527f52834bf86b2f","type":"switch","z":"da84b83785e013cb","name":"TS004F","property":"payload.event.command","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"step","vt":"str"},{"t":"eq","v":"move","vt":"str"},{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":520,"y":120,"wires":[[],[],["d5113f4247099e5d"],["3e5729affe3f535e"],[]],"outputLabels":["1","3","2/4","2/4",""],"info":"button 1 (top right): on\nbutton 2 (top left): step args[0,51,10]\nbutton 3 (bottom left): off\nbutton 4 (bottom right): step args[1, 51, 10]"},{"id":"d5113f4247099e5d","type":"switch","z":"da84b83785e013cb","name":"press 2 / 4","property":"payload.event.args[0]","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":120,"wires":[[],[]],"outputLabels":["2","4"]},{"id":"3e5729affe3f535e","type":"switch","z":"da84b83785e013cb","name":"hold 2 / 4","property":"payload.event.args[0]","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":740,"y":160,"wires":[[],[]],"outputLabels":["2","4"]}]

Can you elabroate on what that flow does (12 scene vs dimmer mode) and what version of Zigbee you’re running (Z2M vs ZHA)?

I’m a bit unclear why the 12 scene mode is only working in Z2M. Is it a technical limitation or just that nobody has updated the ZHA quirk to take advantage of that functionality?

I’ve edited my reply to include that info

Hi Lance,
The Tuya TS004F switch will operate in 2 modes. You can change the mode by holding button 2+4 for app 10 sec. Button 3 will flash once, indicating it have changed mode. However, this does not make any difference when used, as it will be set to one mode during paring.

In Zigbee2MQTT, during initial paring, the switch is set to 2 scene mode. Each button have 3 events, single press, double press and hold. There are blueprints showing who this works.

In ZHA the switch will be in “dimmer mode”. The dimmer mode is not really a dimmer mode. It will give the possibility of 6 different events. All buttons have a single press event and button 2+4 have a hold event. Look in the blueprint I mentioned and you will see them.

There are a number of threads indicating how to change the mode in ZHA, however it needs to be done using the quirk and initial paring. I believe someone with the right knowledge can change the ZHA behavior.

2 Likes

Were you ever able to get your switch working. I am experiencing the same problems. Pairs fine has the same entities you listed but im getting no events from any button presses.

DuPunk, are you running latest version of HA? Which zigbee intgration do you use. If not on latest version, either upgrade or have a look in this thread ZHA - Tuya 4-button Scene Switch (TS0044) - #25 by mutchun on how to manually create a zigbee handler.

What if after successful pairing in Z2M I have no possibility to choose any button. I have no entities, no endpoints and I cannot use blueprints dedicated for that 4 button gang.

When I can add some specific code to use this switch?

You should have 2 entitets, on for action and one for battery. If not, try and remove and pair again.

Might also be you have a different version of the Tuya switch, not called either 044 or 04F in the end.

I have 004F, but I have also 2 entities, exactly as You have mentioned. Entities are not visible in the blueprints.

SOLVED
After changing battery everything is working