Timer - OnTime Everyday

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Melbourne
Posts: 4
Joined: Wednesday 07 January 2015 21:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: FR
Contact:

Timer - OnTime Everyday

Post 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 426 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 426 times
Thanks for your help
Raspberry Pi Model B Rev 2, running Raspbian Buster
Domoticz Version: 2021.1 release (build 13191)
Build Hash: 8547c5b7e
Compile Date: 2021-04-17 17:29:11
dzVents Version: 3.1.7
Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
User avatar
waltervl
Posts: 5908
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Timer - OnTime Everyday

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Melbourne
Posts: 4
Joined: Wednesday 07 January 2015 21:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: FR
Contact:

Re: Timer - OnTime Everyday

Post 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.
Raspberry Pi Model B Rev 2, running Raspbian Buster
Domoticz Version: 2021.1 release (build 13191)
Build Hash: 8547c5b7e
Compile Date: 2021-04-17 17:29:11
dzVents Version: 3.1.7
Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
User avatar
waltervl
Posts: 5908
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Timer - OnTime Everyday

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Melbourne
Posts: 4
Joined: Wednesday 07 January 2015 21:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: FR
Contact:

Re: Timer - OnTime Everyday

Post 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 ?
Raspberry Pi Model B Rev 2, running Raspbian Buster
Domoticz Version: 2021.1 release (build 13191)
Build Hash: 8547c5b7e
Compile Date: 2021-04-17 17:29:11
dzVents Version: 3.1.7
Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
User avatar
waltervl
Posts: 5908
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Timer - OnTime Everyday

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer - OnTime Everyday

Post 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)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Melbourne
Posts: 4
Joined: Wednesday 07 January 2015 21:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: FR
Contact:

Re: Timer - OnTime Everyday

Post 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" ?
----------------------------------------------------------------------
Raspberry Pi Model B Rev 2, running Raspbian Buster
Domoticz Version: 2021.1 release (build 13191)
Build Hash: 8547c5b7e
Compile Date: 2021-04-17 17:29:11
dzVents Version: 3.1.7
Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer - OnTime Everyday

Post 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 385 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waltervl
Posts: 5908
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Timer - OnTime Everyday

Post 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)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest