Multi devices control Bradlink RM3

Hi everybody !

I receive my broadlink rm3 mini, and it works great with HA and my hifi station !

My problem is that I can’t add devices in HA, like my tv, and blu-ray station… No problem on the Broadlink App !
So my troubles come from the file : switch.yaml but I don’t know where !!
It started normally and no error during verification, but when I look at the state page no one switch from broadlink appears (no trouble with other switches

Could you help me ? (I reduced IR code to be cleaner)

  - platform: tplink
    host: 192.168.1.XX
  - platform: rpi_gpio
    ports:
      11: Buzzer
      18: Countdown
  - platform: broadlink
    host: 192.168.1.XX
    mac: 'xx:xx:xx:xx:xx:xx'
    switches:
      chaine_philips_off:
        friendly_name: "Chaine Hifi OFF"
        command_on: 'JgAsAB4dHR0eHTs6Ozo8HB46HR07AAAAAA'
      chaine_philips_cd:
        friendly_name: "Chaine Hifi CD"
        command_on: 'JgA0AB0dHh0dHjs6Ox0eOR4dHRADQUAAAAA'
      chaine_philips_tuner:
        friendly_name: "Chaine Hifi Tuner"
        command_on: 'JgA0AB4dOzo7HR4cHjoeHR0dHh00eHR0eHR0ADQUAAAAA'
      chaine_philips_tape:
        friendly_name: "Chaine Hifi Tape"
        command_on: 'JgA0AB4dHdHR0eHR0ADQUAAAAA'
      chaine_philips_aux:
        friendly_name: "Chaine Hifi Aux"
        command_on: 'JgA0A0eHR0dHh0dHh0ADQUAAAAA'
      chaine_philips_volume:
        friendly_name: "Chaine Hifi Volume"
        command_on: 'JgA0AB4dHR0eHTsdHsdHR0fHB4ADQUAAAAA'
        command_off: 'JgAwAB0dPDk8HBPBwfHB46HgANBQAAAAAAAAAA'
      chaine_philips_mute:
        friendly_name: "Chaine Hifi Mute"
        command_on: 'JgAwAB4dOzo7HR0dHh0eHB4deHTo7HgANBQAAAAAAAAAA'
        command_off: 'JgAwAB4dOzo7HR0dHo7HgANBQAAAAAAAAAA'
      chaine_philips_suivant_précédent:
        friendly_name: "Chaine Hifi Suivant"
        command_on: 'JgAwAB0dHh0dAANBQAAAAAAAAAA'
        command_off: 'JgAwAB0dHh0dHTwAAAAAA'
      tv_lg_on_off:
        friendly_name: "Télé ON/OFF"
        command_on: 'JgBIAAABIpUSExITTEhMSOBI4EjgSExI4EjgSOBI4EQANBQ'
      tv_lg_volume:
        friendly_name: "Télé Volume"
        command_on: 'JgBIAAABF5QSExETEjgRExETEhMREhETEhNxI3EQANBQ'
        command_off: 'JgBIAAABF5QSExAUETgSExERMRExETEBQRExESETEQANBQ'
      tv_lg_hdmi:
        friendly_name: "Télé HDMI"
        command_on: 'JgBIAAABF5QRExITEDkR4ERMQFBAUEBMRExEQANBQ'
      tv_lg_ok:
        friendly_name: "Télé OK"
        command_on: 'JgBIRMQFBA4ERMQOBE4ERIROBE3ETcSEhE3EQANBQ'
      blu_ray_on_off:
        friendly_name: "Blu-Ray ON/OFF"
        command_on: 'JgCEAFAXESoRFhXERYSFRIpERCsRKQANBQAAAAA'
      blu_ray_tiroir:
        friendly_name: "Blu-Ray Tiroir"
        command_on: 'JgCEAFERFxEqEFxEWERqECsQKwANBQAAAAA'
      blu_ray_play:
        friendly_name: "Blu-Ray Lecture"
        command_on: 'JgCEAE4UFBMoExQTKQTKBMoExQTKBMUQAAAAA'
      blu_ray_pause:
        friendly_name: "Blu-Ray Pause"
        command_on: 'JgCEAE8IUFBMUFBMoEycUJwANBQAAAAA'
      blu_ray_stop:
        friendly_name: "Blu-Ray Stop"
        command_on: 'JgCEAE8TFBMUFKBMUExUTExQnFCcTKAANBQAAAAA'

Thank you !!!

Hmmm it looks OK, but I don’t have the 2 spaces down the left hand side, so - platform starts at the left hand edge with no space. The other thing is are you sure the IP and mac address’s are correct?

Hi Keith666 !

I’m sure mac adress and IP are corrects, because if I remove TV and Blu-ray rows, Hifi switches appears normaly !!

But if I add other devices like in file (above) no Broadlink switches appears !

So I think there is a trouble when it changes of device !

Do you have many devices ?

If yes, could you give me your file ?

thank you !!

The IP and mac address bit is irrelevant, they’d appear regardless but just wouldn’t work when you click on them if they were wrong.

Have you tried the obvious things like changing or simplifying names, removing accents and slashes etc? It’s nothing to do with multiple devices as they aren’t seen like that, every one is an individual switch regardless of what it’s controlling.

Adding just one until it works and then putting more in is also a better approach as it’s simpler to track down what you’ve done wrong.

friendly_name: “Télé ON/OFF”

As @Bobby_Nobble said I would change the above to friendly_name: “TV ON_OFF”

Is anything showing up in the log?

Try to add both command_on & command_off
e.g.

chaine_philips_off:
 friendly_name: "Chaine Hifi OFF"
 command_on: 'JgAsAB4dHR0eHTs6Ozo8HB46HR07AAAAAA'
 command_off: 'JgAsAB4dHR0eHTs6Ozo8HB46HR07AAAAAA'

Hi !
Thank you for all your answers !!
I tried all your propositions, unfortunately it doesn’t work… :frowning:

my switch.yaml is :

  - platform: tplink
    host: 192.168.1.xx
#  - platform: tplink
#    host: 192.168.1.xx
  - platform: rpi_gpio
    ports:
      11: Buzzer
      18: Countdown

  - platform: broadlink
    host: 192.168.1.xx
    mac: 'xx:xx:xx:xx:xx:xx'
    switches:
      reciever:
        command_on: 'switch_packet on'
        command_off: 'switch_packet off'

  - platform: broadlink
    host: 192.168.1.xx
    mac: 'xx:xx:xx:xx:xx:xx'
    timeout: 15
    friendly_name: TV
    type: rm_mini
    switches:
      tv:
        friendly_name: "tv_on_off"
        command_on: 'JgBIAAABIpUSExITEjgSExITEhMSExITEjgSOBBQ'
        command_off: 'JgBITEhMSExI4EhMSExETEhMSOgSOBI4EQANBQ'
      tv_volume:
        friendly_name: "tv_volume"
        command_on: 'JISEhMREhETEhIROBETEDgSNxE4ETgRNxI3EQANBQ'
        command_off: 'JgBTEBQRExESETgQORA4ETgROBA4EQANBQ'
      tv_hdmi:
        friendly_name: "tv_hdmi"
        command_on: 'J4ERMQFBAUEBMRExETEDgRExE4ETcQORA4EQANBQ'
        command_off: 'JgBIAFBAUEBMRExETEDgRExE4ETcQORA4EQANBQ'
      tv_ok:
        friendly_name: "tv_ok"
        command_on: 'JBISERMQFBA4ERMQOBE4ERIROBE3ETcSEhE3EQANBQ'
        command_off: 'ROBETERMQOBISERMQFBA4ERMQOBE4ERIROEQANBQ'

  - platform: broadlink
    host: 192.168.1.xx
    mac: 'xx:xx:xx:xx:xx:xx'
    timeout: 15
    friendly_name: Hifi
    type: rm_mini
    switches:
      chaine_hifi_off:
        friendly_name: "hifi_off"
        command_on: 'JgAsAB4dHR0eHTs6Ozo8HB46HR07HAAAAAAAAAAAAAAAA'
      chaine_hifi_cd:
        friendly_name: "hifi_mode_cd"
        command_on: 'JgA0AB0dHh0dHjs6OxHB46HR0eHR0eHR0dHh4ADQUAAAAA'
      chaine_hifi_tuner:
        friendly_name: "hifi_mode_tuner"
        command_on: 'JgAdHR4dHR0eHR0eHR0ADQUAAAAA'
      chaine_hifi_tape:
        friendly_name: "hifi_mode_tape"
        command_on: 'JgA0AB4dHR4dHTsdHjo6Ox0dHhHR0ADQUAAAAA'
      chaine_hifi_aux:
        friendly_name: "hifi_mode_aux"
        command_on: 'JgA0AB4dHR0eHTs6Ph0dHh0ADQUAAAAA'
      chaine_hifi_volume:
        friendly_name: "hifi_mode_volume"
        command_on: 'JgA0AB4dHR0eHTsdHhsdHR0fHB4ADQUAAAAA'
        command_off: 'JgAwAB0dPDk8HB8cHhwfHBNBQAAAAAAAAAA'
      chaine_hifi_mute:
        friendly_name: "hifi_mode_mute"
        command_on: 'JgAwAB4dOzo7HR0dHh0eHB4dHjANBQAAAAAAAAAA'
      chaine_hifi_suiv_prec:
        friendly_name: "hifi_mode_prec_suiv"
        command_on: 'JgAwAB0dHh0dHT43PjceQAAAAAAAAAA'
        command_off: 'JgAwAB0dHh0dHTw5PDodHTwcHh0eHBAAAAAAAAA'

  - platform: broadlink
    host: 192.168.1.xx
    mac: 'xx:xx:xx:xx:xx:xx'
    timeout: 15
    friendly_name: Blu-Ray
    type: rm_mini
    switches:
      br:
        friendly_name: "bluray_on_off"
        command_on: 'JgCERKhAXERYSFRIpERcRKRIpERYRKQANBQAAAAA'
      br_tiroir:
        friendly_name: "bluray_ouvert_ferme"
        command_on: 'JgCEAFERFxEqESkSFhEpEhYRFBQAAAAA'
      br_play:
        friendly_name: "bluray_stop_lecture"
        command_on: 'JgCEAE4UFBMoExQTKBMnFBQTFBMUEyAAAAA'
        command_off: 'JgCEAE8TFBMUFBQTAAAA'
      br_pause:
        friendly_name: "bluray_pause"
        command_on: 'JgCEAE8TJxMUFBQTJxQnFBQTFRIUEygTFRIAAAA'

That’s strange, because Hifi, TP link and GPIO are detected but not TV and Blu-ray…
When I check, all is ok.
But in my logs…

2017-08-05 17:32:32 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
    return fut.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py", line 133, in setup_platform
    device_config.get(CONF_COMMAND_OFF)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py", line 159, in __init__
    self._command_on = b64decode(command_on) if command_on else None
  File "/usr/lib/python3.4/base64.py", line 90, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
2017-08-05 17:32:32 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
    return fut.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py", line 133, in setup_platform
    device_config.get(CONF_COMMAND_OFF)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py", line 159, in __init__
    self._command_on = b64decode(command_on) if command_on else None
  File "/usr/lib/python3.4/base64.py", line 90, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
2017-08-05 17:32:33 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
    return fut.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py", line 133, in setup_platform
    device_config.get(CONF_COMMAND_OFF)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py", line 159, in __init__
    self._command_on = b64decode(command_on) if command_on else None
  File "/usr/lib/python3.4/base64.py", line 90, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

So you now have 3 RM Minis?

Huge clue in the log… “Incorrect padding” …you don’t have the extra two spaces at the front if using !include files.

Why don’t you try simplifying everything as we’ve suggested rather than going in the opposite direction, add the Broadlink directly to your configuration.yaml along with ONE of the switches you are saying doesn’t work? Correct your typing until that works, make sure they’re spaces not tabs, and then add switches one by one, when you’re happy all is good add them to your switches.yaml, remembering to lose those extra spaces.

I actually get this same “incorrect padding” error with my RM Mini and it happens whenever I do not append a “=” to the end of the base64 string. This happens to me with all of my switches in the configuration file, not an !include file.

2 Likes

I’m having similar problems configuring multiple RM 3 minis. The first one is recognised, the others aren’t and are generating the ‘incorrect padding error’. I’ve tried cutting and pasting the code of the working one and changing just the MAC, IP and one character of the switch names, and its still not working. I’m not sure what to try next?
Could someone with multiple working units please post their config file?

If you get padding errors you normally have to add 1 or 2 ‘=’ to the end of the base64 string. Having said that I only have one so maybe it’s something different :frowning:

I restarted HA tonight and now its working. A dozen or so restarts yesterday didn’t seem to matter. Oh well, if it’s working now, I’m not going to keep trying to ‘fix’ it.

is there anyway to get current state of devices attached to broadlink rm mini3.
Please guide.
Thanks in adv.

It’s not possible to get states as RF and IR devices do not provide any feedback to the device that sends out the RF or IR signals.

Dear,
need help.
i have connected my media device and ac with broadlink mini3
i would like to track my devices as if its on/off.
how can i do that?
please guide
thanks

It is not possible.

If I want to somehow do it with additional hardware,
What hardware should I use and how to integrate it?
Please guide
Thanks

Hello kirpat, I have a USB socket on my satellite receiver, to this I have a Wemos D1 Mini connected. When I turn on the receiver, the Wemos D1 logs on to my network. With the custom_component “Smartir” the status of the Wemos D1 is queried and displayed accordingly in HA. Alternatively, the Wemos D1 can be displayed as “binary_sensor: -platform: ping”. Or what else would be a smart outlet with power consumption!?! But this only shows the on / off status