Hi,
After too much time spent on this, i cannot make this work. Just want to have a select template to control the color of a led strip.
I had a look at :
but no success
light:
- platform: fastled_clockless
chipset: WS2811
pin: GPIO23
num_leds: 3
rgb_order: GRB
name: "led_strip"
id: led_strip
number:
- platform: template
name: "LED brightness"
optimistic: true
min_value: 0
max_value: 100
step: 1
id: led_brightness
select:
- platform: template
name: "menu"
options:
- "Rouge"
- "Vert"
- "Bleu"
optimistic: true
initial_option: "Rouge"
# restore_value: true
id: menu
on_value:
then:
- logger.log: "dans le then"
- if:
condition:
lambda: |-
return id(menu).active_index() == 0;
then:
- logger.log: "dans le if rouge"
- light.turn_on: led_strip
- light.addressable_set:
id: led_strip
range_from: 0
range_to: 2
color_brightness: !lambda |-
return 1*(id(led_brightness).state * 0.01);
red: 1
green: 0
blue: 0
- if:
condition:
lambda: |-
return id(menu).state.c_str() == "Vert";
then:
- logger.log: "dans le if vert"
- light.turn_on: led_strip
- light.addressable_set:
id: led_strip
range_from: 0
range_to: 2
color_brightness: !lambda |-
return 1*(id(led_brightness).state * 0.01);
red: 0
green: 1
blue: 0