Broadlink Switches

Suddenly, after configuring more broalink switches i get the following error:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 400, in wait_for
return fut.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/broadlink.py”, line 158, in setup_platform
device_config.get(CONF_COMMAND_OFF)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/broadlink.py”, line 193, in init
self._command_on = b64decode(command_on) if command_on else None
File “/usr/lib/python3.5/base64.py”, line 88, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

Here it is the config file regarding broadlink

https://pastebin.com/xZRrSkK9

All was working good till i added the last two entries in the switches…
Any help?

the switch codes have to be a multiple of 16 (I think…). sometimes you have to add characters to the end to make it that way.

i can’t remember for sure what the character is but i’m pretty sure it is the ‘=’ sign. add or remove one or two of those to the end of the code and see if it helps. or do a search for the correct padding character.

1 Like