Skip to content

About

ESPHome Code for LED Controller

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

DIY RGB LED Controller

ESPHome Code for LED Controller

ESPHome Code:

esphome:
  name: feature_light

esp8266:
  board: esp01_1m

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

logger:
api:
ota:
  platform: esphome

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "Feature Light Button"
    internal: true
    on_press:
      - switch.toggle: feature_light_relay
  - platform: template
    id: turn_switch_if_light
    lambda: !lambda |-
      return id(feature_light_rgb).current_values.is_on();
    on_press:
      then:
        - switch.turn_on: feature_light_relay
    on_release:
      then:
        - switch.turn_off: feature_light_relay

switch:
  - platform: gpio
    pin: GPIO12
    name: "Feature Light Relay"
    id: feature_light_relay
    internal: true

status_led:
  pin:
    number: GPIO13
    inverted: yes

light:
  - platform: rgb
    name: "Feature Light"
    id: feature_light_rgb
    red: red
    green: green
    blue: blue
    effects:
      - lambda:
          name: Randon Colours
          update_interval: .5s
          lambda: |-
            auto call = id(feature_light_rgb).turn_on();
            call.set_transition_length(500);
            call.set_rgb(random(10)*.1, random(10)*.1, random(10)*.1);
            call.perform();
      - lambda:
          name: Randon Colours Slow
          update_interval: 1.5s
          lambda: |-
            auto call = id(feature_light_rgb).turn_on();
            call.set_transition_length(1000);
            call.set_rgb(random(10)*.1, random(10)*.1, random(10)*.1);
            call.perform();

output:
  - platform: esp8266_pwm
    id: red
    pin: GPIO1
  - platform: esp8266_pwm
    id: green
    pin: GPIO3
  - platform: esp8266_pwm
    id: blue
    pin: GPIO2

💖 Support This Project

Found this useful? Want to say thanks and fuel future creations?

Your support keeps the creativity flowing! 🍺✨

Buy Me A Coffee
☕ Buy me a Coffee
Patreon
💖 Join on Patreon

Every contribution helps bring more awesome projects to life! 🚀


About

ESPHome Code for LED Controller

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors