arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.18k stars 4.8k forks source link

VirtualCT does not work for RGBCW lights with SetOption92=1 #15337

Closed jonschz closed 2 years ago

jonschz commented 2 years ago

PROBLEM DESCRIPTION

I have an RGBCW LED light (Athom LB01-15W-E27) with the template given here. SetOption92 1 is enabled, which works as expected (RGB and white channels). SetOption68 is off, SetOption37 is set to 0.

I followed the instructions on the pull request introducing the command VirtualCT, and found that it has no effect on my lamp.

According to my understanding of the pull request, VirtualCT should work on my device:

This new version gives fine grain control to drive Colw/Warm white, for RGB, RGBW and RGBCW.

A discussion in Discord on 2021-06-22 starting here discussed a related issue, but did not yield any results.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

TO REPRODUCE

For testing puproses, I run the following:

SetOption106 1
restart 1

and after the restart:

VirtualCT
RESULT = {"VirtualCT":{"153":"000000FF00","500":"00000000FF"}}
CT 153
RESULT = {"POWER":"ON","Dimmer":100,"Color":"000000FF00","HSBColor":"0,0,0","White":100,"CT":153,"Channel":[0,0,0,100,0]}
CT 500
RESULT = {"POWER":"ON","Dimmer":100,"Color":"00000000FF","HSBColor":"0,0,0","White":100,"CT":500,"Channel":[0,0,0,0,100]}
VirtualCT {"153":"00000000FF","500":"000000FF00"}
RESULT = {"VirtualCT":{"153":"00000000FF","500":"000000FF00"}}
CT 153
RESULT = {"POWER":"ON","Dimmer":100,"Color":"000000FF00","HSBColor":"0,0,0","White":100,"CT":153,"Channel":[0,0,0,100,0]}
CT 500
RESULT = {"POWER":"ON","Dimmer":100,"Color":"00000000FF","HSBColor":"0,0,0","White":100,"CT":500,"Channel":[0,0,0,0,100]}

EXPECTED BEHAVIOUR

After the second VirtualCT call, I would expect cold white and warm white to have flipped (I know that I could achieve this by other means, this is only to demonstrate the problem). However, the second VirtualCT call has no effects whatsoever.

SCREENSHOTS

not applicable

ADDITIONAL CONTEXT

Potential error in the source code?

Edited

It appears that SetOption92 1 causes the computation of VirtualCT to be skipped:

https://github.com/arendst/Tasmota/blob/dafc5d6f45d3b916e9b0734416c61c6381b8f3c7/tasmota/xdrv_04_light.ino#L2308

Here we return from calcGammaBulbs before the VirtualCT code is executed:

https://github.com/arendst/Tasmota/blob/dafc5d6f45d3b916e9b0734416c61c6381b8f3c7/tasmota/xdrv_04_light.ino#L2329

Why even use VirtualCT on an RGBCW light?

The warm white of the light is not warm enough for my taste, so I want to mix in some RGB. Furthermore, I only ever use a small portion of the CT slider, as I don't need any cold whites beyond 325. What I would want to use in the end is something like

VirtualCT {"153":"0000007F7F","325":"00000000FF","500":"A080000050"}

(Please, remember to close the issue when the problem has been addressed)

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 years ago

This issue was automatically closed because of being stale. Feel free to open a new one if you still experience this problem.