every 3 hours

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
geertvercamer
Posts: 84
Joined: Friday 12 May 2017 20:03
Target OS: -
Domoticz version:
Contact:

every 3 hours

Post by geertvercamer »

Hi all,

I have a timer defined like this:

Code: Select all

    every 3 hours between 05:55 and 16:00
I expect this to happen at 05:55 08:55 11:55 14:55.

and another one:

Code: Select all

    every 2 hours between 08:50 and 18:00
I expect this to happen at 08:50 11:50 14:50 15:50 17:50.

They both triggered at 12:00.

So 'every hour' means 'on the hour'?
Should I use 'every 180 minutes' then?

Thanks.

KR


Geert
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: every 3 hours

Post by waaren »

geertvercamer wrote: Thursday 28 January 2021 12:09 I expect this to happen at 05:55 08:55 11:55 14:55.
I expect this to happen at 08:50 11:50 14:50 15:50 17:50.

So 'every hour' means 'on the hour'?
Yes
Should I use 'every 180 minutes' then?
No.

From the wiki:
"Another important issue: the way it is implemented right now, the every xx minutes and every xx hours is a bit limited. The interval resets at every *:00 (for minutes) or 00:* for hours. You need an interval that is an integer divider of 60 (or 24 for the hours). So you can do every 1, 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30 minutes only."


To have the scripts triggered at the times you intended, you can code it like:

Code: Select all

'at 5:55','at 8:55', 'at 11:55', 'at 14:55' -- for the first one ( every 3rd hour starting at 5:55) 
'at 8:50', 'at 10:50', 'at 12:50', 'at 14:50', 'at 16:50' -- for the second one ( every 2nd hour starting at 8:50)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
geertvercamer
Posts: 84
Joined: Friday 12 May 2017 20:03
Target OS: -
Domoticz version:
Contact:

Re: every 3 hours

Post by geertvercamer »

Missed the 'reset'.

Thanks, waaren!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest