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?
Problem with timer since 2021.1 update [Solved]
Moderator: leecollings
Problem with timer since 2021.1 update
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Problem with timer since 2021.1 update
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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Problem with timer since 2021.1 update
This simple script does not work all the time.
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.
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.
Last edited by dlube on Tuesday 11 May 2021 11:34, edited 1 time in total.
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Problem with timer since 2021.1 update [Solved]
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)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Problem with timer since 2021.1 update
It's important that the cleartimer is executed first.
This is the reason why I added a callBack which seems working fine.
Thank you
This is the reason why I added a callBack which seems working fine.
Thank you
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
Who is online
Users browsing this forum: No registered users and 1 guest