Time scheduled feature
Posted: Sunday 10 May 2020 15:10
Is anybody missing on timers do something every 10 /second/minutes/hours/week...and etc.?
Code: Select all
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
-- (0 > xx < 60)
'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
-- hours (0 > xx < 24)
'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 then 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 info from Domoticz
'at sunrise',
'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' -- guess ;-)
'between aa and bb' -- aa/bb can be a time stamp like 15:44
-- aa/bb can be sunrise/sunset
-- aa/bb can be 'xx minutes before/after sunrise/sunset'
'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 12,44' -- in week 12 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-18/3',11/8,10/10-14/10',
'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
-- or if you want to go really wild and combine them:
'at nighttime at 21:32-05:44 every 5 minutes on sat, sun',
'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
},
}This is not how dzVents works.jarmoboy wrote: Monday 11 May 2020 14:06 If i want timer which do something for ex. every 6 hours, so when you enter scripts its automatically reseted and its starting from zero (for example you need to repair or add script which has nothing to do with this script).
as per the wiki: the number of minutes in the rule must be > 0 and < 60
every 360 minutes will generate below error'every <xx> minutes', -- starting from xx:00 triggers every xx minutes
-- (0 > xx < 60)