Multiple SPI led strips?

Hi,
I want to add 2 different SPI led strips to 1 device (ESP32 devkitv1).

According to the ESPhome wiki I’m supposed to use the following code:

spi:
  mosi_pin: GPIO23
  clk_pin: GPIO22

light:
  - platform: spi_led_strip
    num_leds: 30
    color_correct: [80%, 60%, 100%]
    id: rgb_led
    name: "RGB LED Strip"
    data_rate: 1MHz

How do I add a second device? For example, I might want to connect the second led strip to GPIO 21 and 19. Also, does it matter to which pins I connect an SPI led strip to?

Well that depends. The spi_led_strip component (and your lights) do not have a CS line and do not support specifying a SPI bus. The only way to add 2 strips is to connect one to the end of the other effectively creating a single strip.

If you know how to drive the led strips directly the you can create separate SPI buses and address them individually using lambda, see the example in the SPI bus component:

Thank you for your reply. That is unfortunate. To clarify: My plan is to have 2 different spi led strips and 2 weight sensors connected to 1 esp. All of this is under my bed.

Originally, I had 1 esp for the weight sensors, and 1 for both spi leds (running WLED). I was hoping I could avoid using 2 different esps. In WLED you can connect 2 SPI strips to 1 esp.
So my only option is to combine both spi strips into 1, or use 2 esps?

You may be able to partition the single string, thus treating them as two light entities:

1 Like

Hello, I’m not sure if I understood your question correctly. In my setup, I’m using two strips with the P9813 LED driver ESP8266.

spi:
  mosi_pin: D7
  clk_pin: D5

light:
  - platform: spi_led_strip
    num_leds: 2
    color_correct: [80%, 60%, 100%]
    id: rgb_led
    name: "RGB LED Strip"
    data_rate: 1MHz

  - platform: partition
    name: "left"
    segments:
      - id: rgb_led
        from: 0
        to: 0

  - platform: partition
    name: "righ"
    segments:
      - id: rgb_led
        from: 1
        to: 1