How to control ESP Home FASTLED WS2811 LEDs separately?

I making some aquarium controller, added sonoff 4 ch Pro ( with tasmota on it), one node mcu 8266 board to control it manually if needed. Some addressable thermostat ( dallas) and 4 pushbutton switch on it.
And thought I would put some signal lights for the status check as well. I added config ( on ESP Home):

light:
  - platform: fastled_clockless
    chipset: WS2811
    pin: GPIO4
    num_leds: 4
    rgb_order: GRB
    name: "FastLED WS2811 Light"

individually addressable LED strip (right now I can change all 4 LED’s together).
Now the question is can I or how can I send commands for different LEDs ? ( When sonoff switch 1 is on then LED 1 [0] id red when off then is green, when sonoff switch 2 is on then LED 2 [1] is red and etc. ) I think I can to automation in node-red with that, but how I send commands separately for each LED ?

1 Like

thanks @nickrout, Your hint and a little searching in the forum led me to this post:

And my solution is working with this code.

# Example configuration entry
light:
  - platform: fastled_clockless
    chipset: WS2812
    pin: GPIO4
    num_leds: 4
    rgb_order: GRB
    name: "ESP6 LED AKVAARIUM"
    id: LED_ring
  - platform: partition
    name: "tuli1"
    id: section1
    segments:
      - id: LED_ring
        from: 0
        to: 0
  - platform: partition
    name: "tuli2"
    id: section2
    segments:
      - id: LED_ring
        from: 1
        to: 1
  - platform: partition
    name: "tuli3"
    id: section3
    segments:
      - id: LED_ring
        from: 2
        to: 2
  - platform: partition
    name: "tuli4"
    id: section4
    segments:
      - id: LED_ring
        from: 3
        to: 3

Thanks again

5 Likes

Now I have new problem with that - I can control each led from integration section on HA, but whe I try to send commands from Developer Tools, then It makes changes in integration popup window section but the commands won’t reach to the LEDs - any ideas ?

No I think logs may be needed.

Hi! I don’t know why my commands will not reach from Developer Tools TAB to LED, but from Node-Red I can send my command and for me it’s OK!
Example :
01