So, I’m trying to get a Xiaomi Smart Switch to work with my Home Assistant configuration and, I get as far as turning switches/lights on or off, using automations linked to the button, but I can’t get it working with the script I use to turn my TV On/Off via my Broadlink RM Pro.
- alias: Turn On Xiaomi Switch 2
trigger:
platform: state
entity_id: light.light_8
to: 'off'
action:
service: switch.turn_on
entity_id: switch.xiaomi_smart_plug_2
The above code works turning my smart plug on, so conceptually, it works.
I’ve tried just substituting the entity_id with my script entity, but I imagine I need to change the service (under action) as well. Any help on how to get this working?