Hi All! Firstly great work to all contributors. Following guide here was able to get my Xiaomi switch, temp/humidity, gateway light, motion sensor & window/door sensor all showing and working. Can see the power plug listed anywhere. Below is ALL output that relates to Xiaomi in HA.
2017-07-18 23:02:49 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform xiaomi
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.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/homeassistant/.homeassistant/custom_components/switch/xiaomi.py", line 31, in setup_platform
devices.append(XiaomiGenericSwitch(device, "Plug", 'status', True, gateway))
File "/home/homeassistant/.homeassistant/custom_components/switch/xiaomi.py", line 53, in __init__
XiaomiDevice.__init__(self, device, name, xiaomi_hub)
File "/home/homeassistant/.homeassistant/custom_components/xiaomi.py", line 449, in __init__
self.parse_data(device['data'])
File "/home/homeassistant/.homeassistant/custom_components/switch/xiaomi.py", line 104, in parse_data
self._load_power = int(data[LOAD_POWER])
ValueError: invalid literal for int() with base 10: '8.80'
I’m calling the service to play the lower number ringtones (and it works) but they don’t play as endless loops to me (although I’d like to actually). Am I missing something?
I had similar issues with my devices (both motion sensors and light sensors would turn on at almost the same time and get stuck). What seemed to solve it was moving my wifi channels to 9 and 11. The far from 6 the better, since that causes more interference with Wifi.
Nevertheless, according to a Xiaomi developer, that should be fixed in the latest firmwares. I think the gateway will report unknown instead of motion when that happens now, but I’m not sure…
Sensor is showing up fine. Tried toggling a light on and off and just does nothing. Just swapped the sensor name in one of my existing automations and it’s not working. Really not sure why.
Saw someone was saying his starts from 279. Let me do an experiment tomorrow where i will cover the gateway as well as shine light on it. Will report back the range.
where do you get the Gateway mac address? and what are 42.62.0.0/16 and 58.83.0.0/16? are those Chinese server IP address you sniffed going out to from the Xiaomi device? Thank you!!
Gateway SID is a MAC address (SID AABBCCDDEEFF -> MAC AA:BB:CC:DD:EE:FF). 42.62.0.0/16 and 58.83.0.0/16 are the addresses of the Chinese servers with which the gateway attempted to connect.