Question concerning deep_sleep and neopixels

I have 3 neopixel/addressable LED that I want to be on during the time the esp32 is awake but off when it deep sleeps. I might have the data pin set to the wrong one but the lights stay on while it is asleep. Any suggestion? Just want to turn off everything during deep sleep to preserve battery life…then on while it is taking it’s samples. THANKS.

Cut power to the neopixels :wink:

Check the current requirements of your 3 RGB LEDs (might be less as advertised if you don’t use 100% white for example) as you might be lucky to just use a free GPIO as a “power switch” for the LEDs Vin :bulb:

I am using the “iot” platform from df robot, called firebeetle v2. It is a lot more robust in power and know from experience I can potentially run a dozen or so pixels from battery or usb without issue. Though I am currently running only 3 as well as a air quality sensor and temp/humidity sensor. I am curious do I need to use a “power switch” to turn those off as well prior to sleep? I will have to go back to Arduino IDE to test this, but I swear that everything just turned off when entering deep sleep via enabling it on that…maybe I am wrong.

I am still learning HA and esphome…I will try to look into your suggestion but my issue is finding example yaml.

This way you should be able to achieve 0 power draw from the LEDs while in deep sleep. Otherwise the LEDs probably also consume power when they are off (in your eyes :eyes:) but connected to the battery :bulb:

Good question. Probably no IDE needed to test this. Just hook the Data Pin onto a random GPIO of your ESP and configure it as a switch. See what it does when the pin is pulled high or low. :arrows_clockwise:

Best source for examples is actually www.esphome.io

Each component normally comes with one or more good examples and all possible configuration variables.

For example:

# Example configuration entry
switch:
  - platform: gpio
    pin: 25
    name: "Living Room Dehumidifier"

Okay so I have tried about 5 different things…this is what I have so far.

switch:

  • platform: gpio
    pin: 25
    id: pms_set
    name: “Pixel Switch”

interval:

  • interval: 10s
    then:
    • switch.turn_on: pms_set
    • delay: 10s
    • switch.turn_off: pms_set

sensor:

  • platform: dht
    pin: 14
    temperature:
    name: “Kitchen Temperature”
    humidity:
    name: “Kitchen Humidity”
    update_interval: 10s

light:

  • platform: neopixelbus
    type: GRB
    variant: WS2811
    pin: GPIO25
    method: ESP32_i2s
    num_leds: 3
    name: “Kai Light”
    effects:
    • addressable_scan:
      name: Scan Effect With Custom Values
      move_interval: 45ms
      scan_width: 1

It does not seem that it works…I removed the deep sleep for testing. It fires the switch by the way I can see it firing in the output log but it does not seem to affect that data pin the pixels are on and I can still on/off them via the dashboard. It may be that there is an alternate way to enable to the neopixelbus? I tried getting WLED running but was unable to, seems like the limits of the pi3b+ prevents me loading too much stuff…even though I have plenty of room, the installation of the stuff was kind of a dead end, still I don’t need too many options, just a nice rotating red set of 3 lights…or something. Basically to alert me that it is working correctly without need to go to the dashboard.

Also if I can get this to work I have about 20 of these to deploy, with the planttower ppm sensors.

Thoughts?
AND BTW Thank you!

I have tried WLED now too. seems like there are a few user mods on it that allow some sensor control, but none of my sensors are listed. SO it looks like neopixel will be the way to go. Still can’t get it to turn off the lights though, but now I am thinking that it might with the proper resistor installed.