Because I would like to have 1 intermediate level of abstraction between propietary-protocol home devices and home hub software (I can change home ‘hub’ to any other supporting MQTT) I have choosed to integrate Aqara to MQTT server and then integrate MQTT in home assistant.
So, here is mine integration to mqtt, thx to rave’s code
Turning off the motion sensor after one minute (and some extra seconds for margin) is a good idea. Still, pooling would make the whole system more reliable. Even if it only pools the gateway once per minute, it would make sure the sensors have the correct state. Since it only sends broadcasts, I’m pretty sure some messages will get lost for some people.
If the sensor is correctly updating, thee is probably something wrong with your automation.
I would suggest that open a new thread, and post your automation.
did your code change significantly from 1 week ago? Will it be included in the next release?
I still have problems with your component. I like since I bought so many xiaomi product, but for me is still not working well (it works, then it crashes HA, restart is not working, restart it works again … and so on)
That’s interesting. I set this up a week or so ago; currently with 1 PIR, 2 temp/humidity sensors, 2 buttons, 1 door/window sensor, 1 plug, and 1 gateway. It’s been rock solid since, and everything is updating and working as expected. I’m looking forward to multiple gateway support (as I have 2 on hand) to help extend my Xiaomi network, since I plan to buy PIR’s for every room and probably another 2 plugs for network extending as well. Maybe more door/window sensors. This has been a solid and cheap way to extend Home Assistant, but this code is still beta. It will only get better with time.
I have
1 door sensor (3 more arriving)
2 button arriving
2 PIR
1 flower light sensor (I think is not good though)
1 gateway
The Mihome app is good, I actually like it, miss the integration with HA (Xiaomi, Aleva, Hue and Broalink, Sonoff, all together). And I think I stop with this 4 brands, nothing more, too much trouble already
I’m in the US. Using an adapter plug. I have a LED strip on the Xiaomi plug, mainly because it’s a low-powered light that would put this plug (which acts as a repeater) in the middle of my house.
Since the message used for the “off” state was wrong, how could the sensor go back to off sometimes? I mean, my cat has been walking in front of the sensor all day, and it has been on and off, despite getting stuck on “on” for long times. Does the gateway send an update for all sensors from time to time, with {‘status’: ‘no_motion’} ?