Make your own gradient lightstrip with diyHue

You can create your own hue gradient lightstrip using some components like a board, lightstrip, and a power adapter. The lightstrip supports 7 zones, just like the official Philips Hue Play Gradient Lightstrip. This is to simulate the Philips Hue original. Creating the lightstrip requires soldering and some really advanced steps to flash the board. It is meant for the advanced user who is into a challenge.

What do I need?

Furthermore, you will need Hue Essentials as the app to run Sync on your Android TV or other devices.

Build the lightstrip

  1. Connect the red/white/green wires of the lightstrip to the board. Connect red to 5V or VIN, white to GND or G, green to RX. You will need to solder the wires to the board. You may use the included pins so you can easily connect and disconnect the board.
  2. Connect the other two red/white wires of the lightstrip to the 5V power adapter. Connect red (+) to red, white (-) to white.

This is what the result looks like:

Flash the board

  1. Install and open Arduino IDE on your PC or Mac

  2. Go to Preferences, add the following URL to Additional Boards Manager URLs, and tap OK:

    https://arduino.esp8266.com/stable/package_esp8266com_index.json
    

  3. Now go to Tools, and tap Manage libraries

  4. Install WiFiManager by tzapu,tablatronix (GitHub)

  5. Install ArduinoJson by Benolt Blanchon (GitHub)

  6. Install NeoPixelBus by Makuna (GitHub)

  7. Go to Tools, tap Board: …, and tap Boards Manager

  8. Install esp8266 by ESP8266 Community (GitHub)

  9. Download the Gradient_TV_Strip_WS2812.ino sketch from diyHue (open the link, on that page right click Raw, and click Save Link As).

  10. In the Arduino IDE, tap File, tap Open, and select the downloaded .ino file.

  11. Remove your board from power and the lightstrip. Then connect it to your PC or Mac using the USB port

  12. In the Arduino IDE, go to Tools and change the following settings:

    • Tap Board: …, tap ESP8266 Boards (…), and select your board. In our case it is the LOLIN(WEMOS) D1 R2 & mini

    • Set Erase Flash to All Flash Contents

    • Set Port to the port you connected your board (if you connected your board through usb, then select the port with usb in the name. If you are using Windows, open Device Manager, go to Ports, and check which COM port it is connected to)


      Device Manager

      If the port is greyed out in Arduino, the board is either not connected through the USB cable or its driver for the port is missing.


      Arduino IDE should install the drivers automatically, but in case that does not work, try the following:

      Workaround

      In order to install the driver, you need to point the location to a downloaded driver. Google for Hardware-ID mentioned in the details in Device Manager. Alternatively, use this driver, or Microsoft driver) or use the CH340 driver included with Arduino under C:\Program Files (x86)\Arduino\drivers.

  13. Go to Sketch, and tap Upload

  14. Wait until the flashing was successful

If you are using a Mac and get the following error:

pyserial or esptool directories not found next to this upload.py tool

Then follow this workaround:

Workaround
  1. Open the file ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py
  2. Replace line 29 and 30 with the following:
iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit')
cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
  1. Save the file, restart Arduino IDE, and try again.

See also comment #3 at PySerial and EspTools Directory Error - #4 by flszen - IDE 1.x - Arduino Forum

