Les déclencheurs:
Le timer
There are several options for time triggers. It is important to know that Domoticz timer events only trigger once every minute, so one minute is the smallest interval for your timer scripts. However, dzVents gives you many options to have full control over when and how often your timer scripts are called (all times are in 24hr format and all dates in dd/mm): Keywords recognized are “at, between, every, except, in, on” ( except supported from version 3.0.16 onwards ).
on = {
timer = {
‘every minute’, — causes the script to be called every minute
‘every other minute’, — minutes: xx:00, xx:02, xx:04, …, xx:58
‘every <xx> minutes’, — starting from xx:00 triggers every xx minutes
‘every hour’, — 00:00, 01:00, …, 23:00 (24x per 24hrs)
‘every other hour’, — 00:00, 02:00, …, 22:00 (12x per 24hrs)
‘every <xx> hours’, — starting from 00:00, triggers every xx
‘at 13:45’, — specific time
‘at *:45’, — every 45th minute in the hour
‘at 15:*’, — every minute between 15:00 and 16:00
‘at 12:45-21:15’, — between 12:45 and 21:15. You cannot use ‘*’!
‘at 19:30-08:20’, — between 19:30 and 8:20 (next day)
‘at 13:45 on mon,tue’, — at 13:45 only on Mondays and Tuesdays (english)
‘on mon,tue’, — on Mondays and Tuesdays
‘every hour on sat’, — you guessed it correctly
‘at sunset’, — uses sunset/sunrise/solarnoon info from Domoticz
‘at sunrise’,
‘at solarnoon’, — <sup>3.0.11</sup>
‘at civiltwilightstart’, — uses civil twilight start/end info from Domoticz
‘at civiltwilightend’,
‘at sunset on sat,sun’,
‘xx minutes before civiltwilightstart’,
‘xx minutes after civiltwilightstart’, — Please note that these relative times
‘xx minutes before civiltwilightend’, — cannot cross dates
‘xx minutes after civiltwilightend’,
‘xx minutes before sunset’,
‘xx minutes after sunset’,
‘xx minutes before sunrise’,
‘xx minutes after sunrise’
‘xx minutes before solarnoon’, — <sup>3.0.11</sup>
‘xx minutes after solarnoon’, –<sup>3.0.11</sup>
‘between aa and bb’ — aa/bb can be a time stamp like 15:44 (if aa > bb will cross dates)
— aa/bb can be sunrise/sunset/solarnoon (‘between sunset and sunrise’ and ‘between solarnoon and sunrise’ will cross dates)
— aa/bb can be ‘xx minutes before/after sunrise/sunset/solarnoon’
‘at civildaytime’, — between civil twilight start and civil twilight end
‘at civilnighttime’, — between civil twilight end and civil twilight start
‘at nighttime’, — between sunset and sunrise
‘at daytime’, — between sunrise and sunset
‘at daytime on mon,tue’, — between sunrise and sunset only on Mondays and Tuesdays
‘in week 1-7,44’ — in week 1-7 or 44
‘in week 20-25,33-47’ — between week 20 and 25 or week 33 and 47
‘in week -12, 33-‘ — week <= 12 or week >= 33
‘every odd week’,
‘every even week’, — odd or even numbered weeks
‘on 23/11’, — on 23rd of November (dd/mm)
‘on 23/11-25/12’, — between 23/11 and 25/12
‘on 2/3-8/3,7/8,6/10-14/10’,— between march 2 and 8, on august 7 and between October 6 and 14.
‘on */2,15/*’, — every day in February or
— every 15th day of the month
‘on -3/4,4/7-‘, — before 3/4 or after 4/7
‘at 12:45-21:15 except at 18:00-18:30’, — between 12:45 and 21:15 but not between 18:00 and 18:30 ( except supported from 3.0.16 onwards )
‘at daytime except on sun’, — between sunrise and sunset but not on Sundays
— or if you want to go really wild and combine them:
‘at nighttime at 21:32-05:44 every 5 minutes on sat, sun except at 04:00’, — except supported from 3.0.16 onwards
‘every 10 minutes between 20 minutes before sunset and 30 minutes after sunrise on mon,fri,tue on 20/5-18/8’
— or just do it yourself:
function(domoticz)
— you can use domoticz.time to get the current time
— note that this function is called every minute!
— custom code that either returns true or false
— …
end
},
}
The timer events are triggered every minute. If such a trigger occurs, dzVents will scan all timer-based events and will evaluate the timer rules. So, if you have a rule on mon then the script will be executed every minute but only on Monday.
Be mindful of the logic if using multiple types of timer triggers. It may not make sense to combine a trigger for a specific or instantaneous time with a trigger for a span or sequence of times (like ‘at sunset’ with ‘every 6 minutes’) in the same construct. Similarly, ‘between aa and bb’ only makes sense with instantaneous times for aa and bb.
One important note: if Domoticz, for whatever reason, skips a timer event then you may miss the trigger! Therefore, you should build in some fail-safe checks or some redundancy if you have critical time-based stuff to control. There is nothing dzVents can do about it
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.