Same for me as well. I upgraded to the newest version of the firmware when reconnecting it to my wifi, which apparently was a mistake, and sadly it isn’t working anymore (it’s giving me the same error niai posted.
It had been working properly with an older firmware version for months now, so it’s definitely related to the upgrade.
Yea, I had missed enabling the local LAN control as it wasnt in English on my app… So now my YAML looks like
xiaomi:
gateways:
- sid: redacted
key: redacted
interface: 192.168.0.53
but I still get
2017-05-31 12:36:30 ERROR (MainThread) [homeassistant.setup] Error during setup of component xiaomi
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 188, in _async_setup_component
None, component.setup, hass, processed_config)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/pi/.homeassistant/custom_components/xiaomi.py”, line 61, in setup
gateway[‘sid’] = gateway[‘sid’].replace(":", “”).lower()
AttributeError: ‘int’ object has no attribute ‘replace’
If I only use my key, I get
2017-05-31 13:23:58 ERROR (MainThread) [homeassistant.setup] Error during setup of component xiaomi
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 188, in _async_setup_component
None, component.setup, hass, processed_config)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/pi/.homeassistant/custom_components/xiaomi.py”, line 77, in setup
PY_XIAOMI_GATEWAY.discover_gateways()
File “/home/pi/.homeassistant/custom_components/xiaomi.py”, line 167, in discover_gateways
self.gateways[ip_add] = XiaomiGateway(ip_add, port, sid, gateway_key, self._socket)
File “/home/pi/.homeassistant/custom_components/xiaomi.py”, line 262, in init
if self._discover_devices():
File “/home/pi/.homeassistant/custom_components/xiaomi.py”, line 271, in _discover_devices
self.update_key(resp[“token”])
File “/home/pi/.homeassistant/custom_components/xiaomi.py”, line 368, in update_key
from Crypto.Cipher import AES
File “/home/pi/.homeassistant/deps/Crypto/Cipher/AES.py”, line 50, in
from Crypto.Cipher import _AES
ImportError: cannot import name ‘_AES’
Edit: I get get this w/ both pycrypto and pycryptodome
I want to automate my heating in my house (I have 10+ electric heater), I already have temperateur sensor in all rooms, I want to simply start/stop heater depending on sensors.
Question is : how can I control my heaters with Xiaomi devices ?
(I was about to add Chacon 54755 micro modules and a rfxcom but maybe there’s a trick I did not get)
My heaters are not connected to a plug, they are directly linked to wires so using a wall plug is not the “easy” solution… (maybe someone has already “opened” a Xiaomi plug and solder wire directly on it ?)
100% agree. The sonoffs are pretty much exactly what you are after:
Cheap, designed to be connected inline (as opposed to a socket), supported by HA, can switch 10A (and also 16A versions)
Just remember to check how powerful your heaters are before buying as a quick google says the 10A has a power limit of 2200w and going over that could have very serious consequences, if you don’t like house fires. If they’re based on the same voltage the 16A can do ~3500w.
fyi The Xiaomi Zigbee/Wifi plugs are also 2200w and the Aircon Companion plug is 3500w, which probably isn’t a coincidence.