Script error with Broadlink mini

Hi all, having a problem with script syntax, probably something really basic that I’m missing but I can’t work it out.

I am trying to build a script to trigger my Broadlink RM Mini to turn my TV on as follows:

script:
  tv_lr_on:
  sequence:
    - service: switch.toggle
      data: 
        entity_id: switch.tv_lr

My switch is set up as follows:

  name: Living Room Broadlink
  platform: broadlink
  host: 192.168.0.154
  mac: 'B4:43:0D:CC:25:1C'
  switches:
    tv_lr:
     friendly_name: "Living Room TV Power"
     command_on: 'JgCMAJOVEjcSORE3EhMSFBAVEBQSExE4EjcSORETERQSExEUEBQSExI3ERURExEUERMRFRETEjcSFBA4EjgROBI4EjcTOBAABgKTlRI3EjgSNxIUERMRFBEUERQROBI3EjgRExMTERQRExEUERMTNxITERQRFBEUERMSExE5ERMROBM3EjcSOBM2EzcSAA0FAAAAAAAAAAAAAAAA'
     command_off: 'JgCMAJOVEjcSORE3EhMSFBAVEBQSExE4EjcSORETERQSExEUEBQSExI3ERURExEUERMRFRETEjcSFBA4EjgROBI4EjcTOBAABgKTlRI3EjgSNxIUERMRFBEUERQROBI3EjgRExMTERQRExEUERMTNxITERQRFBEUERMSExE5ERMROBM3EjcSOBM2EzcSAA0FAAAAAAAAAAAAAAAA'

When doing a config check I get the following:

expected a dictionary for dictionary value @ data['script']['tv_lr_on']. Got None. (See /config/configuration.yaml, line 105). Please check the docs at https://home-assistant.io/components/script/
2017-08-01 09:40:10 ERROR (MainThread) [homeassistant.setup] Setup failed for script: Invalid config.

I am able to send packets to the TV to toggle it on and off (the packet data is identical for both) and can do the same from the GUI, so I’m guessing it’s my script syntax. Any ideas?

(I have already checked https://home-assistant.io/components/script/ and https://home-assistant.io/docs/scripts/)

Rather than a script I just do …

 - service: switch.turn_on
   entity_id: switch.tv_lr

under the action in my automations.

In scripts I do…

  tv_lr_on:
    alias: Turn TV On
    sequence:
      - service: broadlink.send_packet_192_168_1_208
        data:
          packet: 'JgCMAJOVEjcSORE3EhMSFBAVEBQSExE4EjcSORETERQSExEUEBQSExI3ERURExEUERMRFRETEjcSFBA4EjgROBI4EjcTOBAABgKTlRI3EjgSNxIUERMRFBEUERQROBI3EjgRExMTERQRExEUERMTNxITERQRFBEUERMSExE5ERMROBM3EjcSOBM2EzcSAA0FAAAAAAAAAAAAAAAA'

Hopefully that will help :slight_smile:

Is it an indentation problem? Shouldn’t sequence be indented two spaces?

That could be it…still pretty new to YAML

Hi, tried your suggestion by indenting sequence and everything that followed, still no joy. Really need to sit down and have a close look at this one soon.