WS2812 LEDs Controlled by ESP8266 Controlled by Hubitat

So... my family goes a little crazy with holiday decorations. For the 2021 Christmas I was told I need to make some folding wooden "Christmas Trees" to add to the "tree farm" we already have as part of the decorations. The frame is simple and nothing too special.

But the lights on them... Those I wanted to be a bit more interesting. So I turned to WS2812 pixel strings. Right now the plan is 50-100 pixels per tree depending on the size of the tree. I wrote a simple Arduino sketch to control them using an ESP32, couple sets of colors and movement patterns to pick from. But then I realized I could do more...

So now I have a couple color sets to choose from (all single color, 4 colors, rainbow, etc...) and motions (all colors shift one way, whole sections change color, etc...) all built in. But I also made it have a simple webserver that not only provide the entire status of everything (in html and JSON) but it can respond to commands sent to it. So that allows it to have every single LED set whichever color, control overall brightness, select which motion, select one of the pre-set color sets, etc... I also switched it to an ESP8266 so it would be cheaper and smaller. Plus added OTA and web-update capabilities so I can change the ESP's programming easily.

To top that off I made a driver for Hubitat that can read/send all those commands to control it. The only problem one so far from my Hubitat driver is setting individual LED colors, because it requires 4 parameters (LED, R, G, and B). But everything else is working well. I even figured out how to make it set the whole set of pixels to be a specific color temperature or such.

All this will be posted on my website (and the Hubitat driver posted as a project here) in the near future once I clean them up some more. If anyone has any general ideas for features that would also be handy.

2 Likes

It would be neat if you could set different on and off animations. For example: If you have a vertical strip of leds, they could turn on like a lightsaber( Fill from bottom to top). And turn off inversely.

1 Like

if you haven't seen it already, i'd highly recommend checking out WLED. it is great

1 Like

I've got a few ESP8266 and ESP32 running WLED around the house now and they are awesome! Nice to be able to use the WLED app to have a great interface to control the LEDs with but also have them integrated into Hubitat for automating.

1 Like

interested

Wled seems to be the de-facto here, so I'm not sure if you've seen it? It's hard to miss =p

Unfortunately the hubitat control side of things is a little basic.

@blink made a driver here (Aircoookie WLED integration to HE - Developers - Hubitat) but ithat thread has been a little lonely for a while.

=)

@Obi2000: The bottom to top (or side to side) is a good idea, I did not have that. Inversion (as just a command) is neat also, have to think how that would work best.

For the rest, I am so far into mine at this point I would feel bad dumping the effort and switching to another. Should have done a search first. Oh well.

I get that. Waiting with interest to see the output of this - it's an area of my setup which has never quite been finished.

:clap: :clap:

Have two of them running now (on either side of my room). 50 pixels each running rainbow colors. Even set them to different motion events closely enough that it looks like one color leaves one string and appears at the end of the other to continue down...

Still a bunch of work to go. One thing I really need to get going is an asynch webserver. The 1 client at a time is causing a bit of a problem (they stop paying attention to the Hubitat if something else "talks" to them).

Separated color and motion completely now, which has plusses and minuses. But I think it will be better in the long run to be able to set whichever color and then have whatever motion effect "move" those colors around rather than combine them.

Here is a partial feature list (in addition to what I have already mentioned):

Color sets currently consist of:
0 = Blank
1 = Rainbow, 7 colors, 1 pixel each, repeating
2 = Rainbow, 7 pixels each color, repeating
3 = 5 colors (ROGBI) "Red Orange Green Blue Indigo", 1 pixel each color, repeating
4 = 5 colors (ROGBI), 5 pixels each color, repeating
5 = 3 colors (RGB), 1 pixel each color, repeating
6 = 3 colors (RGB), 5 pixels each color, repeating
7 = Random colors

Motion (Effects) consist of: (yes, there is a gap because those were combined ones I removed and have not replaced yet)
0 = No motion effect
1 = "Grow" from pixel 0's color up and down
5 = Swap PixelNum's (current "active" pixel) color with a random pixel
6 = Every color "moves" up one pixel
7 = Every color "moves" down one pixel
8 = Clock effect (only useful if there are 60 pixels, used for a 60 pixel ring I have)

Brightness:
There is now a "master brightness" that affects everything as well as color (RGB) brightnesses. I have found some strings in the past need a bit of tweaking on a color to more evenly match so I implemented that just in case. Of course you can also tell individual LEDs to be a "dimmer" color without affecting the overall brightness.

Hardware:
In case anyone is interested, I am using (as already mentioned) ESP8266 ESP-01s plugged into ESPixel Pop boards (1 Pop & 1 Tiny Pop at this time, although I am going to make a bunch more Tiny Pops).

2 Likes