Help with LED lighting goal

Hey, everyone, I’m looking for some advice on where to start with a project. My goal is to put some led lights under the kitchen cabinet and have them basically always on but at a low level. I would like them to become brighter when motion is triggered in the room. I would like them to go off completely from 11 pm to 8 am, but still come on if triggered by motion in the room. I have an HA running supervised on a NUC, Aeotec zwave plus stick, Aeotec multisensor 6, WS2812b 5m 30leds, esp8266, I’ve made a logic shifter board but I’m pretty lost with which library to use and how to get going. I’ve tried to watch several tutorials but none of them are detailed enough for me to get what I need. Any advice would be appreciated. Thanks.

Look up adafruit neopixel.

Their Arduino library comes with lots of examples that work a NodeMCU. And thier site will have solid wiring / hook up diagrams too.

Get the LEDs running before you think about HA.

I’m new to this and I’m getting super frustrated. I’m trying to get just one LED to light up. Just one. From this example it should, if I understand correctly, light LED number 11. However, while 11 is the most constantly lit, it flickers and a bunch of lights up and down the string randomly strobe. Help. Please.

/*****************  NEEDED TO MAKE NODEMCU WORK ***************************/
#define FASTLED_INTERRUPT_RETRY_COUNT 0
#define FASTLED_ESP8266_RAW_PIN_ORDER
/******************  LIBRARY SECTION *************************************/
#include <FastLED.h>
/*****************  LED LAYOUT AND SETUP *********************************/
#define NUM_LEDS 100
/*****************  DECLARATIONS  ****************************************/
CRGB leds[NUM_LEDS];
/*****************  GLOBAL VARIABLES  ************************************/
const int ledPin = 4; //marked as D2 on the board
/*****************  SETUP FUNCTIONS  ****************************************/
void setup() 
{
  FastLED.addLeds<WS2812B, ledPin, GRB>(leds, NUM_LEDS);
}
/*****************  MAIN LOOP  ****************************************/
void loop() 
{
  leds[11] = CHSV (96, 255, 192);
  FastLED.show();
}

Honestly, getting these things to run is a real pain. They’re extremely touchy, it may not be the code at all.

Did you try it with Adafruit lib? If it doesn’t work with that one, you can rule out code part.

It may be a lose wire, power spikes, a faulty board level component, a cheap logic shifter or dozens of other things.

Are LEDs 5 or 12v? What board are you using, is it a reference nodeMCU? What version? What other parts do you have in the circuit … I’m asking so I can tell you how to strip down the circuit in the safest way possible.

Just put WLED on the ESP8266 instead of your other code. It integrates perfectly with HA and it will be super easy to code what you want to do inside HA, which is very similar to what I have. No need for logic shifter either

1 Like

Thanks much! This pretty great. Didn’t know this existed. Way easier for my application. I just have a problem now with some flickering that I’m thinking is data signal problems. My strip is actually in two parts and there is about 24 inches between the two strips. The ESP8266 is about 8 feet from the first LED on the strip and so I think it’s losing too much signal strength in the distance. I missed your note about the logic shifter and so that may also be a problem. I couldn’t find my shrink tubing to cover the soldered connections so it’s mostly held together with different blade type electrical connectors which I’m sure is also not helping but I wanted to see it working before I finalize everything. Thanks again!