Automation with Xiaomi Aqara Wireless Switch (Double) Switch

Hey Everyone, I’m having some issues with these automation’s when ever i press either the left or the right button on the Xiaomi pad both scripts run but i can fire them off one by one manually any thoughts? It’s as though HASS.IO is seeing the Xiaomi Aqara Wireless Switch (Double) switch as a single button even though it clearly shows up in my Home assistant as binary_sensor.wall_switch_both_158XXXXXXXXXXX, binary_sensor.wall_switch_left_158XXXXXXXXXXX,& binary_sensor.wall_switch_right_158XXXXXXXXXXX, I even tried using the Both option and HASS.IO does not even respond to that as a input.

- id: '1525140123456'
  alias: Xiaomi Button - Living Room - Lamp
  trigger:
  - event_data:
      click_type: single
      event_id: binary_sensor.wall_switch_right_158XXXXXXXXXXX
    event_type: click
    platform: event
  condition: []
  action:
  - data:
      entity_id: light.livingroom_lamp
    service: homeassistant.toggle
- id: '1525140123555'
  alias: Xiaomi Button - Living Room - Ceiling Lights
  trigger:
  - event_data:
      click_type: single
      event_id: binary_sensor.wall_switch_left_158XXXXXXXXXXX
    event_type: click
    platform: event
  condition: []
  action:
  - data:
      entity_id: group.livingroom_ceiling_lights
    service: homeassistant.toggle

idk man but im having a similar issue, the left one works for me, but if i press the right button, nothing happens, UNTIL i press the left again, and then both will fire ?

likewise with pressing both, nothing will happen. but then when i press the left side, it does both actions ?

1 Like

Hi there,

Did you upgraded the firmware of the xiaomi gateway? There was a problem a few months ago where the left button didn’t work.

Hey @clyra,

I just got the Switch and set it up the other day in HASS.IO it shows 3 options left right and both, left and right are picked up by HASS.IO but both automations are triggered regardless of what button is pressed when I try the both option HASS.IO does not pick it up but if the left or right (which ever is configured) is pressed it will trigger the button that is presses and the automation that is set to Both also, in the Mi Home app in the logs its communicating fine with the switch I can see the left, right, & both click. so it must be the communication between the Mi Gateway and HASS.IO

So the issue has expanded today the 1st Gen Xiaomi round push button is now firing off the automations that are assigned to the Xiaomi Aqara Wireless Switch (Double) Switch. However the Xiaomi Aqara Wireless Switch does not trigger the Automations assisgned to the 1st Gen Xiaomi round button. Anyone have any idea’s?? The only thing that has changed is that I have rebooted my HASS.IO other then that I’ve not made any changes to the automations that relate to those two pieces of hardware

@Danielhiversen, @pvizeli, @syssi, Hey Guys I saw on Git Hub you both worked quite a bit on this component of HASS was hopping that one of you might know what is up with HASS misreading clicks from Xiaomi

You seem to have done the same mistake that I did.
Any single-click event (like my doorbell) toggled my living room lights, and it took me ages to figure it out.

Try changing from:
event_id: binary_sensor.wall_switch_right_158XXXXXXXXXXX

To:
entity_id: binary_sensor.wall_switch_right_158XXXXXXXXXXX

1 Like

I would have never noticed that I used the Build in Automation Editor to generate that Script I didn’t type it manually so I guess there is a issue with the HASS.IO Automations that needs to be fixed.

Did you solve your issues?

I’m at work right now & do not have access to my HASS Will have to wait till I got home. Firewall Restrictions at work.

Did it work ?

Yes the issue has been resolved

@syssi Thank you for responding to my request for help.

Technical question, this switches works with any bulb through home assistant?

rgs

Yes. These are wireless buttons which don’t do anything unless you capture a button press in Home Assistant and tell it to turn something on or off.

Hi,
Do these Xiaomi Aqara Wireless switches (double rockers - WXKG02LM) work with a Conbee 2 stick plugged to Home Assistant ?
Thank you.

100% they do as that is how i use them

Thank you.
Yes I can confirm this myself since I received one a couple weeks ago and was able to integrate it to HA with my Conbee 2 :ok_hand: