Page 1 of 1

Timer - OnTime Everyday

Posted: Friday 30 April 2021 16:35
by Melbourne
Hi,

I've configured a switch to launch a script with On Action/Off Action.
Manually all is working fine: commands are sent and the switch goes On or Off
  • SwitchConfig.png
    SwitchConfig.png (42.99 KiB) Viewed 424 times

If I configure 'Timers' in the next minutes, to execute a command On or Off, nothing happen.
What I'm doing wrong ?
What can I check ?
  • SwitchTimer.png
    SwitchTimer.png (75.38 KiB) Viewed 424 times
Thanks for your help

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 18:50
by waltervl
To be sure: Manually you mean that you manually switch the domoticz device On/Off and the scripts are run by Domoticz?

Do you see in the domoticz log file that the script is executed? Also with the timer activation? Like below

2021-04-30 18:44:01.743 Status: Executing script: /home/udoox86/domoticz/scripts/nefit-openhaard-uit.sh

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 19:04
by Melbourne
Hi Waltervl,
To be sure: Manually you mean that you manually switch the domoticz device On/Off and the scripts are run by Domoticz?
--> Yes
Do you see in the domoticz log file that the script is executed? Also with the timer activation? Like below
2021-04-30 18:44:01.743 Status: Executing script: /home/udoox86/domoticz/scripts/nefit-openhaard-uit.sh
Here are the log when I manually switch the domoticz device, device is On initially:
  • 2021-04-30 18:57:36.162 Virtual: Light/Switch (Prise 1)
    2021-04-30 18:57:36.140 Status: User: Admin (IP: 192.168.0.27) initiated a switch command (8/Prise 1/Off)
    2021-04-30 18:57:36.383 Status: Executing script: /home/pi/Chacon/Prise1Off.sh
    2021-04-30 18:57:38.379 Virtual: Light/Switch (Prise 1)
    2021-04-30 18:57:38.341 Status: User: Admin (IP: 192.168.0.27) initiated a switch command (8/Prise 1/On)
    2021-04-30 18:57:38.579 Status: Executing script: /home/pi/Chacon/Prise1On.sh

Nothing appears in the logs when the trigger time (On or Off) is reached.

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 19:38
by waltervl
So it looks like the timer function is not working at all.
Is the eventsystem enabled? Menu setup settings tab other:
https://www.domoticz.com/wiki/Applicati ... Scripts.29

I am not sure it is related but I cannot think of another reason why timers are not working.

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 20:30
by Melbourne
Yes EventSystem is enabled.

I've made more tests...

I've modified Timer On value to be executed after a system restart.
Restarted system and wait Timer On value to be reached.

Then, script executed:
2021-04-30 20:21:01.578 Status: Schedule item started! Name: Prise 1, Type: On Time, DevID: 8, Time: 2021-04-30 20:21:01
2021-04-30 20:21:01.806 Status: Executing script: /home/pi/Chacon/Prise1On.sh


Into the logs just after restart, I can see:
  • 2021-04-30 20:19:44.581 Status: NotificationSystem: thread started...
    2021-04-30 20:19:44.593 Status: EventSystem: reset all events...
    2021-04-30 20:19:44.632 Status: EventSystem: reset all device statuses...

    2021-04-30 20:19:45.334 Status: Python EventSystem: Initalizing event module.
    2021-04-30 20:19:45.349 Status: EventSystem: Started
    2021-04-30 20:19:45.349 Status: EventSystem: Queue thread started...
It seems that EventSystem is initialized/updated only on startup and not after a timer modification.
Then a timer modification is not taken into account while EventSystem is not restarted.

What do you think ?

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 21:24
by waltervl
This looks indeed an issue. I believe that every night at 24.00 hrs the event system is reset.

I did a test too for checking your issue and for me the timer was triggered just after the change so your conclusion is not always true. But I also noticed that only the off action was triggered and not the Off.

But perhaps someone will react that has more knowledge about the event system and timer functions.

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 22:19
by waaren
waltervl wrote: Friday 30 April 2021 21:24 But perhaps someone will react that has more knowledge about the event system and timer functions.
@waltervl @melbourne,

from your profiles it looks like you are on different builds.

The issue is not so much on the eventsystem itself but an added or updated timer will only become active after a reset of all device statuses...
or after some minutes. So if I add a timer for 22:14 at 22:13:02 it will not be picked up the next minute but a timer for 22:14 entered at 22:11:30 will be picked up at 22:14.
You can force a reset of all device statuses in many ways. An easy way is to add or delete a char from the description in the device edit window.

I tested this on the current latest build (13241)

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 23:25
by Melbourne
Thanks Waaren and Waltervl for your test and informations.

@Waaren
The issue is not so much on the eventsystem itself but an added or updated timer will only become active after a reset of all device statuses...
or after some minutes. So if I add a timer for 22:14 at 22:13:02 it will not be picked up the next minute but a timer for 22:14 entered at 22:11:30 will be picked up at 22:14.
You can force a reset of all device statuses in many ways. An easy way is to add or delete a char from the description in the device edit window.
I agree with your tests.

I expected an "Event reset" after switch timer update/modification and not only after modification in the device edit window.

-> Maybe an evolution request to trig an "Event reset" after switch timer update/modification and/or that will be take into account after some minutes ?


----------------------------------------------------------------------
I tested this on the current latest build (13241)
How/Where to check "build" ?
----------------------------------------------------------------------

Re: Timer - OnTime Everyday

Posted: Friday 30 April 2021 23:46
by waaren
Melbourne wrote: Friday 30 April 2021 23:25 How/Where to check "build" ?
At about every tab at the GUI. If you only see2021.1, you are on the release (build 13191)
build.png
build.png (16.01 KiB) Viewed 383 times

Re: Timer - OnTime Everyday

Posted: Saturday 01 May 2021 0:01
by waltervl
Melbourne wrote: Friday 30 April 2021 23:25
I agree with your tests.

I expected an "Event reset" after switch timer update/modification and not only after modification in the device edit window.
That would indeed be the most user friendly way that a timer edit on a device also triggers a device status reset.

PS I edited my profile, I was already on latest stable (still not understand why beta is not called 2021.2 build xxxxx or 2022.1 build xxxx)