Integrate MI Smart LED Bulb (Warm White) XMBGDP01YLK

Tags: #<Tag:0x00007fc40b6f55f0>

Hi there,

Since I didn’t see any guide which outlined every single step I needed to take in order to get these bulbs in HA, I thought I’d compile them here:

  1. Obtain and install old MI Home app via .apk on Android or Bluestacks (I always use version 5.4.54)
  2. Login with Xiaomi account
  3. Reset bulb by turning on/off 5 times
  4. Give Location permission to MI Home app
  5. Scan for new devices in app
  6. Connect to bulb & add it to the WiFi network
  7. Ignore the fact that it ends with “Connection error, check network and retry” and click on Back button, Stop adding device, OK
  8. Go back from Add Device
  9. Pull down to refresh main device screen, you will see the bulb added and marked New
  10. If you don’t have an on/off button on the device’s image, just long-press to rename the device (which you should anyway), save the new name, exit the MI Home app and enter it again after a few seconds, the switch button should appear
  11. Use a proper Android file manager like Total Commander to go to /storage/emulated/0/SmartHome/logs/plug_DeviceManager & send the file there named TODAY’SDATE.txt to somewhere more easily searchable/editable like a PC via e-mail
  12. Open the file and search for the bulb’s name that you created in Step 10 - the token is in the text right behind it, like: “token”:“YOURTOKENID”,“longitude”:“0.00000000”,“latitude”:“0.00000000”,“name”:“Master Bedroom Window Light”
  13. Reserve the bulb’s DHCP IP in your router UI so that it will always receive the same IP
  14. Download and install the latest Python release for Windows from Python Releases for Windows | Python.org
  15. Download and install “Build Tools for Visual Studio 2019” from Download Visual Studio 2019 for Windows & Mac
  16. You will need to restart the PC after you install the Build Tools
  17. Open Command Prompt and run “pip3 install python-miio”
  18. Run in Command Prompt "miiocli yeelight --ip YOURBULBIP --token YOURBULBTOKEN set_developer_mode 1
  19. Make sure the output finishes with “Setting developer mode to True - [‘ok’]”
  20. Add Yeelight integration to HA & put your bulb’s IP address in there
  21. Enjoy!

P.S. As mentioned in the alert at Alerts – Home Assistant, Xiaomi seems to be step by step locking down their ecosystem, so it would probably be wise after going thru these steps to also go to your router and block the bulb’s IP from the Internet. While this will make it go offline in the MI app, in HA it should work fine forever without the fear of a firmware upgrade that will make it operable from the MI app only.

1 Like

Bless your heart kind sir! My very first integration in HA with the MI bulbs and couldn’t have done it without your guide. Thank you!!!

1 Like

Glad you found it useful :slight_smile:

To be honest, I had no idea what I was getting myself into when I bought these bulbs, as my 2 (theoretically similar) Yeelight lamps just needed a couple of clicks in the Yeelight app in order to enable Developer Mode.

I’ll amend the guide to also mention blocking the bulbs from the Internet, as the problem mentioned here might pop up: Alerts – Home Assistant

Hello John,

Thank you for the tutorial. Very detailed.

I am having some trouble with the step 18. When I run the command it returns the following message:

miiocli : The term ‘miiocli’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • miiocli yeelight --ip 192.168.1.61 --token 29xxxxxxxxxxxxxff175bcd …
  •   + CategoryInfo          : ObjectNotFound: (miiocli:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException 
    
    

Doy you have any clue of what is going wrong?

Thank you!

Daniel

Hmm, it looks like step 17 didn’t work for you, can you try it again and let us know what the output was? Maybe that’s why it can’t find the command.

This thread helped me a lot - just a note: to get the xiaomi token, I’ve found this very usefull: GitHub - Maxmudjon/Get_MiHome_devices_token: Get Mi Home devices token Windows/MacOS app.