Hi,
I recently purchased couple of Tuya RGBW LED controllers and flashed one of them with ESPHome as a test. That worked great. I put together config as per this page - https://esphome.io/cookbook/tuya_rgbw.html
So my config looks as follows:
esphome:
name: rgb-light-office
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret api_key
ota:
password: !secret ota_pwd
wifi:
networks:
- ssid: !secret ssid
password: !secret pwd
manual_ip:
static_ip: my ip address
gateway: my_gateway
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Rgb-Light-Office"
password: !secret another_pw
captive_portal:
# Example configuration entry
output:
- platform: esp8266_pwm
id: output_green
pin: GPIO14
- platform: esp8266_pwm
id: output_red
pin: GPIO5
- platform: esp8266_pwm
id: output_blue
pin: GPIO12
- platform: esp8266_pwm
id: output_white
pin: GPIO15
globals:
- id: action_state
type: int
restore_value: no
initial_value: '0'
binary_sensor:
- platform: gpio
pin: GPIO13
name: "RGBW Controller Button"
filters:
- invert:
- delayed_on_off: 20ms
on_press:
then:
- lambda: id(action_state) = (id(action_state) + 1) % 4;
- if:
condition:
lambda: 'return id(action_state) == 0;'
then:
- light.turn_off: rgbw_lightstrip1
- if:
condition:
lambda: 'return id(action_state) == 1;'
then:
- light.turn_on:
id: rgbw_lightstrip1
brightness: 60%
- if:
condition:
lambda: 'return id(action_state) == 2;'
then:
- light.turn_on:
id: rgbw_lightstrip1
brightness: 40%
- if:
condition:
lambda: 'return id(action_state) == 3;'
then:
- light.turn_on:
id: rgbw_lightstrip1
brightness: 15%
light:
- platform: rgbw
name: "rgbw_strip_01"
id: rgbw_lightstrip1
red: output_red
green: output_green
blue: output_blue
white: output_white
# Ensure the light turns on by default if the physical switch is actuated.
restore_mode: ALWAYS_OFF
At first that seemed to work fine - however when I started playing with the colours I noticed that when the colour brightness is set to 100% and white brightness is 100% white lights start to flicker.
If I take the white brightness down to 70-80% the flickering stops.
With the colour lights turned off and only white is active on 100% there is no flickering. It also works the other way round so white is off and rgb are 100% there is no flickering.
Has anyone came across similar problem? Any suggestions how to fix it?
BTW - when the controller was running on Tuya there was problems - no flickering