Hey
I have 3 FastLED Clockless Leds in a chain, but I can not understand how I can address each light. How do I do if I want Led1=Red, Led2=Blue, Led3=Green?
I would like the colors to change depending on sensor status.
Hey
I have 3 FastLED Clockless Leds in a chain, but I can not understand how I can address each light. How do I do if I want Led1=Red, Led2=Blue, Led3=Green?
I would like the colors to change depending on sensor status.
11.1 has a new feature - “Partition” light that is intended to do this and allow a separate light definition for each led.- but I cant quite get it working yet.
There is an alternative but its a bit more code heavy. The example below defines multiple effects. Each effect manually sets a specific led to an RGB setting. The named effect can then be called.
light:
- platform: neopixelbus
internal: true
type: GRB
method: BIT_BANG
default_transition_length: 0s
pin: GPIO15
num_leds: 12
name: "LED_Status"
id: led_status
effects:
# LED 1 Custom Colour Effects
- addressable_lambda:
name: "Led-01-Red"
lambda: |-
it[0] = light::ESPColor(255,0,0);
- addressable_lambda:
name: "Led-01-Green"
lambda: |-
it[0] = light::ESPColor(0, 255, 0);
- addressable_lambda:
name: "Led-01-Yellow"
lambda: |-
it[0] = light::ESPColor(255, 255, 0);
# LED 2 Custom Colour Effects
- addressable_lambda:
name: "Led-02-Red"
lambda: |-
it[1] = light::ESPColor(255,0,0);
- addressable_lambda:
name: "Led-02-Green"
lambda: |-
it[1] = light::ESPColor(0, 255, 0);
- addressable_lambda:
name: "Led-02-Yellow"
lambda: |-
it[1] = light::ESPColor(255, 255, 0);
Those affects being called from a sensor condtion…
sensor:
- platform: ads1115
ads1115_id: ads1115_1
id: ads1115_1_a0
# <other sensor stuff>
internal: true
on_value:
then:
- if:
condition:
lambda: ‘return (id(ads1115_1_a0).state > 3.4);’
then:
- light.turn_on:
id: led_status
effect: “Led-01-Green”