Page 1 of 1

How does dzvents handle a reptitive switch command

Posted: Thursday 01 February 2024 22:42
by Tukker
Just out of curiosity.
How does dzvents handle reptitive calls, let's say every 10 minutes.
In the following code the 'if' will be handled 6 times.
Will there be a six (twelve) times switch command in memory or will the timed switch commands be overwritten every 10 minutes.

Code: Select all

            if (current_time > '23:00') then
              domoticz.devices('myswitch').switchOn('at 23:01')
              domoticz.devices('myswitch').switchOff('at 06:59')
            end
I know, the correct code should be:

Code: Select all

            if (current_time == '23:00') then
              domoticz.devices('myswitch').switchOn('at 23:01')
              domoticz.devices('myswitch').switchOff('at 06:59')
            end
Nevertheless there is this curiosity.

Re: How does dzvents handle a reptitive switch command

Posted: Friday 02 February 2024 11:22
by willemd
Not an answer to your curiosity I know, but I would test for the status of the switch before sending the switch commands. Then you are sure the command is only issued once, whether you use > or ==