[BETA] Get rid of Milight bridges with the NRF24L01+ on Raspberry Pi

Hi all,

in the past months I was working on a project that makes it possible to control Milight lamps with the Raspberry Pi and without any additional bridge device (of course, a radio module is required, but that is directly attached to the Pi).

Why this project?

  • Normally, a seperate bridge device is needed for controlling milight lamps
  • You have to buy and operate one milight bridge per 4 groups you want to control. E.g. if you want to control 10 groups, you need to buy and operate 3 milight bridges.
  • Milight bridges use UDP and WiFi which could lead to unstable connections

What can you achieve with this?

  • If you did not buy a milight bridge yet: Save money
  • Control your milight lamps directly with the Raspberry Pi and a ~3$ NRF24L01+ radio module
  • Setup / Control as many groups as you like (up to ~ 65.000) with just one NRF24L01+ radio module
  • Get rid of all milight bridges
  • Control all milight lamps via openHAB and/or the milightV6 app (e.g. milight V3 lamps are also controlled via the milightV6 app then)

Which hardware is needed?

  • A Raspberry Pi (all variants/versions except Pico should be supported, I tested it with 3B and 4B)
  • The Milight lamps you want to control
  • The radio module NRF24L01+ (there is also a version without the “+”, that should also work)
  • 7 Female-to-Female jumper wires to connect the NRF24L01+ to the Raspberry Pi’s GPIO. If you want to keep the NRF24L01+ in within the Pi’s case, they should be short (I’d recommend 5cm, but 10cm usually should work as well).

Other relevant infos about this project

  • Status of this project is BETA. I already use it in my production system and it runs stable, but some code cleanups have to be done and there are still some ugly workarounds, e.g. path for config file is currently hard-coded to /opt/settings.json). Also, the project currently generates a bit too much CPU load for what it does.
  • This project is a port of GitHub - sidoh/esp8266_milight_hub: Replacement for a Milight/LimitlessLED hub hosted on an ESP8266 for the Raspberry Pi. Source code and documentation could be found on my fork GitHub - pfink/esp8266_milight_hub at piworking. Beware that already a small subset of features by the original project is supported by the fork (currently only radio and UDPV6 server is tested). Long-term goal is to integrate my adjustments for the Raspberry Pi into the original project.

Setup / Get started

  1. Use the jumper wires to connect the NRF24L01+ to the Raspberry Pi according to the scheme below. Of course, the red (3V3) and black (GND) cable could be connected any 3V3 / GND pin on the Pi. Different than depicted below, I connected 3V3 and GND to pin 17 and 20 as pin 1 and 5 were already occupied by my Homematic radio module.


2. Follow the instructions at esp8266_milight_hub/pidocs.md at piworking · pfink/esp8266_milight_hub · GitHub.
3. Configure the emulated bridges as MilightV6 bridges in openHAB. All milight lamps have to be added as V6 milight lamps within the openHAB config, even if they’re actually V3 lamps.

2 Likes

Thanks for posting! I wonder if this should be moved to the Tutorials and Solutions category so it’s easier to find by browsing.

Sure, if you think it would be better to have it in that category, feel free to move :slight_smile: Thanks!

Just for information purposes, there is also a well established similar project and binding for use with ESP8266 that has virtually the same functionality:

As already written in my original post, this is not a “similar” project, but a port of exactly that project for the Raspberry Pi - 99,9% of the code base is unchanged, so you’ll take advantage of the maturity of the original project as well. Purpose here is not to replace the milight bridge by another bridge, but to completely eliminate the bridge. Also, as I wrote, long-term goal is to integrate the port into the original project so that it does support the Raspberry Pi as well - at least with a subset of the original features (anyhow, I think most of the these features are not really needed if you control the milight lamps with openHAB anyway).

But yes, if you don’t already operate a Raspberry Pi or you don’t care about how many bridge devices you have in your home, and you don’t have an issue being stuck to WiFi, using the ESP would be the better option.