Aqara button stopped working

I have an Aqara hub v2 on firmware 1.41_167.0158 connected to hassio version 162 Home Assistant 0.92.2. Until recently, my Aqara button was working fine. A few weeks ago it stopped working and I’m not sure if this coincided with a firmware upgrade or a Home Assistant update. The hub light can still be turned on & off via HA so it’s still connected. The button clicks are still being picked up by the Mi Home app.

My automations.yaml file entry is:

- alias: Button 1 on
  trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
      entity_id: binary_sensor.switch_158d0001872XXX
      click_type: single
  action:
    - service: homeassistant.turn_on
      entity_id:
        - switch.standard_lamp
        - switch.sonoff_100026cXXX
        - switch.sonoff_1000749XXX

Can anyone help with where I might have gone wrong?

what do your logs say? Have you tried to elevate them to debug temporarily to see if you at least receive the signal?

Thanks for the pointers, I think this may be the relevant bit from the log:

2019-05-03 21:36:34 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Switch_158d0001872b93: off>: {'status': 'click'}
2019-05-03 21:36:34 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event xiaomi_aqara.click[L]: entity_id=binary_sensor.switch_158d0001872b93, click_type=single>
2019-05-03 21:36:34 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.switch_158d0001872b93, old_state=<state binary_sensor.switch_158d0001872b93=off; last_action=None, battery_level=48.4, friendly_name=Button 1 @ 2019-05-03T20:55:01.652682+01:00>, new_state=<state binary_sensor.switch_158d0001872b93=off; last_action=single, battery_level=48.4, friendly_name=Button 1 @ 2019-05-03T20:55:01.652682+01:00>>
2019-05-03 21:36:34 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1778383632] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=binary_sensor.switch_158d0001872b93, old_state=<state binary_sensor.switch_158d0001872b93=off; last_action=None, battery_level=48.4, friendly_name=Button 1 @ 2019-05-03T20:55:01.652682+01:00>, new_state=<state binary_sensor.switch_158d0001872b93=off; last_action=single, battery_level=48.4, friendly_name=Button 1 @ 2019-05-03T20:55:01.652682+01:00>>}

yeah you’re receiving the data.
and your automation appears to be correct.
I tried to look at recent HA releases as I thought I saw something on the aqara being mentioned, but can’t find anything when going back to 0.90… What did you upgrade from?

I think it was working on 0.87 or thereabouts but cannot be certain

Sorry I can’t find anything.
does your automation show as having triggered at all in states under Developer Tools?
If not try and keep a single action to your automation and see if it gets triggered.

Hello, I’m not a professional, but have looked in my “automation.yaml”. With “event_data” stands with me “click” with you is “click_type” !! Maybe that’s why the button does not work. My Aqara buttons work and for me HA is running in the version 92.1

I tried changing click_type in automations.yaml and restarted HA but still no success. The States section in Developer Tools shows last_triggered: 2019-03-28.

Hello, It’s me again, compared your automation with mine again. I think your formatting is not quite correct?!? Please move your 5 last lines by 2 signs to the left. Maybe this helps


One Example from my “automation.yaml”

Or missing after the “- action:” the “data:” ???