Xiaomi gateway events not triggered

Hi all,

Running fresh installation of home assistant 0.93.0 with a miniconda environment. I have the following automation:

  • id: ‘1558015993267’
    alias: toggle plug xiaomi
    trigger:
    • event_data:
      click_type: single
      entity_id: binary_sensor.switch_158d0002132b00
      event_type: click
      platform: event
      condition: []
      action:
    • data:
      entity_id: switch.plug_158d0001bbfb48
      service: switch.toggle

When I manually fire the event, it works fine:
2019-05-16 21:55:55 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event click[R]: click_type=single, entity_id=binary_sensor.switch_158d0002132b00>
2019-05-16 21:55:55 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event automation_triggered[L]: name=toggle plug xiaomi, entity_id=automation.toggle_plug_xiaomi>
2019-05-16 21:55:55 INFO (MainThread) [homeassistant.components.automation] Executing toggle plug xiaomi
2019-05-16 21:55:55 INFO (MainThread) [homeassistant.helpers.script] Script toggle plug xiaomi: Running script
2019-05-16 21:55:55 INFO (MainThread) [homeassistant.helpers.script] Script toggle plug xiaomi: Executing step call service
[…]

but when I press the corresponding button, the event is recognized but no automation is triggered:
2019-05-16 21:58:39 DEBUG (Thread-2) [xiaomi_gateway] MCAST (report) << {‘cmd’: ‘report’, ‘model’: ‘sensor_switch.aq2’, ‘sid’: ‘158d0002132b00’, ‘short_id’: 2370, ‘data’: ‘{“status”:“click”}’}
2019-05-16 21:58:39 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> : {‘status’: ‘click’}
2019-05-16 21:58:39 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event xiaomi_aqara.click[L]: entity_id=binary_sensor.switch_158d0002132b00, click_type=single>

and that’s all, the automation is not triggered.

I had this exact problem in another hass installation since I upgraded to 0.92. In fact, I had to downgrade to 0.80.0 to make it work. This is the reason I’m trying a separate fresh installation.

Any ideas?

Thanks

Should be

event_type: xiaomi_aqara.click

There was a breaking change for this some releases ago.

Hi,

Thanks for the reply. I’ve not tried yet (I will try when come back home), but yes, in fact the log shows “xiaomi_aqara.click”, and in older version shows as “click”. But I can’t still understand why the automation triggers when I fire the event manually.
Anyway, thanks a lot for your suggestion. I will try this afternoon.

Regards.

Thanks @tjntomas, it did the trick!

If you’re manually firing an event called click and your automation is listening for an event_type of click, it would still work. But since the component itself changed, that’s why it no longer worked until you changed your automation.

absolutely right @apop