TuYa TS0601_dimmer_1 does not support toggle command
What happened?
I have a TuYa TS0601_dimmer_1 dimmer, which should accept {"state": "TOGGLE"}. However, when I use this command, I got the following error:
Publish 'set' 'state' to 'dimmer' failed: 'Error: Expected one of: ON, OFF, got: 'TOGGLE''
Which implies that the toggle command does not work. Is this a bug, or a documentation issue?
What did you expect to happen?
No response
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
1.33.2
Adapter firmware version
0x26580700
Adapter
ConBee2
Debug log
No response
You mean the "_TZE200_la2c2uo9"? I opened an issue in January 2024: https://github.com/Koenkk/zigbee2mqtt/issues/16334
My only solution for today is still (if you use NodeRed):
- Add a "Zigbee2mqtt in" node for the dimmer and use "state" for "Payload output".
- Write the msg.payload of this node to a file based "persistent value" node.
- At the point you want to toggle the dimmer, read this persistent value from the file.
- Add a function node with this code:
if (msg.payload == "ON")
{
msg.payload =
{
"state": "OFF"
}
}
else
{
msg.payload =
{
"state": "ON"
}
}
return msg;
- send this message to the dimmer.
Thats because the TuYa api doesnt have such command.
Hi @Koenkk !
That's very interesting. Is there a difference between dimmers and switches? I'm asking because my Tuya switch actuators (for example JR-ZDS01 "1 gang mini switch") support the TOGGLE command. My Tuya developer account has unfortunately expired, so I can no longer debug anything. But is this something that could be solved with an external converter? Or is my workaround via Nodered already the optimum?
JR-ZDS01 uses the standard Zigbee API , TS0601_dimmer_1 uses the TuYa api.
Given that the Tuya-API does not support this, I would propose to change the documentation, because currently it does state that the toggle command is supported.
@ikarisan I made a similar solution: I use the Z2M 'get' node to get the current state, and a change node to change the current state to the other one.
@krispek I think I tried that out once too. But the problem was, that I had to wait for the first message from the dimmer device to get the current state. So, after a powerloss or update/restart of Z2M the state of the dimmer may be unknow/null and you cannot change the state.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days