Code: Select all
timer = {
'at 7:00 on mon,tue,wed,thu,fri',
'at 20:00 on mon,tue,wed,thu,fri,sat,sun',
}
A workaround could be that I create 2 different scripts but would like to not do that.
Moderator: leecollings
Code: Select all
timer = {
'at 7:00 on mon,tue,wed,thu,fri',
'at 20:00 on mon,tue,wed,thu,fri,sat,sun',
}
AhaRagdag wrote: Tuesday 16 November 2021 7:49
Basically it comes down to I want to do X at 7:00 and want do do Y at 20:00.
So is there a way I can use it in an if statement
Perhaps you can do a search on the forum....trigger: the timer rule that triggered the script if the script was called due to a timer event, or the security state that triggered the security trigger rule. See below for the possible timer trigger rules.
.trigger: . string. the timer rule, the security state, the customEvent or the http response callback string that actually triggered your script. E.g. if you have multiple timer rules can inspect trigger which exact timer rule was fired.
Code: Select all
return {
on = {
timer = {
'at 09:30', -- specific time
'at 09:31', -- specific time
}
},
logging = {
level = domoticz.LOG_DEBUG,
marker = 'template',
},
execute = function(domoticz, timer)
domoticz.log('Timer event was triggered by ' .. timer.trigger, domoticz.LOG_DEBUG)
end
}
Code: Select all
2021-11-16 09:30:03.722 Status: dzVents: Info: template: ------ Start internal script: Script #1:, trigger: "at 09:30"
2021-11-16 09:30:03.724 Status: dzVents: Info: template: Timer event was triggered by at 09:30
2021-11-16 09:30:03.729 Status: dzVents: Info: template: ------ Finished Script #1
2021-11-16 09:30:03.731 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
Users browsing this forum: Google [Bot] and 1 guest