My setup is a RPi with Domoticz 4.10717 a CC2531 USB dongle and a recent version Zigbee2MQTT.
I have several Zigbee components working correctly including a WXKG02LM dual switch module, door window sensors, etc.
Now I want to add a WXKG03LM single switch module. The switch is recognized and the device is created in Domoticz as a On/Off switch.
When I press a button the zigbee state is showing up in the log, however the switch state never changes from "Off".
I wrote a dzvents script to capture and how the item.state in the Domoticz log:
Code: Select all
Debug2 = "YES" -- Turn debugging on ("YES") or off ("NO")
return {
on = { devices = { "Single Switch (ZB)" }}, -- Name of your button
execute = function(dz, item )
if Debug2=="YES" then
print("Slaapkamer Switch1: Start script")
print("Slaapkamer Switch1: -- Received State: " .. item.state)
print("Slaapkamer Switch1: -- Received State: " .. item.rawData[1])
end
if item.state == "Left" then
if Debug2=="YES" then
print("Slaapkamer Switch1: -- Single" )
end
end
if item.state == "Double" then
if Debug2=="YES" then
print("Slaapkamer Switch1: -- Double" )
end
end
if item.state == "Hold" then
if Debug2=="YES" then
print("Slaapkamer Switch1: -- Hold" )
end
end
end
}
Code: Select all
2019-12-08 16:07:38.621 (Zigbee2MQTT) MQTT message: zigbee2mqtt/0x00158d0002a56036 {'voltage': 3105, 'click': 'left', 'linkquality': 89, 'battery': 100}
2019-12-08 16:07:38.792 Status: dzVents: Info: Handling events for: "Single Switch (ZB)", value: "Off"
For my double switch (WXKG02LM) this works correctly and I have a Selector Switch configured in Domoticz that works great.
Code: Select all
2019-12-08 16:13:47.962 (Zigbee2MQTT) MQTT message: zigbee2mqtt/0x00158d0002afc0eb {'voltage': 3025, 'click': 'left', 'battery': 100, 'linkquality': 26}
2019-12-08 16:13:48.098 Status: dzVents: Info: Handling events for: "Double Switch (Zigbee)", value: "Left"
Thanks for any help!
Kr.
John