similar error
16-12-20 16:21:51 homeassistant.components.http: Serving /api/services/homeassistant/turn_on to 192.168.1.3 (auth: True)
16-12-20 16:21:51 homeassistant.core: Bus:Handling <Event call_service[L]: domain=homeassistant, service=turn_on, service_data=entity_id=switch.asus_router, service_call_id=1977274416-7>
16-12-20 16:21:51 homeassistant.core: Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_data=entity_id=['switch.asus_router'], service_call_id=1977274416-8>
16-12-20 16:21:52 homeassistant.core: Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/home/hass/.homeassistant/custom_components/switch/broadlink.py", line 164, in _sendpacket
self._device.send_data(packet)
File "/home/hass/.homeassistant/deps/broadlink/__init__.py", line 376, in send_data
self.send_packet(0x6a, packet)
File "/home/hass/.homeassistant/deps/broadlink/__init__.py", line 235, in send_packet
response = self.cs.recvfrom(1024)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/hass/.homeassistant/custom_components/switch/broadlink.py", line 164, in _sendpacket
self._device.send_data(packet)
File "/home/hass/.homeassistant/deps/broadlink/__init__.py", line 376, in send_data
self.send_packet(0x6a, packet)
File "/home/hass/.homeassistant/deps/broadlink/__init__.py", line 214, in send_packet
aes = AES.new(bytes(self.key), AES.MODE_CBC, bytes(self.iv))
File "/srv/hass/hass_venv/lib/python3.4/site-packages/Crypto/Cipher/AES.py", line 95, in new
return AESCipher(key, *args, **kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/Crypto/Cipher/AES.py", line 59, in __init__
blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__
self._cipher = factory.new(key, *args, **kwargs)
ValueError: AES key must be either 16, 24, or 32 bytes long
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
result = coro.throw(exc)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1049, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/hass/hass_venv/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/hass/hass_venv/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 "/home/hass/.homeassistant/custom_components/switch/broadlink.py", line 150, in turn_on
if self._sendpacket(self._command_on):
File "/home/hass/.homeassistant/custom_components/switch/broadlink.py", line 173, in _sendpacket
return self._sendpacket(packet, max(0, retry-1))
File "/home/hass/.homeassistant/custom_components/switch/broadlink.py", line 170, in _sendpacket
self._device.auth()
File "/home/hass/.homeassistant/deps/broadlink/__init__.py", line 169, in auth
response = self.send_packet(0x65, payload)
File "/home/hass/.homeassistant/deps/broadlink/__init__.py", line 214, in send_packet
aes = AES.new(bytes(self.key), AES.MODE_CBC, bytes(self.iv))
File "/srv/hass/hass_venv/lib/python3.4/site-packages/Crypto/Cipher/AES.py", line 95, in new
return AESCipher(key, *args, **kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/Crypto/Cipher/AES.py", line 59, in __init__
blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__
self._cipher = factory.new(key, *args, **kwargs)
ValueError: AES key must be either 16, 24, or 32 bytes long