Using a Milight remote with HomeAssistant

Milight sells 2.4 GHz remotes* for quite cheap (~$12) which can be used to control Milight bulbs*. They also make in-wall panels* that do the same thing. These work quite well, but if you’re using something like HASS, you’ll end up with stale state. For example, if you turn lights on with the remote, that change won’t be reflected in HASS.

I recently released v1.4.0 of esp8266_milight_hub which allows you to use Milight remotes in conjunction with HomeAssistant, or any other platform that works with MQTT. Here’s some footage of it in action:

The ESP8266 is passively listening for packets sent by the remote, and forwards the data to an MQTT topic. HASS reacts by sending commands to a different MQTT topic which instructs the ESP8266 to turn bulbs on. You could just as easily have HASS do something completely different, like control a non-Milight bulb.

If you’re interested in setting this up yourself, instructions are available GitHub project wiki.

* Contains Amazon affiliate link

Join the Conversation


Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. hey, Very nice job ! congratulations I just created the MilightHub which works perfectly. The only problem, when I unplug the gateway and reconnect it, all configuration is lost… I couldn’t find how to save it on the server interface. This is a problem because in the event of an untimely power cut, everything is lost. Can you tell me if there is a possibility to find the configuration when the voltage returns or this function does not exist. Thank you very much for your answer. Chris92

    1. Hi there,

      configurations should definitely be saved across reboots. they’re saved to the ESP8266’s flash memory.

      My best guess is that the firmware image you used doesn’t match your ESP8266’s flash configuration. the “d1_mini” image works for 90% of boards and is the one i’d recommend trying if you’re otherwise not sure.

  2. Hi,

    I don’t have any Milight lights and I’m not planning to get any. However I’ve been looking for a good RGB CCT remote and I can’t find anything as good as the Milight remote. I see that with your software it’s possible to use a Milight remote to control Home Assistant lights via MQTT. I’m not a big fan of MQTT myself, preferring to it native HA integrations. Milight has a native HA integration, but it works as “assumed state” because of the limitations of the protocol.

    My question is, is it possible with your software to use the Milight remote to control Home Assistant lights with the native integration (no MQTT)? As in, will I be able to press the on button the remote, have HA receive that information, turn on a HA integrated light by using the Milight integration (or another HA native one – no MQTT)?

    Thank you.

    1. Hi, there is no native integration with MQTT. The supported way to integrate with HA is MQTT.

  3. Hi Chris,

    This looks very intriguing to me. I am in the process of picking out a 5m LED strip, to go under our kitchen cabinets, and I am in the need of a RGBWW strip. I like what you have going here, as the MiLight stuff is readily available on Amazon (I will use your links if I choose to purchase) compared to the Arilux controllers that need to be ordered from China.

    I just had a couple of questions:

    From what I understand, they work on a propietary 2.4Ghz signal, instead of using WiFi, and your firmware is a replacement gateway using an ESP8266? So, I won’t need the gateway if I go this route, right?
    How reliable is using the 2.4Ghz frequencies, compared to using WiFi alone? I know that the WiFi is also 2.4Ghz, so I assume it’s no different. For example, the Arilux use a straight WiFi connection, would this be more ideal? This may not be an issue, but figured I’d ask.
    On that same note, how far will the signal carry? Just like WiFi where it will cover all three floor of my house?
    Will your firmware work with the Mi Light Series 2.4G 4-zone LED RGBW RF Wireless Controller Color Changing and Brightness Dimming For RGBWW Strip Lights (direct Amazon description)? If it does, please feel free to post an affiliate link for me for helping me out and I will use it.

    Thanks for your time and all your hard work in the open source community:)

    1. It should work with that controller.

      If you’re pretty sure you’ll only ever want one LED controller, it’s probably best to get one that connects to WiFi directly.

      I think there are quite a few OTS solutions that work pretty well. I’ve had one of these things (affiliate link) for several years, and I’m pretty happy with it. Integrates nicely with HomeAssistant. I think there are cheaper controllers that use the same protocol, don’t know where to find them offhand.

      On the DIY front for WiFi LED controllers, there’s BRUH’s ESP8266 project.

      If you expect to have lots of controllers, you might be better off with a single WiFi device that communicates with the LED controllers on your behalf (this really a matter of preference, and probably depends on how much spare capacity your WiFi setup has). If you want to go that route, this Milight controller (affiliate link) will work with espMH.