Unable to configure broadlink RM command as script in hass.io v0.86.4

Hi, I am trying to turn on my samsung tv using my RM mini. As per broadlink component wiki i am trying to configure the command as an script. However I am getting error in logs as below:

Setup failed for script: Invalid config.
1:03 PM setup.py (ERROR)
Invalid config for [script]: [samsungtv_on] is an invalid option for [script]. Check: script->script->script->samsungtv_on. (See /config/configuration.yaml, line 87). Please check the docs at https://home-assistant.io/components/script/
1:03 PM config.py (ERROR)

Below is my configuration from scripts.yaml

script:
   samsungtv_on:
       sequence:
           - service: switch.broadlink_send_packet_192_168_2_25
             data:
                { "packet" : [ JgDSAJSUEzcSNxM3EhISExISEhMSEhI3EzcSOBISEhISExISEhITNxISEhMROBI4EhISExE4EhMROBI4EhISEhI4EjgSEhIABgCUlBI3EzcSOBISEhISExISEhISOBI3EzcSEhITEhISExISEjcTEhISEjgSNxITERMSOBISEjcSOBISExISNxI4EhISAAYAlJQSOBI3EzcSEhITEhISEhITEjcSOBI3ExISEhITERMSEhI4EhISExE4EjgSEhISEjgSEhI4EjcTEhISEjgSNxITEgANBQAAAAAAAA==" ]}

When i configure the same as switch component as per wiki pages that is working perfectly. But i want to configure it as an script.

Can someone please help !!

Hi!

You don’t have to use { “packet” : [xyz] } format.
Just simple write the packet like this:

script_name:
  alias: "name"
  sequence:
    - service: switch.broadlink_send_packet_YOUR_IP
      data:
        packet:
        - IR/RF code

you don’t put script: in scripts.yaml. it is implied in the include statement in configuration.yaml. See Splitting up the configuration - Home Assistant

Thanks a lot @nickrout … That was precisely the problem … how stupid of me …

Issue resolved …

Glad to have helped :slight_smile: