Page 1 of 1

RGB level reading issue

Posted: Sunday 09 May 2021 22:44
by eluijer
I am running into a strange issue with a zwave Aeotec RGB bulb:

if I set the bulb to an RGB value with .setColor(R,G,B,%) all goes well and I can read back the level% with .level

However if I set the bulb to white mode with .setWhiteMode() and then to a certain level with .dimTo(%) the level % is lost in Domoticz device table in dzVents - even though the JSON reports correct values. Reading the .level value gives me 0 and the .nValue gives me 14.

The Switch in Domoticz shows the correct position with the dimmer and if I move it slightly it shows the %

I am quite sure that this was working fine in the previous version of Domoticz as I developed and debugged the script under 2020.2

Any one can confirm the behavior? Is this a dzVent or general Domoticz bug?

Thanks
Eric.

Re: RGB level reading issue

Posted: Sunday 09 May 2021 23:41
by waaren
eluijer wrote: Sunday 09 May 2021 22:44 Any one can confirm the behavior?
Yes. I tested this scenario and can confirm the described behavior.

It is a timing issue. In builds >= 12870, openURL commands are executed in a separate thread to prevent scripts being blocked by multiple openURL's
setWhiteMode() is implemented in dzVents with openURL.
So dimTo() can now be executed by domoticz before the execution of setWhiteMode() and setWhiteMode() results in a level 0.

What you can do is add an afterSec(1) or afterSec(2) to the dimTo() to ensure it will be executed after the setWhiteMode() or using the attribute lastLevel in a next script.

Re: RGB level reading issue

Posted: Monday 10 May 2021 9:59
by eluijer
Thanks for the explanation! It solves indeed my problem- I set it to 1 second which seems to be enough.