Trying to set a script using broadlink.send

Hello, I am new here. Having trouble to set a script using broadlink.send service. This what I wrote in script.yaml:

temp_up:
sequence:
- service: broadlink.send
data:
host: 192.168.0.3
packet: “JgBYAAABJpEUNRQRFBAUERQRExEUERM2ExEUNRQ1FBETERQ1FDUUERM2FBAUNRQRFBAUERQREzYTERQ1FBETNhM2EzYTNhMRFAAFZAABJUkTAAw9AAEmSBQADQU=”

After that I check it and resta HA. But I do not know how to set it later. Could anyone help me?

Thanks in advance.

No need to restart home assistant, you can reload scripts and some other things at configuration > server controls. Enable advanced mode in your profile if you can’t see it (the icon at the bottom of the sidebar). Also you can now use that script in an automation, Lovelace card, etc. or execute it manually at developer tools > states or configuration > scripts.

1 Like

Use the </> icon in the comment menu bar to format the text! It’s hard to tell if you have a syntax or spacing error. That button will preserve spacing (and even highlight things) for you.

temp_up:
  sequence:
    - service: broadlink.send
      data:
        host: 192.168.0.3
        packet: "JgBYAAABJpEUNRQRFBAUERQRExEUERM2ExEUNRQ1FBETERQ1FDUUERM2FBAUNRQRFBAUERQREzYTERQ1FBETNhM2EzYTNhMRFAAFZAABJUkTAAw9AAEmSBQADQU="

now if youw ant to use this script, open up dev tools -> services and call it.

service: script.temp_up

There is no need to pass in variables since you’ve defined them all.

You would use it the same way in automations and the like.

I would recommend putting quotes around 192.168.0.3. It might not be necessary, but it certainly won’t hurt anything.

trigger: 
  ...
condition:
  ...
action:
  - service: script.temp_up
  - service: another.service
    ...

Hi Jim,

“now if you want to use this script, open up dev tools → services and call it.” > Trying to call it there but I get this message:

Error handling message: expected dict for dictionary value @ data[‘service_data’]. Got ‘192.168.0.3’

I am definitily missing something.

This helped me out!

https://siytek.com/category/smart-home-tek/home-assistant/