Good day!
I can’t set up automation through the xiaomi button.
Here is an example of a working and non-working automation of my program. Please tell me what is my mistake?
# automations.yaml
# Don't Work
- alias: toggle_all_light
trigger:
- platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.aqara_button
click_type: single
action:
service: light.toggle
entity_id: light.lightbulb_001f
# Work
- alias: toggle_full_light
trigger:
- platform: state
entity_id: switch.relay1
to: 'off'
action:
service: light.toggle
entity_id: light.lightbulb_001f
The name of the “binary_sensor.aqara_button” is taken from the device tab by the name of the battery sensor. Nothing else is displayed for this device.