openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.43k stars 253 forks source link

Tunable white configuration. #386

Closed valeklubomir closed 1 year ago

valeklubomir commented 1 year ago

Device #1: LSC Smart Bulb 1400 lm/E27/Tunable White Device is 14W tunable white, with BK7231T and simple current drivers controlled by PWM. PWM1 - Cold White PWM2 - Warm White

Device #2: LED SMART WIFI Ceiling light Device is 28 W, 1960 lm, tunable white 3000 – 6000 K controlled by special driver BP5926. BK7231N PWM1 - Light Intensity PWM2 - Light Temperature

"Stupid" question. How to correctly setup this devices?

EDIT: I could "reverse" engineer code for lighting driver. But asking is faster. :-)

openshwprojects commented 1 year ago

Device 1 - just Channel 0 to PWM and Channel 1 to PWM and it should happen automatically? Device 2 - as above, but then set flag: image

Please check if it works, if somethings wrong we can fix it. Mayeb also worth updating readme or smth

valeklubomir commented 1 year ago

Is this correct? image PWM index ? Is 0 used? Regular users are not programmers most do not know that 0 can be used.

openshwprojects commented 1 year ago

The PWM index selection is smart and just checks which index is defined first. If that's 0, then 0 is used. If that's 1, then 1 is used.

valeklubomir commented 1 year ago

How do I setup that light correctly? After REBOOT/RESTART, I see this: image But light is off in the real, only after changing any setting brightness or temperature light goes ON.

openshwprojects commented 1 year ago

@valeklubomir I saw that, I think it's a little bug, the light is off at the start and somehow the led state seems to be 1, I will look into it tomorrow. But basically, it should work okay if you just click "Toggle Light" twice. THE FIX is most likely just: image

changing it to 0 here. I gotta go now, I will look into it tomorrow morning (in about 14 hours at most from now) and also commit a lightweight vsnprintf