hi, I just brought a Mi Spart Led Bulb and a Mi Smart Led Bulb Essential, started to dig in a little bit and found the a clear guide to set up the device, here the link during the process realize there is a simpler way of doing it.
Step 1 Use the last version of Mi Home and register your bulb. Dont worry if it need to update, feel free of doing it.
Step 2 If possible use a linux base system if you use Windows, you can install the linux Subsystem or even Conda works, any system that let you use pip and let you do wget, important this system has to be in the same network of the device you want to link.
Step 3 Install the miiocli library, for this follow the next steps:
For the most recent release can be installed using pip
:
pip install python-miio
Here is the link to the github of miiocli https://github.com/rytilahti/python-miio
Step 4 Using miiocli use the command cloud to get the data from your devices. you need to put your username and password to access the data.
miiocli cloud
Username: [email protected]
Password:
== name of the device (Device offline ) ==
Model: example.device.v1
Token: b1946ac92492d2347c6235b4d2611184
IP: 192.168.xx.xx (mac: ab:cd:ef:12:34:56)
DID: 123456789
Locale: cn
Step 5 Now with this data you can alter the device ussing the following command:
miiocli yeelight --ip IP_OF_DEVICE --token TOKEN_OF_DEVICE set_developer_mode 1
This last step should return something like:
Setting developer mode to True
ok
Step 6 Go into HA and add the device with yeelight you will need to add the IP to integrate de device.
Good luck hope this work with your light. the modes of my bulb are: XMBGDP01YLK and MJDPL01YL
Extra Step Suggested by @patzobil :
Set a STATIC IP in your router for the bulb, so it always keep the same IP, this is recommended also for the Home Assistant device.
If there is any problem or error let me know and i will update the tutorial