Configure the lightstrip

  1. Remove the controller from your PC or Mac and connect your lightstrip and power adapter to the controller. Only a small section of the lightstrip now emits colours.

  2. On your phone, connect to the WiFi network that is created by the controller. You should see a WiFi network called like: Hue Gradient Strip WS2812.

  3. Open a web browser on your phone, and go to 192.168.4.1

  4. On the web page, connect the controller to your WiFi network. Tap on ‘Configure WiFi’, tap on your network and enter the password of your WiFi. When you set your Wifi credentials, your phone will disconnect from the temporary WiFi address of the lightstrip.

  5. The controller and your phone should now both reconnect to your WiFi network

  6. Open a web browser, and go to the IP address of your controller. You can find its IP address in the list of connected devices on your router; your lightstrip will identify something like hue-Hue-Gradient-Strip-WS2812

  7. Go to Preferences and configure the Pixel count. This is the amount of LEDs (pixels) your lightstrip has. For example, when you use a lightstrip with 60 LEDs per meter, and the total length is 5 meters, then you have 60*5=300 pixels.


    In our example we entered 300 in the field Pixel count.

  8. Currently the firmware supports 7 zones to stay in line with the Philips Hue Gradient. Lights count should stay on value 7. Light division tells how many pixels (LEDs) there should be per zone. Our example lightstrip has 300 LEDs; This means 300/7=1 zone of 42 + 6 zones of 43 Pixels.


    Finally, tap Save at the bottom. Now all LEDs on your strip should switch on after its automatic reboot. (As a result both Dance Sensation and Sync in Hue Essentials will provide 7 different colour zones over the full lightstrip).

  9. You may also want to set a manual IP address. Go to Network Settings tab and move the slider for Manual IP assignment to Enable. For best results, you also need to assign the same IP address as a static IP in your router.

Install diyHue

diyHue is a simulated bridge. It is installed on a tiny PC like a Raspberry Pi which can stay powered. Hue Essentials connects to this bridge.
diyHue.org
Below is explained how to install diyHue. See the additional instructions in the following link: Getting Started — diyHue 1.0 documentation

diyHue installation via Docker (replace XX:XX:XX:XX:XX:XX in code below with MAC address of your ethernet controller; you may find this address in your router. You can find your MAC address of a Raspberry Pi by using the command ifconfig in a terminal, then look for eth0: in the output, the MAC address is listed behind ether.)
Enter the following commands in a terminal on your Raspberry Pi:

sudo apt update && sudo apt upgrade -y 
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
sudo docker run -d --name diyHue --restart=always --network=host -e MAC=XX:XX:XX:XX:XX:XX -v /mnt/hue-emulator/export:/opt/hue-emulator/export diyhue/core:latest

Once your installation of diyHue has completed, you need to open the app Hue Essentials and search for your new bridge. Only Hue Essentials is fully compatible with diyHue.

  1. Open Hue Essentials and go to the Devices tab
  2. Tap + to add a device
  3. Select Bridge
  4. Tap on the new diyHue bridge
  5. When it asks to Press the push-link on the bridge, then open the network address of your diyHue Hue emulator in a web-browser. Press the three lines icon and select Link device.
  6. When asked for a password, enter:
    Username: admin@diyhue.org
    Password: changeme

Please refer to Getting Started — diyHue 1.0 documentation for further support on diyHue

Now your diyHue bridge should get connected in Hue Essentials and you can control its devices through Hue Essentials on your phone.

Connect the lightstrip to diyHue

Now we will add the lightstrip to diyHue in order to make it seen in Hue Essentials.

  1. Open Hue Essentials and connect it to your diyHue emulator
  2. Go to the Devices tab, tap the + button, tap Light, and select your diyHue emulator
  3. Tap Search for lights in Hue Essentials
  4. Your gradient light strip should appear in Hue Essentials now. If it does not appear, try searching for lights multiple times. diyHue may report 0 lights found even though lights have been found.
  5. Now you can create an entertainment area under the Entertainment tab and start Sync.

How to create an Entertainment area in Hue Essentials

If you are confused how to create Entertainment Zones, this post on our community may be a good read.

  1. Go to Entertainment tab
  2. Select for example Dance Sensation
  3. Select Entertainment area
  4. Tap + to create a new Entertainment area
  5. Select your diyHue bridge
  6. Choose Philips Hue as diyHue emulates this gradient as if it were a Philips Hue Gradient
  7. Tap on Lights
  8. Select your Hue Gradient Strip
  9. Go back (<)
  10. On the Entertainment area screen, move your light to the physical location in your room (place your finger on the light and drag it to the desired position)
  11. Tap on the light multiple times until it reaches its correct height (ground height, TV height, ceiling height)
  12. Rename the contents of name field to your choice
  13. Tap Save
  14. Now you can use this Entertainment area for all your Entertainment in Hue Essentials, like Dance Sensation or Sync.

Amazon links

As an Amazon Associate I earn from qualifying purchases. The price remains the same for you!

