So hello there…
I’ve finally managet to install HomeAssistant on OSMC and it seems that everything is working… or better, apparently everything is working.
So started HomeAssistant, it finds (with autodiscover) my Xiaomi Gateway and all my sensors.
I make the first try, just switch on the Gateway light, but I get this message:
2018-01-13 19:16:10 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
result = coro.throw(exc)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1031, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/__init__.py", line 271, in async_handle_light_service
yield from light.async_turn_on(**params)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.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/light/xiaomi_aqara.py", line 98, in turn_on
if self._write_to_hub(self._sid, **{self._data_key: rgbhex}):
File "/srv/homeassistant/lib/python3.5/site-packages/PyXiaomiGateway/__init__.py", line 292, in write_to_hub
data['key'] = self._get_key()
File "/srv/homeassistant/lib/python3.5/site-packages/PyXiaomiGateway/__init__.py", line 322, in _get_key
encryptor = Cipher(algorithms.AES(self.key.encode()), modes.CBC(init_vector),
File "/srv/homeassistant/lib/python3.5/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py", line 32, in __init__
self.key = _verify_key_size(self, key)
File "/srv/homeassistant/lib/python3.5/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py", line 18, in _verify_key_size
len(key) * 8, algorithm.name
ValueError: Invalid key size (0) for AES.
So hoping in a error of the discovery module, I’ve manually added the gateway, using the key got from MiHome app (android, not IOS, as I’ve read that IOS probably gives you a wrong key).
Same result…
So what’s the problem? Do I miss some libraries (it could be as I’m using OSMC and I could have missed something)?
Thanks in advance!