Script generates an error

I was going to tell you that you had omitted to tell your automation which remote to use to send the command.

Your device_id fills that gap, but in all honesty I find it easier to use an entity_id as it’s easier to understand what it going on (there are also other good reasons why not use a device_Id)

My version of your script would look more like this"

alias: lv_fan_off
sequence:
  - action: remote.send_command
    data:
      device: living_room_fan
      command: fan_off
    target:
      # Using an entity_id here as I can both ...
      # - understand what is being targeted 
      # - update my YAML more easily if I ever replace the device
      entity_id: remote.broadlink_livingroom_01 
description: ""
icon: mdi:fan-off
1 Like