Bardascar
Published

Old Led strip to smart led strip with esp32, esphome, hass

Turn old led strip into smart led strip

IntermediateShowcase (no instructions)30 minutes3,592
Old Led strip to smart led strip with esp32, esphome, hass

Things used in this project

Hardware components

ESP32S
Espressif ESP32S
×1
lm 2596
×1

Story

Read more

Schematics

diagram

Code

esphome code

YAML
light:
  - platform: rgb
    red: gpio_21
    green: gpio_19
    blue: gpio_18
    name: "RGB strip porta"
    id: strip_porta
    effects:
      # Use default parameters:
      - random:
      # Customize parameters
      - random:
          name: "Slow Random Effect"
          transition_length: 30s
          update_interval: 30s
      - random:
          name: "Fast Random Effect"
          transition_length: 4s
          update_interval: 5s
      - strobe:
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: False
              duration: 250ms
            - state: True
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms
      - flicker:
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 1.5%
      - lambda:
          name: My Custom Effect
          update_interval: 1s
          lambda: |-
            static int state = 0;
            auto call = id(strip_porta).turn_on();
            // Transtion of 1000ms = 1s
            call.set_transition_length(1000);
            if (state == 0) {
              call.set_rgb(1.0, 1.0, 1.0);
            } else if (state == 1) {
              call.set_rgb(1.0, 0.0, 1.0);
            } else if (state == 2) {
              call.set_rgb(0.0, 0.0, 1.0);
            } else {
              call.set_rgb(1.0, 0.0, 0.0);
            }
            call.perform();
            state += 1;
            if (state == 4)
              state = 0;

Credits

Bardascar

Bardascar

1 project • 0 followers

Comments