Turning on Yeelight with an Aqara Button (automation not working)

So for some reason after yeelight firmware upgrade my yeelight stopped being auto discovered (there are some posts around that), which I solved this way:

yeelight:
  devices:
    192.168.1.80:
      name: Yeelight

So now I can manually control the yeelight through HA, and by sensor Aqara button/switch is still there. Problem is, my automation stopped working because as the light is not auto discovered, the entity id is no longer recognized (does not appear on the entities on HA):

- alias: "Controlar Lampada Sala"
  trigger:
    # Single press bedroom round switch
    - platform: event
      event_type: click
      event_data:
        entity_id: binary_sensor.switch_158d0001d62b0d
        click_type: single
  action:
    service: homeassistant.toggle
    data:
      entity_id: light.yeelight_UNKNOWN_7c49ebb35642

What should I put on the entity id?

Go to Developer Tools -> States and look for the entity_id there.

1 Like

thanks, i changed that and the automation in HA now works when I execute manually, but pressing the switch physically does nothing.

I double checked the entity id of the switch, doesn’t seem to catch the signal.

Any ideas?

It seems now that the event type is xiaomi_aqara.click