Dimmer sometimes not switched on after dimTo command?  [SOLVED]

Moderator: leecollings

Post Reply
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Dimmer sometimes not switched on after dimTo command?

Post by Bikey »

I am using the command: dimTo(20) command in a script to switch a Zwave dimmer on at 20% level.
This often works, but strangely not always.

In the log I can see messages like "Constructed timed-command: Set Level 20", however sometimes the dimmer does not change state, and also the log of the dimmer shows no state change.

So question is, is this a bug? Or should I alway follow dimTo(level) with a switchOn() command?

* EDIT * if I follow the dimTo with a switchOn command the dimmer is always set at 100%
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dimmer sometimes not switched on after dimTo command?

Post by waaren »

Bikey wrote: Tuesday 29 January 2019 23:29 I am using the command: dimTo(20) command in a script to switch a Zwave dimmer on at 20% level.
This often works, but strangely not always.

In the log I can see messages like "Constructed timed-command: Set Level 20", however sometimes the dimmer does not change state, and also the log of the dimmer shows no state change.

So question is, is this a bug? Or should I alway follow dimTo(level) with a switchOn() command?

* EDIT * if I follow the dimTo with a switchOn command the dimmer is always set at 100%
I don't see this behavior on my dimmers but I don't have any Zwave dimmer. If possible it would help if you can describe in what circumstances you see this and if any other commands / scripts could be of any influence.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Dimmer sometimes not switched on after dimTo command?

Post by Bikey »

I have not found out if there are specific circumstances. It all works fine in a normal Lua script where a use:
a command like: commandArray[DimmableSwitch]='Set Level 15'
Now that I have replaced that script with the DZVents version, with the dimTo(15) it behaves differently.

Btw. I also looks like the script (triggered by a PIR-sensor) is also less responsive with DZvents then with regular Lua.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dimmer sometimes not switched on after dimTo command?  [SOLVED]

Post by waaren »

Bikey wrote: Wednesday 30 January 2019 23:55 I have not found out if there are specific circumstances. It all works fine in a normal Lua script where a use:
a command like: commandArray[DimmableSwitch]='Set Level 15'
Now that I have replaced that script with the DZVents version, with the dimTo(15) it behaves differently.

Btw. I also looks like the script (triggered by a PIR-sensor) is also less responsive with DZvents then with regular Lua.
dzVents dimTo(15) sends the exact same command to domoticz as the Lua commandArray 'Set level' so I would really like to understand when the different behavior occurs and under what circumstances.
A dzVents, Lua or Blockly script can looks to be less responsive if it need to wait for another script to finish. Domoticz event system is single threaded meaning that only one script can be active at any time. Script 1 has to finish before script 2 starts. That is a design principle of the domoticz event system.
Now most of the script finish in milliseconds but some can take a bit longer especial if they need to wait for osCommands to return control to the script.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests