core: Xiaomi Miio integration fails to discover sensors
The problem
Hi there, trying to use the integration "Xiaomi Miio ". The integration “Xiaomi Miio” automatically discovers my Gateway BUT there is NO support for any of my sensors (limited support in general). Sensors are not discovered at all, but are connected and working in the “Mi Home” App. Tried to re-add them while having the Gateway discovered on HA but no luck.
Can you please add support for more hardware/sensors? Of course if i can help, i would be more than happy to contribute to the solution. After an extensive search on forums ive found out that many many people have the same issue.
Sensors: Mi motion sensor (Model: lumi.sensor_motion.v2) Mi Door/Window Sensor (Model: lumi.sensor_magnet.v2) Mi Wireless button (Model: lumi.sensor_switch.v2) Gateway: lumi.gateway.v3-MW300 by Xiaomi Firmware: 1.4.1_176 (Latest)
@rytilahti @syssi @starkillerOG
Environment
- Home Assistant Core release with the issue: Home Assistant 0.113.3
- Last working Home Assistant Core release (if known): -
- Operating environment (OS/Container/Supervised/Core): VM (fresh install) with official QCOW2 image
- Integration causing this issue: Xiaomi Miio
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/xiaomi_miio
Problem-relevant configuration.yaml
No custom .yaml, all in UI
Traceback/Error logs
Additional information
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 30 (18 by maintainers)
@manosioa, yes there is a way to use the European version of the Xiaomi Gateway with the Miio integration, but it is still in active devolepment, you can read about it here: https://github.com/rytilahti/python-miio/issues/728#issuecomment-687189227 basically this branch will make the EU xiaomi gateway work: https://github.com/starkillerOG/python-miio/tree/EU_gateway, but the code for HomeAssistant is not written yet to supply the nessesary cloud credentials (to get the token to use local control).
The underlying python-miio code has been tested and confirmed to work with the European version of the Xiaomi Gateway
@starkillerOG May I ask if I can use the European version of the Xiaomi Gateway with the Miio integration?
Is there a way to get the token from that?
I wrote the Config Flow for the xiaomi_aqara integration, but I am not a code owner of xiaomi_aqara
@manosioa When I start config integration
I leave interface
anyand press SubmitOn this step ask me gateway key without IP and MAC
Try to cancel current integration setup, if it will available in integrations, remove it and reboot home assistant and try one more On the first step, leave interface as
anyand press Submit On the second step must appear window with ask gateway key.I have Mijia Gateway v2 and it works via
xiaomi_aqaraintegration, sorry for confusion.I plan look at code of xiaomi_miio integration and buy gateway v3 and help with tests.
Mostly the problem is that I do not own switches plugs etc, so it is hard to develop code for them because I cannot test with the hardware…
I will let you know if there is something to test.
@manosioa please have a look at the newly updated documentation: https://www.home-assistant.io/integrations/xiaomi_miio/#supported-subdevices
There you can see that currently only the gateway alarm feature and temperature/humidity/pressure sensors are supported.
The gateway part of xiaomi_miio is a brand new integration that is still in development. This PR will add light and illumination support for the gateway: https://github.com/home-assistant/core/pull/37959
This PR will make it possible to easilly add support for all switches/plugs/wall outlets and all light bulbs: https://github.com/rytilahti/python-miio/pull/782
Door/window sensors, motion sensors, wireless buttons/remotes will take some more effort to get implemented and are a bit further away since those devices do not allow you to get the status of the device directly from the gateway API. Those work on event basis so to get those working we need to implement a more complicated subscription like system in which those events are instantly pushed to HomeAssistant instead of polling for the state. Basically this PR needs to be finished in order for that to work: https://github.com/rytilahti/python-miio/pull/709 That PR is still in a crude state and still needs substantial work to make it ready for merging. @manosioa if you have python skills it would be greath if you could pick up that PR and see if you can improve it such that it can be merged (see all comments and discussions in that PR).