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
- 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.