Page 1 of 1
Problem with timer since 2021.1 update
Posted: Saturday 08 May 2021 18:57
by dlube
Not sure that it's a dzvents problem...
At 00:30, depending on the water temperature I set the timer (API Json) of the switch (enocean) of the pump.
The steps are these ones:
- Clear the timer
- Add timer to start the pump
- Add timer to stop the pump
Before the last update of Domoticz my script was working fine.
Today, sometimes it works and sometimes I have only the timer to stop the pump or nothing.
There is nothing in the logs which show something wrong.
Do you have any idea of the source of the problem?
Re: Problem with timer since 2021.1 update
Posted: Saturday 08 May 2021 23:41
by waaren
dlube wrote: ↑Saturday 08 May 2021 18:57
Before the last update of Domoticz my script was working fine.
You refer to a possible problem in a dzVents script. To understand what could be the issue it would be helpful to see the script.
Re: Problem with timer since 2021.1 update
Posted: Tuesday 11 May 2021 9:52
by dlube
This simple script does not work all the time.
Code: Select all
domoticz.openURL({url = domoticz.settings['url']..'/json.htm?type=command¶m=cleartimers&idx=001})
domoticz.openURL({url = domoticz.settings['url']..'/json.htm?type=command¶m=addtimer&idx=001&active=true&timertype=3&hour=6&min=0&randomness=false&command=0&days=1234567'})
domoticz.openURL({url = domoticz.settings['url']..'/json.htm?type=command¶m=addtimer&idx=001&active=true&timertype=3&hour=0&min=0&randomness=false&command=1&days=1234567'})
I have the feeling that each openURL are not done in this order.
Sometimes I have both timer 'On and 'Off', sometimes only the 'Off' and sometimes nothing.
However, the log file looks correct.
I'm currently testing a callback in the clearTimer URL and to execute 'On' and 'Off' settings in the HttpResponse.
Re: Problem with timer since 2021.1 update [Solved]
Posted: Tuesday 11 May 2021 11:16
by waaren
dlube wrote: ↑Tuesday 11 May 2021 9:52
This simple script does not work all the time.
I have the feeling that each openURL are not done in this order.
The order in which commands from Lua / dzVents script will be executed is not guaranteed.
Also: domoticz.openURL() commands are in recent versions executed in separate threads, making the execution order even more unpredictable.
What you could do to improve the predictability is using the .afterSec() option.
e.g.
Code: Select all
domoticz.openURL(domoticz.settings['url']..'/json.htm?type=command¶m=cleartimers&idx=001')
domoticz.openURL(url = domoticz.settings['url']..'/json.htm?type=command¶m=addtimer&idx=001&active=true&timertype=3&hour=6&min=0&randomness=false&command=0&days=1234567').afterSec(2)
domoticz.openURL(url = domoticz.settings['url']..'/json.htm?type=command¶m=addtimer&idx=001&active=true&timertype=3&hour=0&min=0&randomness=false&command=1&days=1234567').afterSec(4)
Re: Problem with timer since 2021.1 update
Posted: Tuesday 11 May 2021 11:38
by dlube
It's important that the cleartimer is executed first.
This is the reason why I added a callBack which seems working fine.
Thank you