Broadlink IR codes issues...

Hi All, i'm having problems with Broadlink RM pro switches. i have the switches setup correctly & can see them in home assistant without issues.

however, when i learn the remote codes & insert them into the configuarion.yaml all of my broadlink switches dissapear!

i'm thinking that the remote codes are somehow too long for homeassistant to parse?! does anyone have any experience with this?

media_player:
  - platform: plex

light:
  platform: limitlessled
  bridges:
    - host: 192.168.0.139
      groups:
      - number: 1
        name: cinema downlights
      
emulated_hue:
  host_ip: 192.168.0.143
  listen_port: 8300
  off_maps_to_on_domains:
    - script
    - scene
  expose_by_default: true
  exposed_domains:
    - light
    - switch
    - script

switch:
  - platform: command_line
    switches:
      socket_projector:
       friendly_name: "Projector Power"
       command_on: "/home/andrew/scripts/lightwaverf.sh R5D1 ON"
       command_off: "/home/andrew/scripts/lightwaverf.sh R5D1 OFF"
       
  - platform: broadlink
    host: 192.168.0.114
    mac: 'xxxxxxxxxxxx'
    timeout: 15
    switches:
      # add switches below in this format no capital letters:
      projector_standby:
       friendly_name: "Projector Standby"
       command_on: 'JgCQAAABLZEWEBUQFhAVEBYPFhAVEBYPFhAVEBYQFRAVNhU1FhAVEBY1FTUWNRU2FRAVEBY1FRAWEBUQFg8WEBU1FjUWDxY1FQAF6AABLJIWEBUQFRAWEBUQFg8WEBUQFhAVEBUQFhAVNRY1FRAWEBU1FjUWNRU1FhAVEBY1FRAWDxYQFRAWEBU1FjUVEBY1FQANBQAAAAAAAAAA='
       command_off: 'JgDYAAABLJIWEBUQFg8WEBUQFhAVEBUQFhAVEBYPFhAVNRY1Fg8WEBUQFjUVNRY1FhAVEBU1FhAVNRYQFRAWEBU1FjUVEBY1FQAF6AABLJIWEBUQFRAWEBUQFRAWEBUQFhAVEBUQFhAVNRY1FRAWEBUQFjUVNRY1Fg8WEBU1FhAVNRYQFRAWEBU1FjUVEBY1FQAF6AABLJIVEBYQFRAWDxYQFRAWEBUQFRAWEBUQFRAWNRY1FRAW='

      projector_sure:
       friendly_name: "Projector Sure"
       command_on: ''
       command_off: 'JgDYAAABLJIWEBUQFg8WEBUQFhAVEBUQFhAVEBYPFhAVNRY1Fg8WEBUQFjUVNRY1FhAVEBU1FhAVNRYQFRAWEBU1FjUVEBY1FQAF6AABLJIWEBUQFRAWEBUQFRAWEBUQFhAVEBUQFhAVNRY1FRAWEBUQFjUVNRY1Fg8WEBU1FhAVNRYQFRAWEBU1FjUVEBY1FQAF6AABLJIVEBYQFRAWDxYQFRAWEBUQFRAWEBUQFRAWNRY1FRAW='

      amp_standby:
       friendly_name: "Amp"
       command_on: 'JgDYAAABHIoUMhUPFDIUDxUPFDIUEBQyFA8VMhQPFDIVMhQPFDMUDxQPFQ8UMhQyFTIUDxQQFA8UMhQzFA8UDxUPFDIUMhUyFAADPQABHIoUMhUPFDIUEBQPFDIVDxQyFBAUMhQPFTIUMhQPFTIUDxQQFA8UMhUyFDIUDxUPFA8VMhQyFA8VDxQPFDMUMhQyFAADPgABHIkVMhQPFDMUDxQPFTIUDxQyFQ8UMhQQFDIUMhUPFDIUDxUPFA8UMxQyFDIVDxQPFA8VMhQyFBAUDxQPFTIUMhQyFQANBQ='
      
      amp_game:
       friendly_name: "Select PC"
       command_on: 'JgAgAQABGosTNBIREjQTERIREjUSERI0ExESNBIREzQSNBISEjQSERISEhESNBM0EjQSEhI0EhETNBI0EhETERIREjUSERI0FAADPgABHIkVMhQPFDIVDxQPFTIUDxQyFQ8UMhQPFTIUMhQPFTIUDxUyFA8UMhUPFA8UDxUyFDIUDxUyFA8VMRUyFDIVDxQPFAADPQABHIoUMhQPFTIUDxQQFDIUDxUyFA8UMhUPFDIUMxQPFDIUEBQPFA8VMhQyFDIVDxQyFBAUMhQyFBAUDxQPFTIUDxQzFAADPQABHIkVMhQPFTIUDxQPFTIUDxQyFQ8UMhUPFDIUMhUPFDIUDxUyFA8UMhUPFA8VDxQyFDIVDxQyFA8VMhQyFDIVDxQPFAANBQAAAAAAAAAA='
       command_off: ''
      
      amp_sbox:
       friendly_name: "firestick"
       command_on:  'JgAgAQABGYwSNBMREjQSEhIREjQUEBMzFA8VMhUOFTEVMhIREjQTERI0EjQTNBIREjUSERI0ExESERIRExESNBISEjQSERM0EgADPwABGowSNBI1EjQSNBMREjQSERM0EhESEhIREhETNBIREjQTERIREjUSNBIREzQSNBIRExESNBISEhESNBMREhESNRI0EgADQAABGosSNRIREjQTERIREjQTERI0EhISNBIREzQSNBISEjQSERM0EjQSNBMREjQSEhI0EhETERIREhISNBIREzQSERI1EgADPwABGowSNBI0EzQSNBISEjQSERM0EhESERMREhESNRIREjQTERIREjUSNBIREjUSNBIRExESNBIRExESNBISEhESNBM0EgANBQAAAAAAAAAA='
      
      amp_sat:
       friendly_name: "Select Steam"
       command_on: 'JgAgAQABGosSNBMREjQSEhIREjQTERI0EhETNBIREjUSNBIREzQSERIRExESNBI1EjQSERM0EhESNBM0EhESEhIREjQTERI0EgADQAABG4oSNRIREjQSEhIREjQTERI0EhISNBIREjUSNBIREjUSERIRExESERISEhESERI1EjQSNBM0EjQSNBM0EjQSERMREwADPgABHIoUMhUPFDIUDxUPFDIVDxQyFA8VMhQPFDIVMhQPFDIVDxQPFQ8UMhQyFTIUDxUyFA8UMhUyFA8UEBQPFDIVDxQyFAADPgABHIkUMhUPFDIVDxQPFDIVDxQyFA8VMhQPFDIVMhQPFTIUDxQPFQ8UDxQPFQ8UDxUyFDIUMhUyFDIUMhUyFDIUDxUPFAANBQAAAAAAAAAA='
             
      amp_volup:
       friendly_name: "Amp Volume Up"
       command_on: 'JgBoAQABHIoUMhQPFDMUDxQQFDIUDxQzFA8UMhQQFDIUMhUPFDIUEBQPFDIUEBQyFA8VDxQPFBAUMhQPFDMUDxQyFDMUMhQyFAADPgABG4oUMhQQFDIUDxUPFDIUEBQyFA8UMxQPFDIUMxQPFDIUEBQPFDIVDxQyFBAUDxQPFBAUMhQPFDMUDxQyFDMUMhQyFQADPQABHIkUMxQPFDIUEBQPFDIVDxQyFBAUMhQPFDMUMhQPFTIUDxQQFDIUDxQzFA8UEBQPFA8UMxQPFDIUEBQyFDIVMhQyFAADPgABG4oUMhQQFDIUDxQQFDIUDxQzFA8UMhQQFDIUMhUPFDIUEBQPFDIUEBQyFA8UEBQPFA8VMhQPFDMUDxQyFDMUMhQyFAADPgABG4oUMhQQFDIUEBQPFDIUEBQyFA8UMxQPFDIUMxQPFDMUDxQPFDMUDxQyFBAUDxQQFA8UMhQQFDIUDxQzFDIUMhQzFAANBQ=='
      
      amp_voldown:
       friendly_name: "Amp Volume Down"
       command_on: 'JgBoAQABHIkVMhQPFDMUDxQPFDMUDxQyFQ8UMhQQFDIUMhQQFDIUDxQzFDIUDxUyFA8UEBQPFA8UEBQPFDIUEBQyFDIVMhQyFAADPgABG4oUMhQQFDIUDxQQFDIUDxQzFA8UMhQQFDIUMhQQFDIUEBQyFDIUEBQyFA8UEBQPFA8VDxQPFDMUDxQyFDMUMhQyFAADPgABG4oUMhQQFDIUDxQQFDIUEBQyFA8UMxQPFDIUMxQPFDIUEBQyFDIUEBQyFA8VDxQPFBAUDxQPFDMUDxQyFDMUMhQyFQADPQABG4oUMxQPFDIUEBQPFDIUEBQyFBAUMhQPFDMUMhQPFDMUDxQyFTIUDxQzFA8UDxQQFA8UDxUPFDIUEBQyFDIUMxQyFAADPQABHIoUMhQPFTIUDxQQFDIUDxQzFA8UMhUPFDIUMhUPFDIUEBQyFDIUEBQyFA8UEBQPFA8VDxQPFDMUDxQyFDMUMhQyFAANBQ=='
      
      amp_direct:
       friendly_name: "Amp Direct"
       command_on: 'JgAgAQABHIkVMhQPFDIVDxQPFDMUDxQyFBAUMhQPFTIUMhQPFTIUDxQQFDIUDxUyFDIUDxUPFDIUMhUPFDIVDxQPFDIVMhQPFQADPAABHIoUMhQPFTIUDxQPFTIUDxUxFQ8UMhUPFDIUMhUPFDIUDxUyFDIUDxUPFA8UDxUyFDIUDxUPEzMTNBMzEjQSEhIREgADPwABGowSNBIREzQSERIREzQSERI1EhESNBMREjQSNBMREjQSERMREjQSEhI0EjQSEhIREjQTNBIREjQTERIREjUSNBIREwADPwABGosSNBMREjQSEhIREjQSEhI0EhETNBIREjQTNBIREjUSERI0EjUSERIRExESERI0EzQSERIREzQSNBI0EzQSERISEgANBQAAAAAAAAAA='

  #Magic Packet WOL for HTPC
  - platform: wake_on_lan
    name: htpc
    mac_address: "xx-xx-xx-xx-xx-xx"
    host: 192.168.0.xxx

