I’ve recently changed some zwave in wall switches to Zigbee ones, and can’t find a way to determine whether the connected light turns on or off due to the actual wall switch being flipped or due to an event triggered by HA (automation triggered by motion, or a click in my dashboard for example).
With Zwave; scene-events were triggered next to the actual state change of the light.
Is there a way to do this with Z2M? I’ve listened to all events in the HA dev tools, but don’t see any differences there, and also looked at the logs in Z2M, but I can’t see a trigger
there either.
Example of the Z2M debug log; the light (Dimmer - Keuken Spots l1) is first turned on via the wall switch, then turned off via the HA Dashboard.
Debug 2023-04-16 14:07:31Received Zigbee message from 'Dimmer - Keuken Spots', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
Info 2023-04-16 14:07:31MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots', payload '{"brightness":155,"brightness_l1":155,"brightness_l2":255,"linkquality":135,"max_brightness":255,"min_brightness":4,"power_on_behavior":"previous","power_on_behavior_l1":"previous","power_on_behavior_l2":"previous","state_l1":"ON","state_l2":"ON","switch_type_l1":"momentary","switch_type_l2":"toggle"}'
Info 2023-04-16 14:07:31MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots/l1', payload '{"brightness":155,"power_on_behavior":"previous","state":"ON","switch_type":"momentary"}'
Info 2023-04-16 14:07:31MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots/l2', payload '{"brightness":255,"power_on_behavior":"previous","state":"ON","switch_type":"toggle"}'
Debug 2023-04-16 14:07:54Received MQTT message on 'zigbee2mqtt/Dimmer - Keuken Spots/l1/set' with data '{"state":"OFF"}'
Debug 2023-04-16 14:07:54Publishing 'set' 'state' to 'Dimmer - Keuken Spots'
Info 2023-04-16 14:07:54MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots', payload '{"brightness":155,"brightness_l1":155,"brightness_l2":255,"linkquality":141,"max_brightness":255,"min_brightness":4,"power_on_behavior":"previous","power_on_behavior_l1":"previous","power_on_behavior_l2":"previous","state_l1":"OFF","state_l2":"ON","switch_type_l1":"momentary","switch_type_l2":"toggle"}'
Info 2023-04-16 14:07:54MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots/l1', payload '{"brightness":155,"power_on_behavior":"previous","state":"OFF","switch_type":"momentary"}'
Info 2023-04-16 14:07:54MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots/l2', payload '{"brightness":255,"power_on_behavior":"previous","state":"ON","switch_type":"toggle"}'
Debug 2023-04-16 14:07:55Received Zigbee message from 'Dimmer - Keuken Spots', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":0,"currentLevel":0}' from endpoint 1 with groupID 0
Info 2023-04-16 14:07:55MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots', payload '{"brightness":0,"brightness_l1":0,"brightness_l2":255,"linkquality":138,"max_brightness":255,"min_brightness":4,"power_on_behavior":"previous","power_on_behavior_l1":"previous","power_on_behavior_l2":"previous","state_l1":"OFF","state_l2":"ON","switch_type_l1":"momentary","switch_type_l2":"toggle"}'
Info 2023-04-16 14:07:55MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots/l1', payload '{"brightness":0,"power_on_behavior":"previous","state":"OFF","switch_type":"momentary"}'
Info 2023-04-16 14:07:55MQTT publish: topic 'zigbee2mqtt/Dimmer - Keuken Spots/l2', payload '{"brightness":255,"power_on_behavior":"previous","state":"ON","switch_type":"toggle"}'