Hi,
I have a couple of devices that share identical codes.
They control LED strips and I want them to have their indivudal color.
I need some kind of parameter that I can set in home assistant to set them to their individual color for the single color effects.
The Problem ist that a dissconnect overwrites the color that I picked for the light platform with red and stays red,
so I thought of a colorpicker in HA that writes into a template on the ESP32, but how can I achieve that?
All start with this code
esphome:
name: strippy-nr1
friendly_name: Strippy Nr 1
compile_process_limit: 2
platformio_options:
board_build.flash_mode: dio
on_boot:
- light.turn_on:
id: led_strip
red: 100%
green: 0%
blue: 0%
brightness: 60%
effect: "Scan Effect"
on_client_disconnected:
- light.turn_on:
id: led_strip
effect: "Slow Pulse"
red: 80%
green: 0%
blue: 0%
brightness: 50%
on_client_connected:
- delay: 50ms
- light.turn_off: led_strip
and later they have a couple of effects like this:
light:
- platform: esp32_rmt_led_strip
id: led_strip
rgb_order: GRB
pin: GPIO09
num_leds: 4
chipset: ws2812
name: "Led Strip"
effects:
- pulse:
- pulse:
name: "Fast Pulse"
transition_length: 0.5s
update_interval: 0.5s
min_brightness: 0%
max_brightness: 100%
- pulse:
name: "Slow Pulse"
transition_length: 1s
update_interval: 1s
min_brightness: 0%
max_brightness: 100%
- pulse:
name: "Listening"
transition_length: 1s
update_interval: 1s
min_brightness: 30%
max_brightness: 60%
- addressable_scan:
name: "Scan Effect With Custom Values"
move_interval: 200ms
scan_width: 1
- addressable_scan:
name: "Scan Effect With Custom Values_slow"
move_interval: 600ms
scan_width: 1
- random:
name: "Random Effect With Custom Values"
transition_length: 5s
update_interval: 2s
- flicker:
name: "Flicker Effect With Custom Values"
alpha: 95%
intensity: 40%
- addressable_random_twinkle:
name: "Random Twinkle Effect With Custom Values"
twinkle_probability: 5%
progress_interval: 32ms
- addressable_fireworks:
name: "Fireworks Effect With Custom Values"
update_interval: 32ms
spark_probability: 50%
use_random_color: true
fade_out_rate: 120