Xiaomi Aqara wall switch not switching anymore

Hi all,

Recently I integrated a Xiaomi Mi control hub into my Home assistant set-up. I connected both an ‘Aqara Wireless Remote Switch - double rocker’ and an ‘Aqara Motion Sensor’. It took some fiddling around (because of my inexperience), but I got it working nicely.

I am using Home Assistant 0.83.2 running on Hassbian.

However, for some reason (i.e.I changed the name of the device within HA, updated HA, another reason?), the switch is not working anymore.

I have noticed:

  • the switch actions are still shown in the mi-home app (so the switch itself is working)
  • the gateway itself is connected correctly to home assistent (I can activate the gateway light and the motion sensor is used in an automation and works fine)
  • the switch actions do not update the ‘last action’ anymore in the HA interface
  • If I press the switch buttons, I am seeing a response in the log files (with debug mode on), so the switch action is being received by HA.
  • If I trigger the automation manually from HA, it is correctly turning on the Gateway light.

I have configured the gateway with the following configuration:

xiaomi_aqara:
discovery_retry: 5
gateways:
- key: xxxxx

These are the relevant lines in the logging:

2018-12-08 13:51:16 DEBUG (Thread-24) [xiaomi_gateway] MCAST (report) << {‘cmd’: ‘report’, ‘sid’: ‘158d000254cd7a’, ‘model’: ‘86sw2’, ‘short_id’: 15551, ‘data’: ‘{“channel_0”:“click”}’}
2018-12-08 13:51:16 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000254cd7a: off>: {‘channel_0’: ‘click’}
2018-12-08 13:51:16 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000254cd7a: off>: {‘channel_0’: ‘click’}
2018-12-08 13:51:16 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000254cd7a: off>: {‘channel_0’: ‘click’}
2018-12-08 13:51:16 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event xiaomi_aqara.click[L]: click_type=single, entity_id=binary_sensor.wall_switch_left>

I am trying to use the left switch in an automation with the following configuration:

#Wandschakelaar links
- id: 'Wall Switch left'
  alias: Wall Switch left
  trigger:
  - event_data:
      click_type: single
      entity_id: binary_sensor.wall_switch_left
    event_type: click
    platform: event
  action:
    service: light.toggle
    entity_id: light.aqaragateway

Does anyone have an idea how to further research/fix this? I am stuck.

  • Prefix all xiaomi_aqara events with “xiaomi_aqara”. Please update your automations: motion -> xiaomi_aqara.motion , click -> xiaomi_aqara.click , cube_action -> xiaomi_aqara.cube_action (@syssi - #17354) (binary_sensor.xiaomi_aqara docs) (breaking change)

There was a breaking change in the Aqara component – the event-type is now aqara_click

See https://github.com/home-assistant/home-assistant/pull/17354 and https://www.home-assistant.io/blog/2018/11/29/release-83/#read-more

There was also another bug related to click handling, which will be fixed in the next release: https://github.com/home-assistant/home-assistant/pull/19102

Thanks a lot, that helped :slight_smile:

1 Like

You can use Xiaomi Gaetway to manage wall switches? I purchased 4 switches and i can’t automate with click or aqara_click: Xiaomi_aqara.click not found