WS2812 - Effects dont work with - platform: partition

Im trying to use an effect on a WS2812 strip where I have partitioned off the LED’s to indicate certain states (like Wifi Connected and API connected).

It appears that effects dont seem to work with partitions.

Is this a bug or am i doing something wrong

wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password
 
  on_connect:
    then:
      - light.turn_on:
          id: wifi_online
          effect: "online"
  on_disconnect:
    then:
      - light.turn_on:
          id: wifi_online
          effect: "offline" 
api:
  on_client_disconnected:
    then:
      - light.turn_on:
          id: api_online
          effect: "offline" 
  on_client_connected:
    then:
      - light.turn_on:
          id: api_online
          effect: "online" 
light:
  - platform: esp32_rmt_led_strip
    id: led
    rgb_order: grb
    pin: GPIO15
    num_leds: 5
    rmt_channel: 0
    name: "Status LED"
    chipset: WS2812
    default_transition_length: 0s
    effects:
      - strobe:
          name: "offline"
          colors:
            - state: true
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 2s
      - strobe:
          name: "online"
          colors:
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 100%
              duration: 250ms
            - state: false
              duration: 2s


  - platform: partition
    id: wifi_online
    name: "Wifi Online"
    segments:
      - id: led
        from: 0
        to: 0
  - platform: partition
    id: api_online
    name: "API Online"
    segments:
      - id: led
        from: 1
        to: 1
...
...
 

If i supply color and brightness parameters to each of the - light.turn_on statements the colors work, but effects do not.

I don’t think you have your partitions set up correctly, take a look at this old post and compare :slight_smile:

What I have above is correct for addressing one pixel.

- platform: partition
    id: api_online
    name: "API Online"
    segments:
      - id: led
        from: 1
        to: 2

addresses 2 pixels.

I just tested it

so if you use

  - platform: partition
    id: api_online
    name: "API Online"
    effects:
      - strobe:
    segments:
      - id: led
        from: 1
        to: 1

I partially works, however if you have multiple effects under the - strobe: effect in the light domain there is no way of selecting either one of them in the partition platform

eg:

    effects:
      - strobe:
          name: "offline"
          colors:
            - state: true
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 2s

      - strobe:
          name: "online"
          colors:
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 250ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 100%
              duration: 250ms
            - state: false
              duration: 2s

These are both valid for the entire light domain but not for the partition platform

Yeah, it does look correct on second inspection, sorry the first was a bit of a rush as I just started work. I’ll have a look at mine when I get home and see if it works with a similar setup as yours.

At the moment, I’m at work and can’t access them, apparently they also need updating.

I’ll report back later today.

Sorry, but I got home and realised that I’ve actually changed that set of lights to WLED. So I can’t help any further :frowning:

Good Luck!