I am trying to send on/off mqtt command to a zigbee plug binded to my zigbee2tasmota bridge.Command topic is cmnd/zbBridge/ZbSend but i somehow have to send with that a payload like { “device”:“zbPlug1”, “send”:{“Power”:“On”} } or { “device”:“zbPlug1”, “send”:{“Power”:“Off”} } .I clearly have no idea how to do that .
i have setup my channel like this
I’m struggling with the same, but can’t find a solution. To toggle a zigbee switch I can execute the command : ZbSend {"Device":"niko_socket_01","Send":{"Power":toggle}}
I’ve this in my Thing, but the command is not working. Reading the state of the switch is working perfect.
tried it today (was on holiday last week), bit without luck.
Sending a the command {"Device":"niko_socket_01","Send":{"Power":0}} or {"Device":"niko_socket_01","Send":{"Power":1}} to topic cmnd/sonoffbridge/ZbSend via eg MQTT Explorer works.
Nothing to see in MQTT Explorer, it seems that OH doesn’t sent anything.
I think this has to do because I’m sending a json and not a normal string.
I saw another post and tried this: '{\"Device\":\"niko_socket_01\",\"Send\":{\"Power\":%s}}', but without luck.
Others do it via a rule, this is working fine:
val value = '{\"Device\":\"niko_socket_01\",\"Send\":{\"Power\":toggle}}'
val actions = getActions("mqtt","mqtt:broker:mosquitto")
actions.publishMQTT("cmnd/sonoffbridge/ZbSend",value)