Posted Nov 30, 2017, 10:12 AM UTC

124
looknsharp•

This happens if the code isn't the proper length... May need to recapture your codes one at a time. edit: I also think you may need to have on and off codes for each switch.

2
samesoul•

you may need to have on and off codes for each switch.

Is that recommended even for switches that only use the "on" function? Like increase volume, there is "no off"

1
looknsharp•

I had issues setting mine up without off codes. So I just copied the on code to the off code space and it worked fine for me. If you don't want a switch for those ones, you can make a script using the switch and you'll get an "Activate" button on the HA front end instead of the switch. I made this after I set mine up, could be helpful https://smarthomehobby.wordpress.com/2017/09/10/teach-the-broadlink

5
samesoul•

Thanks for sharing. I was under the impression I don't need to setup off codes if I only use switch.turn_on instead of turn_off and toggle. Was I mistaken?

1
looknsharp•

I think so, because it makes a switch with this method, and it would need something to do when the switch is turned off. So you can set up a switch with a dummy "off" code then you can make a script with the single action you want and put that in the place of the switch.

2
cmenchion•

Could be formatting..please upload to pastebin.com.

I'll look atmy config when I get home. Something doesn't look right but then again that pasted config won't help show the parsing

1
IpromithiusI•

As said, formatting could be the issue, also try == on the end of the code instead of just =

