RGB level reading issue

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
eluijer
Posts: 5
Joined: Sunday 09 May 2021 22:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Switzerland
Contact:

RGB level reading issue

Post 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.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: RGB level reading issue

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
eluijer
Posts: 5
Joined: Sunday 09 May 2021 22:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Switzerland
Contact:

Re: RGB level reading issue

Post by eluijer »

Thanks for the explanation! It solves indeed my problem- I set it to 1 second which seems to be enough.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest