Local Control for Yeelights using Home Assistant

Wolf Biter
3 min readJan 17, 2024

Bulb Model: MJDPL01YL

Step 1: Obtain Device Token To initiate local control, you'll first need to obtain the device token for your Yeelight bulbs. A handy tool for this purpose is the "Get_MiHome_devices_token" program, available on GitHub. Follow the instructions in the repository (https://github.com/Maxmudjon/Get_MiHome_devices_token) to retrieve the unique token associated with each Yeelight device.

Step 2: Step 2: Find IP Addresses Once you have the device tokens, use the Mi Home app to identify the IP addresses of your Yeelight bulbs. Open the Mi Home app, navigate to the devices section, and select the Yeelight device you want to control locally. In the device details, you’ll find the IP address associated with the bulb.

Bonus : Assign a static IP to the bulb to ensure that the configs later don’t break.

Step 3:
Title: Unlocking Local Control for Yeelights: A Step-by-Step Guide

Introduction: Yeelights, known for their smart and versatile lighting solutions, can be controlled locally, providing users with enhanced privacy and control. In this guide, we’ll walk through the process of enabling local control for Yeelights, allowing you to manage your lighting setup directly without relying on external servers.

Step 1: Obtain Device Token To initiate local control, you’ll first need to obtain the device token for your Yeelight bulbs. A handy tool for this purpose is the “Get_MiHome_devices_token” program, available on GitHub. Follow the instructions in the repository (https://github.com/Maxmudjon/Get_MiHome_devices_token) to retrieve the unique token associated with each Yeelight device.

Step 2: Find IP Addresses Once you have the device tokens, use the Mi Home app to identify the IP addresses of your Yeelight bulbs. Open the Mi Home app, navigate to the devices section, and select the Yeelight device you want to control locally. In the device details, you’ll find the IP address associated with the bulb.

Step 3: Install Python-miio To interact with Yeelight devices locally, you’ll need the Python-miio library. Install it using the following command

pip install python-miio

Step 4 :
Title: Unlocking Local Control for Yeelights: A Step-by-Step Guide

Introduction: Yeelights, known for their smart and versatile lighting solutions, can be controlled locally, providing users with enhanced privacy and control. In this guide, we’ll walk through the process of enabling local control for Yeelights, allowing you to manage your lighting setup directly without relying on external servers.

Step 1: Obtain Device Token To initiate local control, you’ll first need to obtain the device token for your Yeelight bulbs. A handy tool for this purpose is the “Get_MiHome_devices_token” program, available on GitHub. Follow the instructions in the repository (https://github.com/Maxmudjon/Get_MiHome_devices_token) to retrieve the unique token associated with each Yeelight device.

Step 2: Find IP Addresses Once you have the device tokens, use the Mi Home app to identify the IP addresses of your Yeelight bulbs. Open the Mi Home app, navigate to the devices section, and select the Yeelight device you want to control locally. In the device details, you’ll find the IP address associated with the bulb.

Step 3: Install Python-miio To interact with Yeelight devices locally, you’ll need the Python-miio library. Install it using the following command:

pip install python-miio

Step 4:

Enable Developer Mode Run the following command, replacing “192.168.x.x” with the IP address of your Yeelight bulb and “<token>” with the corresponding device token obtained earlier

miiocli yeelight --ip 192.168.x.x --token <token> set_developer_mode 1

Step 5:
Now that you’ve got the bulb prepped for local control, adding it to Home Assistant is fairly straight-forward, just go to devices, add integration, add Yeelight and then follow the instructions on screen, your bulb should be autodiscovered, but you can see the Static IPs if you set them, or if you haven’t set Static IPs, I would suggest assigning them at this stage.

The next post in the series will be about integrating this with alexa for local control with Home Assistant

--

--

Wolf Biter

Bonobo in therapy, still learning the ropes on life. Best described as unhealthy coping mechanism hiding in a trenchcoat.