How to Integrate Yeelight with Home Assistant for Local Control
Yeelight makes some of the most affordable color-tunable bulbs on the market - the YLDP13YL Color bulb retails around $15 - but the Yeelight cloud service has had reliability issues, and Xiaomi's app ecosystem is scattered. Running Yeelight through Home Assistant solves both problems. You get local control, instant response times, and full automation flexibility.
What You Need Before You Start
Before touching Home Assistant, you need a few things in order. First, your Yeelight devices must be on firmware that supports LAN control. Most bulbs manufactured after 2019 do. Second, your Home Assistant instance should be running version 2024.1 or later - the built-in Yeelight integration improved significantly that release.
Third, and this surprises a lot of people: you need to enable LAN control in the Yeelight app before Home Assistant can discover the devices. That step is easy to miss.
Enabling LAN Control in the Yeelight App
Open the Yeelight app and tap on your device. Go to the device settings (the three-dot menu, top right). Scroll down until you see "LAN Control" and toggle it on. Repeat for every Yeelight device you want to control locally.
Once LAN control is on, the device starts broadcasting itself on your network. Home Assistant can then discover it automatically or via manual IP entry.
Does the Built-in Integration Work Without HACS?
Yes - Home Assistant ships with a native Yeelight integration since version 2021.4. You don't need HACS for basic color, brightness, and on/off control. Go to Settings > Devices & Services > Add Integration and search for "Yeelight." If LAN control is enabled on your bulbs, Home Assistant discovers them automatically within a minute or two.
The native integration handles color temperature, RGB color, brightness, and smooth transitions. For most users, this is everything they need.
HACS adds value only if you want extra features like music mode, custom effects, or the newer custom component maintained by the community. I've found the native integration stable enough for daily use.
How to Install via HACS (Optional)
If you want the HACS version for extra capabilities, here's how to install it.
First, install HACS itself if you haven't already. Navigate to hacs.xyz and follow the installation instructions for your Home Assistant setup. The process takes about five minutes and requires SSH or the Terminal add-on.
Once HACS is installed, open it from the Home Assistant sidebar. Click the three-dot menu and select "Custom Repositories." Add https://github.com/rytilahti/python-miio if you want broader Xiaomi device support, or search HACS for "Yeelight" to find community integrations.
After adding the repository, restart Home Assistant. Then go to Settings > Devices & Services and add the Yeelight integration again - this time it will use the HACS version.
Assigning Static IPs to Your Yeelight Devices
This step saves you a lot of frustration. Yeelight devices can change IP addresses when your router reassigns DHCP leases. When that happens, Home Assistant loses the connection and your automations break.
Fix this by assigning static IPs in your router's DHCP reservation settings. Find the MAC address for each Yeelight device (it's visible in the Yeelight app under device info), then reserve a permanent IP for it in your router admin panel. A range like 192.168.1.150-199 works well for smart home devices.
After reserving IPs, update your Home Assistant Yeelight integration entries to use the static IP addresses. Go to Settings > Devices & Services > Yeelight and click Configure on each device.
Local Control vs Cloud: What's the Real Difference?
Local control means your Home Assistant server talks directly to the bulb over your home network. No internet required. Response time drops from 200-800ms (cloud) to 20-50ms (local). Automations work during internet outages.
Cloud control routes every command through Yeelight's servers in China. That adds latency and means if Yeelight's service is down - which happened several times in 2023 - your lights stop responding to automations.
For bedroom wake-up lights or kitchen automation triggers, that 150ms difference in response time is actually noticeable. Local control feels instant. Cloud control feels sluggish on a busy network.
Setting Up Automations with Yeelight in Home Assistant
Once your bulbs appear in Home Assistant, creating automations is straightforward. Here are three that work well with Yeelight hardware.
Sunrise simulation: Use a time trigger set to 30 minutes before sunrise (Home Assistant calculates this automatically from your location). Start the bulb at 1% brightness and 2700K warm white, then use a helper to gradually increase brightness to 80% over 20 minutes. The Yeelight YLDP13YL handles color temperature transitions smoothly.
Motion-triggered hallway light: Pair a motion sensor (a Zigbee one works well) with a Yeelight bulb in the hallway. Set brightness to 30% after 10pm so it's not blinding at night. Add a 3-minute timeout to turn off automatically.
TV ambiance mode: When your media player entity changes to "playing," set the living room Yeelight to a dim warm color. When it pauses or stops, return to normal brightness. This works with any media player integrated into Home Assistant.
Troubleshooting Common Yeelight Issues
The most common problem is devices showing as "unavailable" in Home Assistant. Nine times out of ten, the cause is either a missing static IP assignment or LAN control getting reset after a firmware update. Check both before assuming something is broken.
If discovery doesn't work at all, make sure your Home Assistant server and your Yeelight devices are on the same network subnet. A mesh router that puts IoT devices on a separate VLAN will block discovery unless you enable mDNS or add explicit IP addresses.
Firmware updates in the Yeelight app can sometimes disable LAN control. After any Yeelight app update, verify that LAN control is still toggled on for each device.