Invalid config for [switch.broadlink]

after see this error

Invalid config for [switch.broadlink]: [gas_heater] is an invalid option for [switch.broadlink]. Check: switch.broadlink->switches->0->gas_heater. (See ?, line ?).

and reading the manual

old way


  - platform: broadlink
    mac: 'bla:bla:bla'
    switches:
      gas_heater:
        friendly_name: "Gas Heater"
        command_on: 'JgBIAAABKJYSExE5EhQRFBITEhMSExI4EhQSOBI4ExISFBE5ETkSExITEjkSExITEjgTEhEUEjkTNxEUEjgSORITEjgSOBMTEgANBQ=='
        command_off: 'JgBIAAABKZUTEhI5EhMSExITERQSExI5EhMSOBM3ExMRFBI4EjgSExE6EhMSOBE5EhMSFBITEjgSExI5ERQSExI4EjgSOREUEgANBQ=='

new way

  - platform: broadlink
    mac: 'bla:bla:bla'
    switches:
      - name: "Gas Heater"
        command_on: 'JgBIAAABKJYSExE5EhQRFBITEhMSExI4EhQSOBI4ExISFBE5ETkSExITEjkSExITEjgTEhEUEjkTNxEUEjgSORITEjgSOBMTEgANBQ=='
        command_off: 'JgBIAAABKZUTEhI5EhMSExITERQSExI5EhMSOBM3ExMRFBI4EjgSExE6EhMSOBE5EhMSFBITEjgSExI5ERQSExI4EjgSOREUEgANBQ=='

new way look heap cleaner

thanks guys

1 Like

I did so.
however error when using Switch

“Entity not available: Switch. ***”

Same here…
no way to reboot

This config works for me, new (- name) syntax with lowercase name

- platform: broadlink
  mac: 'blablabla'
  switches:
    - name: tv_onoff
      command_on: JgBYAA...
      command_off: JgBQAA...

I fixed it

How do you fixed it?

I’m struggling very hard with this issue and my eyes are spitting blood bc of staring at the screen.

I’m really a newbie and for my head it’s very strange, bc send.command “power” (developer–>services UI) works perfectly fine. But when check configuration.yaml before restarting in my case HA says this:

“Invalid config for [switch.broadlink]: [power] is an invalid option for [switch.broadlink]. Check: switch.broadlink->switches->0->power. (See ?, line ?)”

I’ve check the names of codes stored in “.storage/broadlink_remote_XXXXXXXXXXX_codes” and it’s there

I can’t understand that. I’ve tried to change the name power to command_on (as on the documentation example), then the error jumps to next command name “power_R”… It’s a remote of an electric radiator so… power to command_on I could be used to it… but power_R refers to the power of the resistance…and after these I have timer, temp+, temp- and fan… all of them in the codes.

Is there a list of limited options? I can’t found in broadlink documentation.

Thanks in advance

Show us you code so far remember to format correctly

U just need to put the it code for off/on

Ha will do the rest

1 Like

Hi, myle let’s see if I can paste the code correctly…
This is in my configuration.yaml

#Broadlink Remote
remote:
  - platform: broadlink
    host: 192.168.1.73
    mac: XX:XX:XX:XX:XX:XX
    name: RM pro+
#Estufa mando
#Estufa mando
switch:
  - platform: broadlink
    mac: XX:XX:XX:XX:XX:XX
    switches:
      - name: Estufa mando #Also I've tried estufa_mando
        power: Big Chunk of Code for power
        power_R: BCoC for power_R
        temp+: BCoC for temp+
        temp-: BCoC for temp-
        timer: BCoC for timer
        fan: BCoC for fan

then, in the .storage/broadlink_remote_XXXXXXXXXXX_codes:

"estufa_mando": {
      "power": "BCoC for power",
      "power_R": "BCoC for power_R",
      "temp+": "BCoC for temp+",
      "temp-": "BCoC for temp-",
      "fan": "BCoC for fan"
    }

And just to remember, all codes work perfectly through remote.send > broadlink>“command name” I’ve got even a multibutton card with all the options, even some “”""“more advanced”""" options by choosing differents repetitions of remote.send services to choose with one click the temperature + power_R + timer…etc with one single click

What do you mean I only need to put code for ON/OFF?.. It’s the same code for on and for off, it’s a very simple remote…and the other options?? This I can’t understand…

Thanks again… I supose it’s something as stupid as crucial, but my brain isn’t coded for coding…

NO WAY!!! I think I’ve found the problem… by typing here and looking everything and a good sleep the night before, of course…I think my mind has enlightened itself…
Just moved everything from ‘switch:’ to ‘fan: BCoC for fan’ under the hierarchy “remote:”… I mean, it was a problem of format…like myle suggested…as I said “as stupid as crucial”

Of course…‘switch:’ was not under ‘remote:’ hierarchy…it was another ¿domain? Here’s the code that allows me to pass the yaml check.

#Broadlink Remote
remote:
  - platform: broadlink
    host: 192.168.1.73
    mac: XX:XX:XX:XX:XX:XX
    name: RM pro+
#Estufa Mando
    switches:
      - name: Estufa mando
        power: BCoC for power
        power_R: BCoC for power_R
        temp+: BCoC for temp+
        temp-: BCoC for temp-
        timer: BCoC for timer
        fan: BCoC for fan

Thanks for everything

10 out 10 for code formatiing

Where did you get the power: Bcoc for power

My understanding is could u replace the power: with command_on: bcoco for power

Do the right caps thing

If you look at first post the setting look different

Don’t know where you got those command from

doing on phone in hospital sorry for bad English and formatting

1 Like

Hello myle. Don’t worry about format.

Sorry just, to make a shortcut BCoC is my acronym for Big Chunk of Code that I just used this time. Because the codes are insanely long…so to make things short and more easy readable.

As I said in my last post, I just found the error, it was a problem of misunderstanding how to add the field ‘switch:’. I thought it was another ¿domain? like ‘remote:’ and it was missplaced, just add som tab spacing to get ‘switch:’ under ‘remote:’ hierarchy and HA yaml check was OK.

Thanks again!

Yeap the bloody spacing think it took me about 3 months get my head around it?

1 Like