got the same problem here, but only happen when adding new code learn after upgrade to 0.36
17-01-16 18:42:45 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 151, in _async_setup_platform
entity_platform.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 115, in setup_platform
device_config.get(CONF_COMMAND_OFF)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py”, line 141, 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
Update of the incorrent padding error, apparently this only happen on some remote control, the code it learn just doesn’t work and break the code, but other remote works ok.
I have another problem, don’t know if any other have similar issue.
I have tested the e-control app, rm bridge and broadlink tasker plugin, they all works perfectly with the same remote, however, that same remote doesn’t work in HA for some reason, I have tried to learn the code from another rm pro which can turn on/off from e-control without problem, but it just doesn’t work in HA, I have tried day and night for the last 2 days and about the give up, just wondering if I can get the rf code from other source (e-control app, rm bridge and broadlink tasker plugin) and insert it in HA?
I assume rm bridge and tasker plugin also use the same broadlink library, so they should work the same, right?
I had rm bridge setup and using command_line switch before, since ha now support broadlink so I am trying to migrate all the remotes from rm bridge to ha broadlink so I don’t need an active android device all the time.
I just find some python script to extract code from e-control rmt.db database. Lets see if it works.
UPDATE: I extracted the code from e-control database, but it doesn’t work when I paste it in HA, I guess the HA broadlink use different format to send the signal.
Maybe you have already done this before but I just notice a Search Button on the top right of E-CONTROL app (when adding a new remote), witch can load a plenty of cloud saved remote controls all over the world. You just type Livolo, and get many saved remotes to use, without learning… that is fantastic, once we do not need owning a hardware remote to use it.
Now you should familiarize with the script created for decoding packages from the e-control app on a rooted android phone… Have anyone tried it before? If yes, could you give me the directions? I can’t even remember where I have seen it, but I know it exists…
how can I use it with HA?
just convert to base64 and will it work?
like this:
from:
e91934000d210d210d210d210d210d210e210d21230b0d210d210d210d00015a0f200e20240a240a0e20240b240a240b230b0d210d210d2100000000
to:
6RY0ACMLDCINIQ0hDSENIQ0hDSENIQ0hDiEOIA0hDSEOISQLDQABWw8gDiAlCiQKDSEjCyMLIwwAAAAA
UPDATE: So just to verify, the code extracted from e-control then convert to base64encode works fine in HA broadlink, so the problem narrow down to just the learn function of the HA broadlink, it learn the code but doesn’t work when send (no error shows in log)
But first use this script to test that the code is working with RM (in hex format)
If it doesn’t work directly with the RM and you get an error like this: ValueError: Input strings must be a multiple of 16 in length then you should duplicate the code until it is in the right length 1 time 2 times and so on…, after that encode it to base 64 and try with HA.
If it doesn’t work with HA you probably will need to edit: