i lately installed esphome on an LSC light.
i got it up and running and am using it in domoticz
when i switch on the light i want it to go to 80% ww brightness
this works nut the slider in domoticz shows 100%
it is switching to 80% but still comunicates 100% to the outside world through MQTT
this is what i see in MQTT
204 is the 80% ww brightness but i do not know where the 255(100% is coming from)
{"effect":"None","effect_index":0,"effect_count":7,"color_mode":"cwww","state":"ON","brightness":255,"color":{"c":0,"w":204}}
this is my yaml code
esphome:
name: douchelamp
friendly_name: douchelamp
on_boot:
priority: 750.0
then:
- light.turn_on:
id: douchelamp
color_brightness: 0%
warm_white: 80%
cold_white: 0%
red: 0 %
green: 0%
bk72xx:
board: generic-bk7231t-qfn32-tuya
# Enable logging
logger:
# Enable Home Assistant API
api:
reboot_timeout: 0s
# encryption:
# key: "Ub6bNtTKVi2yarUgmuUVIvGI0poG6M0xyxypmaB+Wx4="
ota:
- platform: esphome
password: "951e680162625b1acf70c2ee117824ac"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.1.165
gateway: 192.168.1.1
subnet: 255.255.255.0
mqtt:
broker: 192.168.1.50
username: ""
password: ""
discover_ip: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
#ap:
# ssid: "Light Fallback Hotspot"
# password: "ns6sHX1qmQZo"
captive_portal:
web_server:
port: 80
local: true
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
button:
- platform: restart
id: restart_button
name: Restart
entity_category: diagnostic
bp5758d:
data_pin: P26
clock_pin: P24
output:
- platform: bp5758d
id: output_red
channel: 2
- platform: bp5758d
id: output_green
channel: 1
- platform: bp5758d
id: output_blue
channel: 3
- platform: bp5758d
id: output_warm_white
channel: 4
- platform: bp5758d
id: output_cold_white
channel: 5
light:
- platform: rgbww
name: douchelamp
id: douchelamp
restore_mode: ALWAYS_ON
initial_state:
brightness: 80%
red: output_red
green: output_green
blue: output_blue
cold_white: output_cold_white
warm_white: output_warm_white
cold_white_color_temperature: 6500 K
warm_white_color_temperature: 2700 K
color_interlock: true
constant_brightness: false
default_transition_length: 250ms
effects:
- random:
name: "Fast Random"
transition_length: 4s
update_interval: 5s
- strobe:
- pulse:
- pulse:
name: "Fast Pulse"
transition_length: 50ms
update_interval: 100ms
min_brightness: 0%
max_brightness: 100%
- pulse:
name: "Slow Pulse"
transition_length: 100ms
update_interval: 500ms
min_brightness: 0%
max_brightness: 100%
- flicker:
alpha: 50% #The percentage that the last color value should affect the light. More or less the “forget-factor” of an exponential moving average. Defaults to 95%.
intensity: 50% #The intensity of the flickering, basically the maximum amplitude of the random offsets. Defaults to 1.5%.
- lambda:
name: Throb
update_interval: 1s
lambda: |-
static int state = 0;
auto call = id(douchelamp).turn_on();
// Transtion of 1000ms = 1s
call.set_transition_length(1000);
if (state == 0) {
call.set_brightness(1.0);
} else {
call.set_brightness(0.01);
}
call.perform();
state += 1;
if (state == 2)
state = 0;