Great work, thank you!
BTW just saw the cube controller for 12.42 €
can you share?
Mine is arriving too (I hope as post from China can take 1 week, 1 monthm, 1 year, or simply never arrive))
I just noticed something strange relating to wrong status of the sensors.
I had a motion sensor that got stuck in the ‘on’ state, even though the history bar shows it as off. This is with edge on my phone. I opened up chrome on my other phone and everything displayed fine. The motion sensor is off and history showed it was triggered in the past. It showed the red little bar and then the off blue bars.
Might be something to consider and put into a FAQ section.
Did you try to refresh your phone browser?
Just wanted to say thank you to all of you and especially @rave
My setup is now working bare-bones
- Ubuntu Server with Home-Assistant, Xiaomi-Plugin, Homebridge Plugin, Homebridge
- Xiaomi GW with Plugs, Motion, Temperature
- Working in HomeKit with Siri
I’m currently ironing some things out:
- Motion does not show up in HomeKit but in HA
- Friendly names for all sensors
But works great so far. Thanks heaps.
You’re welcome. There’s a bug fix i put in a few days ago which fixed this issue. Only the binary sensor py file is modified
Hey Guys,
sorry if this has been addressed, but I can’t seem to find the answer. I’ve set up the gateway and everything seems to be detected, but when I go to customize it to add friendly names I get an error mentioning that
[customize] is an invalid option for [xiaomi]
This is the code that I have in my configuration:
xiaomi:
key: xxxxxxxxxxxxxxxx
customize:
binary_sensor.switch_xxxxxxxxxxxxxx:
friendly_name: Bedroom Switch
If I start HA without the customize options, everything works.
yeah. made no difference. it was pretty strange.
I also have an issue where out of no where, some of the sensors becomes ‘stuck’ in the on state until they are triggered again. After triggering, they become normal again. It’s also strange that a bunch of them decided to activate around the same time. Most of them are motion sensors but 1 door sensor also triggered. The xiaomi app works fine and do NOT show these triggers
doesn’t seem to have anything that strange in my logs. 2 line where 2 of the sensor went of:f
17-01-10 16:07:16 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=<state binary_sensor.motion_sensor_158d00010aacbb=off; battery_level=-1, friendly_name=Bottom Gate @ 2017-01-08T22:34:47.146932+11:00>, entity_id=binary_sensor.motion_sensor_158d00010aacbb, new_state=<state binary_sensor.motion_sensor_158d00010aacbb=on; battery_level=-1, friendly_name=Bottom Gate @ 2017-01-10T16:07:16.162761+11:00>>
7-01-10 16:13:06 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=<state binary_sensor.door_window_sensor_158d00011c97ab=off; battery_level=-1, friendly_name=D Balcony @ 2017-01-08T22:34:47.137930+11:00>, entity_id=binary_sensor.door_window_sensor_158d00011c97ab, new_state=<state binary_sensor.door_window_sensor_158d00011c97ab=on; battery_level=-1, friendly_name=D Balcony @ 2017-01-10T16:13:06.486624+11:00>>
The only real errors in my logs are where sometimes, my tomato router device_tracker doesn’t find the router.
Xiaomi app works by polling updates from the hub. HA integration does not poll and depends on information push by the hub. In your case, the information push by the hub could be lost because of network traffic or maybe it couldn’t handle a surge of events at once.
What i can do is enable polling so HA gets updated data from the hub periodically. I’m not sure what’s the interval
But that means you’ll get more traffic on your network
shouldn’t be too much network traffic should it? maybe make it customizable?
For HA to register a change of state, wouldn’t that mean the hub would have pushed that info to HA? Considering the sensor was in the off state, then if the info pushed by the hub is lost, wouldn’t HA keep reporting it as off?
What if the sensor is in on state and the hub pushes the data to turn off the state is lost?
The sensor were all off at the time though, as verified by the xiaomi app. I definitely didn’t trigger them. its strange that HA got those on signals and all around the 15-30min time window too. i’ll keep an eye out. if it happens again, i’ll turn off the device_tracker incase it is causing some issues with the xiaomi stuff.
I see. So it just randomly turn on itself. That’s strange
Crap! Thanks rexii454. I did see your post, but was a bit confused by some of it and didn’t realise it had the solution.
New firmware for the gateway released. Anyone tried it already?
Yes. I’ve moved to new firmware. After update had to restart HASS and update hub key.
have you experienced any difference/change?
YEP! Cube now working and report state! =)))) Hurray! (@rave)
P.S. Model is fixed too:
{“cmd”:“read_ack”,“model”:“cube”,“sid”:“158d00011065e3”,“short_id”:39716,“data”:"{}"}
flip:
{“cmd”:“report”,“model”:“cube”,“sid”:“158d00011065e3”,“short_id”:39716,“data”:"{“status”:“alert”}"}
{“cmd”:“report”,“model”:“cube”,“sid”:“158d00011065e3”,“short_id”:39716,“data”:"{“status”:“flip90”}"}
Also plug (power socket) state was changed, now it is reporting “inuse” flag, but still NOT report power consumption(kw, every 10 minutes?):
{“cmd”:“heartbeat”,“model”:“plug”,“sid”:“158d00010dd98d”,“short_id”:49763,“data”:"{“status”:“off”,“inuse”:“0”}"}
Motion sensors now reporting ‘no motion’ time:
{“cmd”:“report”,“model”:“motion”,“sid”:“158d0000f6b2fa”,“short_id”:1281,“data”:"{“no_motion”:“300”}"}
No, everything works as on previous FW