- Platform information:
- Hardware: RP4
- OS: Buster
- openHAB version: 2.5.3
- Issue of the topic:
I’m trying to configure a zigbee2mqtt Thing for ZM-L03E-Z (https://www.zigbee2mqtt.io/devices/ZM-L03E-Z.html)
From zigbee2mqtt Side it seems to be recognized successfully. Checked using a mqtt Client and Send commands to the device like this:
{“state_left”:“ON/OFF”}
{“state_center”:“ON/OFF”}
works fine!
My Things configuration is this:
Thing topic 2WAYSWITCHGARAGE "2WAYSWITCHGARAGE" {
Channels:
Type switch : 2WAYSWITCHGARAGELEFT "Garage Schalter Links On/Off" [stateTopic="zigbee2mqtt/0x60a423fffea3acd0", transformationPatternOut="JSONPATH:$.state_left", transformationPattern="JSONPATH:$.state_left", commandTopic="zigbee2mqtt/0x60a423fffea3acd0/set",on="ON", off="OFF"]
Type switch : 2WAYSWITCHGARAGERIGHT "Garage Schalter Rechts On/Off" [stateTopic="zigbee2mqtt/0x60a423fffea3acd0", transformationPatternOut="JSONPATH:$.state_center", transformationPattern="JSONPATH:$.state_center", commandTopic="zigbee2mqtt/0x60a423fffea3acd0/set",on="ON", off="OFF"]
}
And my Item-File is like this:
Switch 2WAYSWITCHGARAGELEFT "Garage aussen Links" { ga="Switch", channel="mqtt:topic:mosquitto:2WAYSWITCHGARAGE:2WAYSWITCHGARAGELEFT"}
Switch 2WAYSWITCHGARAGERIGHT "Garage aussen Rechts" { ga="Switch", channel="mqtt:topic:mosquitto:2WAYSWITCHGARAGE:2WAYSWITCHGARAGERIGHT"}
Now if I try to set 2WAYSWITCHGARAGELEFT to on and off, everything works fine. But if i try to switch 2WAYSWITCHGARAGERIGHT it switches ALSO state_left to on or off. It seems that the command to the device is allways the same and also the answer (and its state) is processed not according to the tranfsformationPattern and tranformationPatternOut.
Based on my unterstanding of tranformationPatternOut (transformationPatternOut=“JSONPATH:$.state_center”) openhab should send {“state_center”:“ON/OFF”}
What Im doing wrong?
I also tried to use formatBeforePublish="{ “state_center” : %s }" withing the Things configuration, but this also changed nothing.
The zigbee2mqtt log says following:
,zigbee2mqtt:info 2020-12-16 12:46:47: MQTT publish: topic ‘zigbee2mqtt/0x60a423fffea3acd0’, payload ‘{“state_left”:“ON”,“linkquality”:26,“state_center”:“OFF”,“state”:“ON”}’
I tried to debug the device on zigbee2mqtt side, and it seems that if i want to set state_center, it must be only {“state_center”:“ON”}. That works.
If i send {“state_left”:“ON”, “state_center”:“ON”} only the state_left statement is processed never the state_center. state_center is never changed, only state_left
I’m confused. How to debug the JSON Message send to zigbee2mqtt?
Thank you so much