Page 1 of 1

Dimmer sometimes not switched on after dimTo command?

Posted: Tuesday 29 January 2019 23:29
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%

Re: Dimmer sometimes not switched on after dimTo command?

Posted: Wednesday 30 January 2019 0:24
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.

Re: Dimmer sometimes not switched on after dimTo command?

Posted: Wednesday 30 January 2019 23:55
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.

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

Posted: Thursday 31 January 2019 0:41
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.