Ok, here’s some debug info
2019-05-02 15:43:51 [homeassistant.components.mqtt] Received message on zigbee2mqtt/0x0017880104xxxxxx: b'{"duration":0,"counter":1,"linkquality":47,"battery":100,"brightness":0,"action":"off-press"}'
2019-05-02 15:43:51 [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.dimmer, old_state=<state sensor.dimmer=off-press; duration=0, counter=1, linkquality=39, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:47.669487+03:00>, new_state=<state sensor.dimmer=off-press; duration=0, counter=1, linkquality=47, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:47.669487+03:00>>
2019-05-02 15:43:52 [homeassistant.components.mqtt] Received message on zigbee2mqtt/0x0017880104xxxxxx: b'{"duration":0,"counter":1,"linkquality":39,"battery":100,"brightness":0,"action":"off-press"}'
2019-05-02 15:43:52 [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.dimmer, old_state=<state sensor.dimmer=off-press; duration=0, counter=1, linkquality=47, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:47.669487+03:00>, new_state=<state sensor.dimmer=off-press; duration=0, counter=1, linkquality=39, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:47.669487+03:00>>
2019-05-02 15:43:54 [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.dimmer, old_state=<state sensor.dimmer=off-press; duration=0, counter=1, linkquality=39, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:47.669487+03:00>, new_state=<state sensor.dimmer=unknown; duration=0, counter=1, linkquality=39, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:54.003206+03:00>>
2019-05-02 15:43:54 [homeassistant.components.mqtt] Received message on zigbee2mqtt/0x0017880104xxxxxx: b'{"duration":0,"counter":1,"linkquality":39,"battery":100,"brightness":0,"action":"off-press"}'
2019-05-02 15:43:54 [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.dimmer, old_state=<state sensor.dimmer=unknown; duration=0, counter=1, linkquality=39, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:54.003206+03:00>, new_state=<state sensor.dimmer=off-press; duration=0, counter=1, linkquality=39, battery=100, brightness=0, action=off-press, friendly_name=dimmer action, icon=mdi:gesture-double-tap @ 2019-05-02T15:43:54.205866+03:00>>
2019-05-02 15:43:54 [homeassistant.core] Bus:Handling <Event automation_triggered[L]: name=Dimmer off, entity_id=automation.dimmer_off>
I’ve made the same automation for off button. I’ve been pressing off button repeatedly and you can see that at first events come through but the automation doesn’t trigger. However, after I’ve made a pause for 2 seconds it reverted to unknown
state (as intended) and after that the press of off button triggered the automation, which leads me to believe that when source state equals new state, the state platform with to
filter may ignore it.