Broadlink Rm Pro Error

17-03-15 21:59:42 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 153, in _async_setup_platform
entity_platform.schedule_add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.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 137, in setup_platform
device_config.get(CONF_COMMAND_OFF)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py", line 163, 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

any one below is confif yaml

    switch:
  platform: broadlink
  host: 192.168.0.11
  mac: '34:ea:34:e7:da:b0'
  switches:
    tv_phillips:
      friendly_name: "Samsung Tv Power"
      command_on: 'JgBIAJWRFDYUNhQ4FRAUERYOFhEWDxUzFjUUNhYOFxAVDxYPFBIUEBYzGQ4UEBURExIUERQRFDYXDhQ2FTUUNhQAA4ATNhQ2FAANBQ'
      command_off: 'JgBIAJWRFDYUNhQ4FRAUERYOFhEWDxUzFjUUNhYOFxAVDxYPFBIUEBYzGQ4UEBURExIUERQRFDYXDhQ2FTUUNhQAA4ATNhQ2FAANBQ'
  1. Please use the tools available in this forum to format your test so we can actually read what you are posting.
  2. Please give more details. What kind of rm pro are you using. When does the error occur? At Startup? After calling a service?

HI
its on startup error i have broadlink RM pro ,and ther ei setup samsung tv.
i can service get code now i set in yaml and try to restart hass then i am getting this error and cant see switch on dashboard.
thanks

1 Like

So there seems to be something wrong with the base64 string you give for command_on / command_off. Can you try and remove the switch and get that command again? You could also try to replace your command_on / command_off with this

JgBYAAABJ5IUEBU1FBAVEBQ1FRAUNRU1FBEUEBU0FTUUERQ1FDUVEBQ1FTUUEBU1FBAVEBQ1FTUUERQQFTQVEBU1FDUUERQQFQAFFQABJ0gVAAw9AAEnSBUADQU=

which is a currently working one in my config, for testing.

~Cheers

Yes you are write there was problem with code
here is orignal code that i get again

switch 1:
  platform: broadlink
  host: 192.168.0.11
  mac: '34:ea:34:e7:da:b0'
  timeout: 15
  switches:
tv:
  friendly_name: "TV Power ON/OFF"
  command_on: 'JgBIAJWRFTUVNRU1FRAUERYPFREWDxUzAANoNRQ2Fg4XEBUPFg8UEhQQFjMZDhQQFRETEhQRFBEUNhcOFDYUNhQ2FDYUNhQ2FAANBQ=='
  command_off: 'JgBIAJWRFTUVNRU1FRAUERYPFREWDxUzAANoNRQ2Fg4XEBUPFg8UEhQQFjMZDhQQFRETEhQRFBEUNhcOFDYUNhQ2FDYUNhQ2FAANBQ=='

but now problem is nothing work no error so far however i can see rm pro blink ligh when i send command,so how can i test whats wrong

here is update log from HA

17-03-15 23:00:58 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=learn_command_192_168_0_11, service_data=, domain=broadlink, service_call_id=1972259216-7>
17-03-15 23:00:58 INFO (MainThread) [homeassistant.components.switch.broadlink] Press the key you want HASS to learn
17-03-15 23:01:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.time=23:00; friendly_name=Time, icon=mdi:clock @ 2017-03-15T23:00:10.527867+05:30>, entity_id=sensor.time, new_state=<state sensor.time=23:01; friendly_name=Time, icon=mdi:clock @ 2017-03-15T23:01:12.523040+05:30>>
17-03-15 23:01:12 INFO (MainThread) [homeassistant.components.switch.broadlink] Recieved packet is: JgBIAJSSFDYUNRU1Fw8VEBYPFREWDxUyFzUVNRUQFRAXDxUPFhAWDxY0Fw4UEBURExMTEhQRFDYWDhQ2FTUUNhQAA4oUNRQ3EwANBQ==
17-03-15 23:01:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1972259216-7>
17-03-15 23:01:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=create, service_data=message=Recieved packet is: JgBIAJSSFDYUNRU1Fw8VEBYPFREWDxUyFzUVNRUQFRAXDxUPFhAWDxY0Fw4UEBURExMTEhQRFDYWDhQ2FTUUNhQAA4oUNRQ3EwANBQ==, title=Broadlink switch, domain=persistent_notification, service_call_id=1972259216-8>
17-03-15 23:01:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, entity_id=persistent_notification.notification_2, new_state=<state persistent_notification.notification_2=Recieved packet is: JgBIAJSSFDYUNRU1Fw8VEBYPFREWDxUyFzUVNRUQFRAXDxUPFhAWDxY0Fw4UEBURExMTEhQRFDYWDhQ2FTUUNhQAA4oUNRQ3EwANBQ==; title=Broadlink switch @ 2017-03-15T23:01:12.559589+05:30>>
17-03-15 23:01:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1972259216-8>

Sorry for trouble i think RM Pro give me first wrong code at last i get final code
command_on: ‘JgBGAJWRFTUVNRU1FRAUEBcPFREWDxUzFTUVNRcPFhAVDxUQFBIUEBY0GA4UEBURGhIUERQRFDYXDhQ2FDQVNxQ2FDYUNhQADQUAAA==’
command_off: ‘JgBGAJWRFTUVNRU1FRAUEBcPFREWDxUzFTUVNRcPFhAVDxUQFBIUEBY0GA4UEBURGhIUERQRFDYXDhQ2FDQVNxQ2FDYUNhQADQUAAA==’

which is differnt then previous .
thanks for all who ever help me specially PhyberApex

Hi
need some more help if anyone can help
1.)Volume control with RM Pro
2.)channel tune Number keypad if possible
any one .
thanks

You can use the send_command_IP service to send those commands. I recommend making a script for things that go together and using of a data template. Like one for volume control one for numpad stuff. Which take a parameter.

Let me know if you need any help.

~Cheers