Hello everyone.
Currently I am trying to convert my cheap IR RGB controller to ESP based one. After all this process it actually works really good, I can apply every automation, put effect on it. My main problem is after clicking turning off button on HA, it keeps on with very slightly blue-white light. Is that about bad transistor that driven by the PWM output?
When I switch off from HA, it keeps slightly blue.
Thats my ESPHome code,
light:
- platform: rgb
name: "rgbtv"
red: hue1
green: hue2
blue: hue3
id: rgbtvvv
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(rgbtvvv).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;
output:
- platform: esp8266_pwm
id: hue1
pin: 13
frequency: 100 Hz
max_power: 100%
- platform: esp8266_pwm
id: hue2
pin: 12
frequency: 100 Hz
max_power: 100%
- platform: esp8266_pwm
id: hue3
pin: 14
frequency: 100 Hz
max_power: 100%