Homey Community Forum

Xiaomi Mi Home App for WiFi devices

mi-home

Control Xiaomi Wi-Fi devices

App Store Page: https://homey.app/a/com.xiaomi-miio

IMPORTANT

Support for Yeelights has been removed from the Xiaomi Mi Home app. When the Xiaomi Mi Home App was first developed communication with Yeelights followed the same protocol as the Xiaomi Mi/MiJia WiFi devices. This is a reversed engineered protocol and is not very user friendly and stable. At some point a better method to control the Yeelights became available and I implemented support for that. Now the Yeelights and the Xiaomi devices have nothing in common anymore and I have decided to split off the Yeelights into their own Yeelight app.

This means the current Yeelight functionality within the Xiaomi Mi Home app will not be developed and supported anymore. I’m aware of the hassle it will be but you are asked to un-pair your Yeelights from the Xiaomi Mi Home app and re-pair them again in the new Yeelight app which is available in the app store.

It will not be possible anymore to pair Yeelights in the Xiaomi Mi Home app and the Homey app will actually tell you your device will not be supported anymore in the future.

Description

Use Homey to control Xiaomi Mi Home devices (the Mi Home Ecosystem is also branded as MiJia). Xiaomi does not officialy support controlling most of it’s devices from outside the Mi Home app. To add these devices to Homey require some additional steps are needed that require technical knowledge setting up. These steps are described here but Xiaomi can make changes to it’s eco system at any time resulting in Homey not being able to control these devices anymore.

Adding miIO devices

This app uses an unofficial library called the miIO Device Library for communication with miIO / MiJia devices which lack official support for controlling externally, credits go out to the author of this library. This Homey app only adds support for the devices that can be controlled directly through Wi-Fi (there is another app for directly controlling Xiaomi ZigBee sensors).

For Homey to be able to communicate with devices over the miIO protocol a unique device token needs to be obtained. Technical knowledge is needed for retrieving these tokens. If your are not to tech-savvy using this app might be challenging. See the instructions here on retrieving device tokens.

Using Target and Zone Cleanup for Xiaomi Mi Robot

Xiaomi has released an update for the vacuum cleaners that enables zone cleaning and goto function. Using the action cards that utilize these functions are a bit challenging. If you want to use these cards please read the instructions here.

Supported devices

Below is a list of supported devices and devices. Since the miIO library is no longer maintained the changes are small a new device will be added to this list. For devices not yet supported you need technical knowledge to discover the device properties yourself as described here. With these details it might be possible to add the device. Just post it in this support topic. Supported devices are:

  • Xiaomi Philips Light Bulbs
  • Philips Eyecare Light
  • Xiaomi Robot Vacuum Cleaner V1 and V2/S50, S6
  • Xiaomi Air Purifiers 2, 2S and Pro
  • Xiamomi Humidifier v1 & v2
  • Xiaomi Mi Fan (ZhiMi and Dmaker models)
  • Xiaomi Single Power Plug and Power Strip WiFi version
  • Xiaomi PM2.5 Air Monitor
  • Xiaomi Gateway Light & Alarm - subdevices are supported directly with the Xiaomi ZigBee app

Donations

I enjoy creating apps for Homey and try to support them as best as I can. If you enjoy using my apps a donation in return for the time I put into this is much appreciated.

3 Likes

Changelog

v2.13.3 - 2019-11-15

  • Added a mechanism to refresh the device connection to prevent devices from not responding on the first try.
  • Moved installation instructions from app store to community support topic.

v2.13.2 - 2019-11-10

  • Small fix for Yeelights not updating dim capability when in night mode
  • Small fix for Yeelights not updating onoff capability when turning them on by only changing the color

v2.13.1 - 2019-10-14

  • Small changes for Homey Energy Manager (firmware > 3.x)

v2.13.0 - 2019-10-06

  • NEW: add support for Xiaomi Mi Fan (ZhiMi and Dmaker models)

v2.12.2 - 2019-08-14

  • FIX: possible fixes on ocassional crashes related to network connectivity of Miio device and Yeelights
  • FIX: better checks for setting capabilities on Yeelights (make sure a Yeelights has that capability)

v2.12.1 - 2019-07-24

NEW: add support for new model Airpurifier 2H

v2.12.0 - 2019-07-14

  • NEW: re-added support for the Philips Eyecare lamp
  • FIX: added night mode to Yeelight Meteorite (use the custom color and brightness card to change the ambilight)

v2.11.11 - 2019-06-21

  • FIX: fix for support for Yeelight Meteorite

v2.11.10 - 2019-06-07

  • NEW: add support for the Xiaomi Robot Vacuum Cleaner S6

v2.11.9 - 2019-05-21

Fix action card for setting LED display brightness of Air Purifier and Humidifier2

v2.11.8 - 2019-05-10

  • NEW: add action card for setting LED display brightness of Air Purifier and Humidifier2
  • IMPROVEMENT: deprecated duplicate on / off action cards for Air Purifier and Humidifier 1 & 2

v2.11.7 - 2019-05-05

  • FIX: possible fix for app crashes related to connection problems with Yeelights
  • FIX: possible fix for app crashes related to connection problems with miio devices
  • FIX: fix for app crash when user not defines vacuum cleaner coordinates for zone cleaning correctly

2.11.6 - 2019-04-16

  • FIX: update night mode capability when ceiling light is controlled by external source

v2.11.5 - 2019-04-14

  • NEW: support for Yeelight Meteorite Pendant Light (YLDL01YL)
  • NEW: condition card for night mode for Yeelights that support this feature

v2.11.4 - 2019-03-03

  • FIX: fixed a bug in the pairing of Yeelights which was introduced in the previous release

v2.11.3 - 2019-02-28

  • FIX: fixed a bug in the pairing of Yeelights which was introduced in the previous release
  • NEW: added functionality for automatically updating a Yeelight IP address when a change has been detected (when using DHCP instead of statip IP for instance)

v2.11.2 - 2019-02-25

  • NEW: settings Yeelights to 0% dim will turn them off, also within the change dim over time card (except for the JIAOYUE ceilight which will toggle night mode when set to 0% twice in 5 seconds)
  • IMPROVEMENT: changed callbacks to promises for Yeelight driver
  • IMPROVEMENT: moved Yeelight settings from data to settings object to prevent issues when re-pairing without restarting the app

v2.11.1 - 2019-02-11

FIX: solve app crash related to philips light bulbs

v2.11.0 - 2019-02-07

  • FIX: improvements to pairing templates for firmware 2.x
  • FIX: code refactoring in drivers (replace callbacks with promises)

v2.10.0 - 2019-01-30

  • NEW: add waterlevel capability to Xiaomi Humidifier V2 including trigger card
  • FIX: fix setting speed for favorite mode on Air Purifiers

v2.9.5 - 2019-01-22

FIX: some more error handling to avoid app crashes

v2.9.4 - 2019-01-16

FIX: better error handling to avoid app crashes

v2.9.3 - 2018-11-28

  • FIX: fix for Xiaomi Philips Zhirui Downlights

v2.9.2 - 2018-11-28

  • NEW: added support for Xiaomi Philips Zhirui Candle Lights (PR from rdvanbuuren)

v2.9.1 - 2018-11-17

  • NEW: added meter_power capability for Mi Power Strip (PR by fantomnotabene)
  • UPDATE: support for the latest model AirPurifier 2S
  • POSSIBLE FIX: possible fix for Yeelight discovery on different subnets
  • FIX: code refactoring (PR by fantomnotabene)

v2.9.0 - 2018-10-06

  • NEW: add homealarm state capability for Xiaomi Gateway (state does not get synced when changing it through the Mi Home app yet)
  • FIX: keep custom capability night_mode for specific Yeelights in sync when changed through Yeelight / Mi Home app

v2.8.3 - 2018-09-09

  • FIX: fixed a bug with powered on|off condition cards for the air purifier and humidifier
  • FIX: better error handling when miio device can not connect

v2.8.2 - 2018-09-05

  • FIX: fixed bug with return to dock action card for Vacuum Cleaner
  • FIX: fixed where the Vacuum Cleaner always shows as charging even thought the battery is full
  • IMPROVEMENT: better error catching in polling mechanism for miio devices
  • UPDATE: removed support for Philips Eyecare since there is a bug in the miio library for this device (see https://github.com/aholstenson/miio/issues/145)

v2.8.1 - 2018-08-22

UPDATE: updated app manifest to include id of new forum support topic

v2.8.0 - 2018-07-24

  • NEW: support for Yeelight White Tunable (V2) and Yeelight Color V2
  • NEW: add action card for Xiaomi Mi Robot to send the robot to a specific target (see instructions)
  • NEW: add action card for Xiaomi Mi Robot to do a zone(s) cleanup (see instructions)
  • FIX: fix temperature range for Yeelight color bulbs

Thanks for the heads up of the new forum - might have missed it if not for your post @Phuturist!

Concerning Roborock S50 (version 2)

I have an issue where homey looses contact to the vacuum. Each time you’ve published an update, the vacuum has started to report status changes etc again for a few days, then it suddenly stops and I cannot neither retrieve status changes nor control it. I will from now on try to restart homey / xiaomi mi home app to see if it solves the problem or not.

Is this an issue others are familiar with?

Well, there is an issiue with the miio library that causes time outs when sending commands. This might be related. When you think it has lost connection, have you tried sending the same command like 8 - 10 times in a row to see if one of them eventually gets through.

The issue is registered here: https://github.com/jghaanstra/com.xiaomi-miio/issues/27

Hi,
Since I’m in love with my Yeelights I bought an Homey to connect them.
Unfortunately the Ceiling light is not working properly. It’s missing some fine tuning.
When I try to set Night mode in a flow the lowest setting is way higher then the lowest setting in the Yeelight app. For example in the Yeelight app the light can be set like real moonlight, bright enough not to bounce your head on a door and dark enough to fall asleep easily.
My light is the Yeelight LED Ceiling Light, modell number YLXD01YL.
I would be grateful if you could help me/us with this issue.

Hello Geurti, I have looked at the code but did not find anything that could cause this. I did not write the code for the night mode myself though. I’ll ask the author of the code if he is able to explain this and will let you know.

1 Like

Hi!

Thanks for awesome work with the app! I have a problem sending the ”go to dock” command from homey to my Roborock.

The roborock either doesn’t react or just stops mid-room without a word. Is this a known problem?

There is an issue with the miio library which causes send commands to time out. See https://github.com/jghaanstra/com.xiaomi-miio/issues/27.

The vacuum cleaner not returning to the dock when requested but stopping instead is not a know problem. Which version of the vacuum cleaner are you using?

S50 (the white roborock)

I can get the ”on” command to work even if I have to send it more then once. But dock just won’t work.

To avoid disappointment when buying a desk light, in the App description is written that the Eyecare Lamp 2 is supported, but untested. I own one and it is not supported by the App.

Thanx, I need to update that. It’s related to a bug in the miio library which has been reported here: https://github.com/aholstenson/miio/issues/145

Hopefully that bug will get squashed!

Before ordering a non supported light, could someone please tell me which Yeelight Ceiling light is supported. There seem to be a lot of different versions.

Thanks!

They are all suported. Yeelights have an open API, I have written support for this myself and dont depend on a 3rd library like miio.

Thanks for the conformation Jelger!

Hello!

Can someone tell me wich version(s) of the xiaomi gateways are supported, and what I can do with it using this app? There are 3 versions of it currently…

Probably all gateways are supported but only the led ring. From the app description:

  • Xiaomi Gateway Light - alarm not supported yet and subdevices are supported directly with the Xiaomi ZigBee app (tested)

Aaaah now I get it. Its only the light that is working… Thanks!

Hallo,

Nu vraagt de Homey voor het koppelen het ip adres een token en een polling.
Ip adres check
Token die weet ik niet.
Polling die weet ik ook niet.

Wie kan mij helpen? Heb wel wat gelezen over de token. Maar wordt daar niet echt wijzer van. Graag in jip en Janneke taal.

Alvast bedankt

1 Like