1
roadrunner1024OP•

it was this & the fact that i dint have off commands for certain switches! :D

2
[deleted]•

[deleted]

1
RiseandSine•

I had an issue which was documented somewhere that when you capture the IR codes in home assistant the one that appears on the front end notifications is truncated. Double check the string as mine was only missing a few letters when copying it.

1
roadrunner1024OP•

not this unfortunatley, i was having this issue also.. but went to this page to get the codes: /dev-state

1
RiseandSine•

I think it's individual for each device string but I had to add 2 equal signs for my air con so == at the end of off and on.

Think it has something to do with not being able to read the device current status.

1
roadrunner1024OP•

yep had to add the == & also make sure i had on & off commands for each switch!

1
RiseandSine•

I made the clever assumption that because the on off button is the same then the codes must be the same, that didn't work out too well either. But I would definitely add them back 1 by 1 and test. I don't think every device has the same rules and as someone mentioned it might have to be a multiple of 4 due to using base 64?

1
samesoul•

I read somewhere that code length has to be multiples of 4. If it isn't, you need to pad it with enough = that it is. I don't know if it's true

1
ironmountain•

I had this issue three days ago when I set mine up. When I edited the end of the strings to ensure that they contained '==' instead of just the '=', everything worked perfectly.

1
roadrunner1024OP•

just tried this, no joy unfortunatley.... think i'm going to remove the switches one by one to rule out one "bad" switch

1
roadrunner1024OP•

fixed it... it was this! AND the fact i didn't have off commands in certain switches!

1
ironmountain•

Good news!

1
roadrunner1024OP•

Thanks Guys! this thread was most helpful!

in the end it was the fact that i hadnt set off commands for some of the switches AND the fact that i needed an extra = on the end of the ir codes.

heres the pastebin of the working configuration.yaml for those interested: https://pastebin.com/RLe1Kivt

1