WS2812B Effects in HA

Hey All -

Got a project where I’m trying to implement a 29 LED WS2812B strip on a circular model and having some issues. I flashed a Wemos D1 Mini with the below code and can get the strip to turn on/off, but can’t figure out how to use / select any effects I’ve added.

To note, the effect I’m looking to eventually try to emulate is where 3 LEDs are lit (50%, 100%, 50%) which scan in a circle around the model and have the ability to select the color and speed from within HA.

First, I’m trying to get simply any effect to work as shown in the below code snippet. I tried adding a Helper in HA, but couldn’t get it to work.

Any help is appreciated - Thanks!

light:

  • platform: neopixelbus
    type: GRB
    variant: WS2811
    pin: D3
    num_leds: 29
    name: “UFO”
    effects:
    • pulse:
    • pulse:
      name: “Fast Pulse”
      transition_length: 0.5s
      update_interval: 0.5s
    • pulse:
      name: “Slow Pulse”
      update_interval: 2s

It would be really helpful if you could post your code properly. Three back ticks on a line before and after the code please.

Thanks, but figured it out a few minutes ago. For some reason, HA didn’t see it as RGB, but somehow got it to work, Thanks!

Thanks, that will be really helpful to someone in the future. Borat - Not Joke | FULL SCENE | HD - YouTube

Hey, I’m all for posting solutions to help future folks - know it’s benefited me before. Unfortunately, don’t know exactly what made it work. Will dig into it more tomorrow and post if 100% identify the prior issue.

Thanks for the Borat video to give a laugh - Appreciate you replying

Yeah I hate it when that happens! Solution without explanation.

What was your final yaml file?

It’s below. Please excuse all the effects as still testing out what I want. Also includes code for powering x3 pair of 5mm LEDs. Ca at least say that I was using neopixelbus as platform when posting as opposed to fastled_clockless now. Don’t know how much that applied to the solution, but plan to test more tomorrow time permitting.

esphome:
  name: LampTest2

esp8266:
  board: d1_mini
  framework:
    version: 2.7.4

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "xxxxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "LampTest2 Fallback Hotspot"
    password: "xxxxxxxxxxxxx"

captive_portal:

light:
  - platform: fastled_clockless
    chipset: ws2812b
    rgb_order: GRB
    pin: D3
    num_leds: 29
    name: "UFO"
    effects:
      - pulse:
      - pulse:
          name: "Fast Pulse"
          transition_length: 0.5s
          update_interval: 0.5s
      - pulse:
          name: "Slow Pulse"
          # transition_length: 1s      # defaults to 1s
          update_interval: 2s
      - addressable_scan:
      - addressable_scan:
          name: Scan Effect With Custom Values
          move_interval: 100ms
          scan_width: 3
      - addressable_twinkle:
      - addressable_twinkle:
          name: Twinkle Effect With Custom Values
          twinkle_probability: 5%
          progress_interval: 4ms
      - addressable_random_twinkle:
      - addressable_random_twinkle:
          name: Random Twinkle Effect With Custom Values
          twinkle_probability: 20%
          progress_interval: 32ms
      - addressable_fireworks:
      - addressable_fireworks:
          name: Fireworks Effect With Custom Values
          update_interval: 32ms
          spark_probability: 10%
          use_random_color: false
          fade_out_rate: 120
      - addressable_flicker:
      - addressable_flicker:
          name: Flicker Effect With Custom Values
          update_interval: 16ms
          intensity: 5%
  - platform: monochromatic
    id: LED1
    name: "LED1"
    output: gpio5
  - platform: monochromatic
    id: LED2
    name: "LED2"
    output: gpio6
  - platform: monochromatic
    id: LED3
    name: "LED3"
    output: gpio7
  - platform: partition
    name: "Beam"
    segments:
      - single_light_id: LED1
      - single_light_id: LED2
      - single_light_id: LED3

    
output:
  - platform: esp8266_pwm
    pin: D5
    #inverted: true
    id: gpio5
  - platform: esp8266_pwm
    pin: D6
    #inverted: true
    id: gpio6
  - platform: esp8266_pwm
    pin: D7
    #inverted: true
    id: gpio7
2 Likes