Hopefully this is an easy one. I’ve started experimenting with ESPhome, and i can really see now how powerful it is. But, my first project is a simple RGB Led Strip. Basically, i want to move away from Tasmota, so i can get teh colour calibration better, and use the transition option.
I have flashed the Firmware using the Add On. It was dicovered by Home Assistant, but it is only showing as a Light with dimmer, but no colour selection. I’m assuming ive made a simple mistake, but can’t find it.
Any ideas?
esphome:
name: bathroom_mirror_v1
platform: ESP8266
board: esp01_1m
wifi:
ssid: "WifiSSID"
password: "wifipassword"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Bathroom Mirror V1"
password: "Or3g6z24tNZE"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
safe_mode: True
light:
- platform: rgb
name: "Bathroom Mirror Light"
id: me
red: output_red
green: output_green
blue: output_blue
restore_mode: RESTORE_DEFAULT_OFF
effects:
- lambda:
name: RedGreenFade
update_interval: 4s
lambda: |-
static int state = 0;
auto call = id(me).turn_on();
// Transtion of 1000ms = 1s
call.set_transition_length(4000);
if (state == 0) {
call.set_rgb(1.0, 0.0, 0.0);
} else if (state == 1) {
call.set_rgb(0.0, 1.0, 0.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 == 2) // repeat only the red and green from christmas
state = 0;
output:
- platform: esp8266_pwm
id: output_red
pin: GPIO4
- platform: esp8266_pwm
id: output_green
pin: GPIO12
- platform: esp8266_pwm
id: output_blue
pin: GPIO14