Xiaomi MiJia wireless switch - Automation Event

Hello,

I connected the Xiaomi MiJia Switch (the round one) over Zigbee2Mqtt. The switch is showing up under the integration and entities as a sensor. When I click the button, I got a sensor update to single/double/long and after this the sensor is clearing the message. Only showing up for some milliseconds.

I created an automation trigger as event, but the event is not working. I don’t know where the configuration problem is:


platform: event
event_data:
  click_type: single
  entity_id: sensor.0x00158d00035axxxx_click
event_type: click

grafik

In the other posts to this problem, the people got the Xiaomi Switch as a binary_sensor and not as a sensor.

Log from zigbee2mqtt:

zigbee2mqtt:info  2020-01-27 14:32:24: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":"single"}'
zigbee2mqtt:info  2020-01-27 14:32:24: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":""}'
zigbee2mqtt:info  2020-01-27 14:32:27: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":"long"}'
zigbee2mqtt:info  2020-01-27 14:32:27: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":""}'
zigbee2mqtt:info  2020-01-27 14:32:27: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":"long_release","duration":658}'
zigbee2mqtt:info  2020-01-27 14:32:27: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":""}'
zigbee2mqtt:info  2020-01-27 14:34:15: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":"double"}'
zigbee2mqtt:info  2020-01-27 14:34:15: MQTT publish: topic 'zigbee2mqtt/0x00158d00035axxxx', payload '{"linkquality":0,"click":""}'

Greetings and thanks for helping!

Try using state, rather than event, has been working well for me for almost a year:

1 Like

Is working! Thanks, so simple :sweat_smile: