Xiaomi Mi IO Binding and Yeelight Color Bulb

You could try this command line tool for linux:

I might be mistaken, but I think that is not going to help you much,
The discovery in OH will discover the token as well (similar as this tool does). However, most devices don’t provide their tokens anymore. (they do provide it after a reset, but the token gets changed once you update the wifi settings, hence useless.)

Nowadays, one easy way to get the token is by using the hacked mihome app, which will have the token in the screen. Alternatively downgrade to old version and get the miio2.db from a backup to extract the token…

The easiest way to obtain tokens is to browse through log files of the Mi Home
app version 5.4.49 for Android. It seems that version was released with debug
messages turned on by mistake. An APK file with the old version can be easily
found using one of the popular web search engines. After downgrading use a file
browser to navigate to directory SmartHome/logs/plug_DeviceManager, then
open the most recent file and search for the token. When finished, use Google
Play to get the most recent version back.

I found this really easy way to extract tokens from Yeelight app, you need to be rooted.
Use root explorer and look for miot.xml, open the file with a text editor and in the device list you can find the tokens.

1 Like

Hi I’m facing this problem both of my yeelight bulb are rebooting time by time, at least every 4 hours, uninstalled the binding and the problem is gone… Any tip?
Thanks in advance

Pls update the binding to the latest (snapshot) version. This is an unfortunate bug in the 2.4 version. (some devices don’t like message ID 0 and reboot)

1 Like

Thank you again :muscle:

Is there a wiki where I can see what commands I can send the Yeelight devices? I’m having difficulty creating rules to bind to my wireless switches / motion sensors

Hi, for a while ive been using the MI IO binding with a yeelight color bulb. i get this strange behaviour where, while its on, it randomly after a while, sets itself to red and 100 brightness. i have no idea what is causing this. it happens maybe every hour or so. is this maybe the same issue MrCupola had before?

@maurits_irizarri_van could very well be the case.
You can run the debug log, to see if the change of brightness happens when the message id is reset.

what version you are running (as we did nt have a release for some time)? If you have an older version you may try a snapshot version of the binding

could you give me a pointer into how i run the debug log and how to see what version of the binding i am running?
im running openHAB 2.4.0-1

Check out the first post of Xiaomi Robot Vacuum Binding
It describes also debug log (log:set debug )

I have troubles extracting the token from the Yeelight app. I’ve tried:

  • extracting SQLight db from com.yeelight.cherry, but the device.db->device does not have token column
  • using miio npm lib - the token changes after the Yeelight app gets paired with the bulb, so no use

Do you have any alternative ways? I have successfully extracted the Roborock token out of Mi Home app, but this Yeelight token is a myster for me! I have yeelink.light.color1

https://community.openhab.org/t/xiaomi-robot-vacuum-binding/31317/1047

Thx, but Yeelight is connected through Yeelight app, not Mi Home. I’ve previously successfully used old Mi Home app o get the token for the Roborock.

Solution: the token of the yeelight App is stored in this file (root required):
com.yeelight.cherry/shared_prefs/miot.xml. You can just open this file with a editor or notepad, its not a database like miio2.db.

In BasicUI, the Colormode channel of the yeelight gives a warning:

[WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '2' of item LivingroomR_colorMode with format '%.0f': f != java.lang.String

its defined as a String, while it outputs numbers.

could this also be a reason for the errors im experiencing with resetting of colormode?

Hi, for a while ive been using the MI IO binding with a yeelight color bulb. i get this strange behaviour where, while its on, it randomly after a while, sets itself to red and 100 brightness. i have no idea what is causing this. it happens maybe every hour or so. is this maybe the same issue MrCupola had before?