2 Likes

Awesome post, I would like to play with it in the near future. Can I use these strips? And…does it also work with 60 led per meter? And…does it also work with panel strips?

This board will also work? I have this one already, somewhere…

€ 0,78 18%OFF | New Wireless module CH340 NodeMcu V3 Lua WIFI Internet of Things development board based ESP8266
https://a.aliexpress.com/_u7Nosl

The ESP8266 based boards should all work. We used a WS2812B 60 LEDs per meter on 5 meter in our first setup; so, yes Dennis, that works.

1 Like

Cool, thanks Robert!
Then I’ll know what to buy (I guess).

Now I’ll try to find out if I should install a docker container, or just using the addon I’m home Assistant. That would be much nicer, then it will be integrated in my HA environment.

When using the Hassio add-on, make sure you select the flask branch. It should work if you are using the flask branch, but we have not tested it with this Addon yet. In the future the master branch should work when the code has been merged, but I do not know when that will be.

1 Like

Well, one more I was wondering about:
Could it work with WS2812B led panels also, like the picture I send earlier, or only the WS2812B led strip?

Now I need to do a speedcourse soldering and then I’m good to go :roll_eyes:

Yes, possible you may get seven zones but I have no idea how they end up on the led panel as I have not tested it. It may need adjustment in the configuration and in Hue Essentials in the future. The result will not be as good as a led strip at this time.

1 Like

Thank you Thomas.

Then I’ll leave it as it is and will go for the led strip solution. Very curious how that will work out, but as I said…never ever used solder, so I’ll need a speedcourse first :smiling_face:

Looking forward to this future diy project!

Hi, i’m a newbie into DIYHUE and I wonder if this gradient would work with hue entertainment pc app. Meaning it would replace Philips’s gradient led strip. Thank you for this great article!!

So I tried it, but my lightstrip is marked as unreachable, I can turn it of and off from the app, but there’s not much else I can do. I used SK6812 led strip, so that is most probably problem, will you try to support SK6812 also:?
Thank you for your work :slight_smile:

I have not tried the SK6812 LED strip, but if there is a correct firmware for that strip it should work, too. The firmware which is used for the WS2812B is the Gradient_Strip_WS2812 sketch.

Could you try deleting the LED strip from diyHue, and then pair it again? Maybe that fixes the unreachable issue.

Yes, that should work as this solution emulates a Hue bridge and a Hue Gradient lightstrip.

@Thomas
The ESP8266 board (Lolin D1 Mini) - Amazon.de is no longer available. Can you please post a compatible EPS8266 board from Amazon.de ? I’m not entirely sure what it needs exactly to work on this project.
Is this one ok? https://www.amazon.de/-/en/AZDelivery-NodeMCU-Lolin-V3-Parent/dp/B06Y1ZPNMS/ref=sr_1_4?dchild=1&keywords=ESP8266&qid=1618825554&sr=8-4

Thanks for letting me know, I added a link. All ESP8266 board should work, so the one you linked should work fine.

Make sure you select the correct board when flashing, so in your case the NodeMCU 1.0 (ESP-12E Module) board. The pins could also be named a bit differently, I updated the instructions for that. On this board you need to connect the 2 red/white wires to VIN and G.

AWESOME, thanks for the update.

The instructions have been updated with more details to help you through the steps.

What raspberry Pi models will work with this? Can a Pi Zero or Pi 3b+ be used?

We often use one of our Pi 3b’s without issues. I have no experience with older / zero models.

Thank you Robert that is much appreciated!

Hello!
In advance: Great tutorial!
I build the DIY gradient lightstrip and it all seemed to workout perfectly fine. I can see and control the strip via the essential app and add it to a new entertainment area. But from then on just the first sector lights up, when i turn on the sync feature…

At the moment I’m testing with a small setup off 32 LEDs in 7 sectors, so I set up the sectors with 5, 5, 4, 4, 4, 5, 5 LEDs, but just the first 5 LEDs are synced, the rest is off. If I add more LEDs to the first sector they also light up as expected.

Any ideas for this problem?
Thanks in advance!