I need help in ESPhome - Fast LED (ws2812b) lambda Effect

Hello Friends :wave:
I hope you all doing well,

  1. I’m going to link WS2812b LED to my alarm system. in case of alarm triggered I want the led to turn on the effect. those things no problem I can do it.
    But I want that effect to be like this video (Police siren effect )
  1. I’m having a weather station on top of my building over there I’m having some Ws2812b LED. I want that led to flash particular color every 10s. I want to create this into effect.

Please help me with the effects, I don’t know how to do it with Lambda

Are we talking about single LED or a LED strip or something?

I think you have to learn a little on how to write lambda effects for yourself. You can also consider using WLED instead of ESPHome it comes with lots of effects included and has a working Home Assistant integration. But you will lose a lot of the other ESPHome features (like sensors and so on).

It is possible to port most of WLEDs effects over to ESPHome. I did it for pacifica. You should be able to do it for the police effect, but well you have to know a little bit of C++.

The police effect starts at https://github.com/Aircoookie/WLED/blob/1f4a15ee6b5ee88331f78343daa711a89c644051/wled00/FX.cpp line 1239…

  1. Your weather station thing:

If you want change the color of the single led or all leds of a strip at the same time you can use it without lambda and just use a normal automation/script or a interval/time thing.

1 Like

Thanks for replying

I’m talking about LED Stripe …(115 pixel - Ws2812b )

Ya I know about WLED, I’m using this in some other place, it’s doing a great job. But in my situation, I have to connect a lot more sensors with this ESP so only have to go for ESPHOME.

I’m having 0 experience in C++ and other Languages… now only I started to understand about Home Assistant. so only I’m asking this in the community, experts like u can Help me.

this is my present effect code

light:
  - platform: fastled_clockless
    chipset: WS2812b
    pin: D4
    num_leds: 115
    rgb_order: GRB
    name: "Hall LED Notification"
    id: full_led_strip
    effects:
      # Use default parameters:
      - addressable_rainbow:
      - addressable_color_wipe:
      - addressable_scan:
          move_interval: 10ms
          scan_width: 2
      - addressable_twinkle:
      - addressable_random_twinkle:
      - addressable_fireworks:
          use_random_color: true
      - addressable_scan:
          move_interval: 10ms
          scan_width: 1
          name: Fast Scan
  1. I have checked the link you have attached. I find the “American Police Light with all LEDs Red and Blue” effect but, I don’t know how to make that work with ESPHome.

I have to learn a lot … I’m working on it.

  1. In the weather station … yes we can do it in script/ automation
    But that light is going to be on 24/7, For every second it has to send a signal to ESP from the Home assistant. if we make the Effect means it has to send only one signal to on and off

Please help me with those 2 effects

Sorry, I can help you if you have specific questions or are stuck trying to do write it yourself.

But: Writing the lambda effect for you will take me at least an hour or more. Sorry :frowning:

In general: I think it would be great if the most important WLED effects would be integrated into ESPHome. Maybe a feature request can help to collect the missing effects (and will help to figure out of the maintainers are open to the idea). Maybe a few people could port one or two effects each. (I might be willing to port one).

thanks for your time … :grinning:

Agree - use WLED for this use case. It works great with HA. (I am using both WLED and ESPHome BTW - love esphome too)

In the same board, some sensor also connected … so only searching for lambda effect

@danielw sorry for replying to this necrothread but you mentioned in your reply that you had already ported the pacifica effect to ESPHome. Would you be willing to share that with me as it’s the last effect I need to move off MySensors to ESPHome. That would save me from having to trial an error convert it myself.

@wokwon

I am not sure if it is easy to use for you. I will have a look on the weekend and see how I can extract the relevant parts for you.

1 Like

Anything you provide would be a help, as I’ll have other effects to do after that and your work might help me as a ‘base’ or ‘framework’ of sorts.