What am I doing wrong in this automation?

I’m trying to create an automation for my RM Mini IR Remote actions. I want to use a boolean so I can use a slider to toggle things off instead of using the 2 seperate power buttons in my lovelace interface.

This is the automation i’m trying to use:

- id: '1598556962367'
  alias: Woonkamer TV Aan Uit
  description: ''
  trigger:  
  - entity_id: input_boolean.televisie_woonkamer
    platform: state
  condition: []
  action:
  - service: broadlink.send
  data:
    host: 192.168.1.236
    packet:
    - JgCMAJaSEzcTNhU1ExIUERQRFBAVEBU1EzYVNRMSFBEUERQQFRAVNRQ1FTUVEBQRFBEUEBUQFRAVEBQRFDUVNRU1FDUVNRUABgCUlRM2FDYTNxITERMSExITEhMSOBI3FDYTEhEUERMSExITEjgSNxM3EhMRFBETEhMSExITEhMRFBE4EzcSOBI3EjgSAA0FAAAAAAAAAAAAAAAA

I can’t seem to recreate the error but it was something along the lines of the ‘data:’ not allowed? Am i not formatting it correctly? I’ve tried the suggestions I found on several threads but can’t find a good example on how to format my action. I’m a big automation noob so all suggestions are welcome :sweat_smile:

Try putting the packet in quotes:

    packet:
    - "JgCMAJaSEzcTNhU1ExIUERQRFBAVEBU1EzYVNRMSFBEUERQQF..."

That’s the only difference I see between your config and the example here: https://www.home-assistant.io/integrations/broadlink/#service-broadlinksend

Oh. Also your data key is misaligned. Should be

  action:
  - service: broadlink.send
    data:
      host: 192.168.1.236
      packet:
      - "JgCMAJaSEzcTNhU1ExIUERQR..."

Thank you for replying Tom! This is the config I have right now:

- id: '1598556962367'
  alias: Woonkamer TV Aan Uit
  description: ''
  trigger:
  - entity_id: input_boolean.televisie_woonkamer
    platform: state
  condition: []
  action:
  - service: broadlink.send
    data:
      host: 192.168.1.236
      packet:
      - "JgCMAJaSEzcTNhU1ExIUERQRFBAVEBU1EzYVNRMSFBEUERQQFRAVNRQ1FTUVEBQRFBEUEBUQFRAVEBQRFDUVNRU1FDUVNRUABgCUlRM2FDYTNxITERMSExITEhMSOBI3FDYTEhEUERMSExITEjgSNxM3EhMRFBETEhMSExITEhMRFBE4EzcSOBI3EjgSAA0FAAAAAAAAAAAAAAAA"

I get this error message:

And when I look in the GUI Editor the formatting is different, maybe this has to do with it?

I’m probably missing something very stupid since I’m a big noob when it comes to automations and the “scripting”. Been going at this for more hours then I would like to admit!

Have you tried calling the service from Developer Tools and check if it works?

I personally use scripts:

denon_sel1:
  sequence:
    - service: broadlink.send
      data:
        host: 192.168.0.40
        packet:
          - "JgAyAW44DBAMEA4pDg4OKg4NDioMEA4ODikODgwQDikOKg4ODg4MEA0ODw0PDQwQDg4OKQ8NDioMEA4NDw0NDw4ODioODQ0PDioODg4ODikMEA4ODg4OKQ4qDg4ODQ4qDBAQCw8ODQAJlm83Dg4MEA4pDw0PKQ4ODikODg4ODioODQ4ODioOKQ4ODg4ODg4ODg4ODQ4ODg4OKg4NDykMEA4ODg4MDw8NDioODg4ODikODg4ODikNDwwQDg4OKQ8pDBAODg4pDQ8ODg4ODQAJl3A2Dg4PDQ4qDg4OKQ4ODikPDQ8NDioMEA4ODikOKg4NDQ8ODg4ODg4ODg4ODg0PKQ4ODikNDw4ODg4ODgwQDikODgwQDikPDQ4ODioMEA4NDg4OKg4pDw0ODg4pDg4PDQ4ODgANBQAAAAAAAA=="

That appears to be what his image is showing.