Thanks for the suggestion but unfortunately I still get the same error:
17-01-09 12:08:10 homeassistant.core: Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.4/asyncio/tasks.py”, line 233, in _step
result = coro.throw(exc)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/core.py”, line 1049, in _event_to_service_call
yield from service_handler.func(service_call)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/init.py”, line 87, in async_handle_switch_service
yield from switch.async_turn_on()
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity.py”, line 353, in async_turn_on
None, ft.partial(self.turn_on, **kwargs))
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 134, in turn_on
if self._sendpacket(self._command_on):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/broadlink.py”, line 148, in _sendpacket
self._device.send_data(packet)
File “/home/homeassistant/.homeassistant/deps/broadlink/init.py”, line 376, in send_data
self.send_packet(0x6a, packet)
File “/home/homeassistant/.homeassistant/deps/broadlink/init.py”, line 215, in send_packet
payload = aes.encrypt(bytes(payload))
File “/srv/homeassistant/lib/python3.4/site-packages/Crypto/Cipher/blockalgo.py”, line 244, in encrypt
return self._cipher.encrypt(plaintext) ValueError: Input strings must be a multiple of 16 in length
I have also tried doubling the codes as suggested in the GitHub topics that relate to this.
There have been a lot of bug fixes in the Broadlink component since the last release.
So it might work with the next version.
So I suggest that you wait for the next release or use the dev version: https://home-assistant.io/developers/development_environment/1
@mikehole Unfortunately I don’t have home assistant installed (yet…), I do plan to install it this week and i will be able to test it, If i’ll manage to get everything working i’ll let you know.
I went for HASS because it’s got the HueBridge out of the box so I was able to get an Orvibo S20 working with Alexa by only playing with config and no code.
Great stuff. Must admit trying to follow that thread is a little confusing will wait for the next HASS release to drop to see if I can get it going. But af far as I can tell it’s the self.device.senddata(binascii.unhexlify(packet)) line that makes the difference?