is there a way to check the timerqueue ?, like for exampe: device.switchOff().afterHour(24)
Timers sometimes dont work, perhaps after update or reboot system? or a mistake
Where are these events stored? Is there a table where i can check this timer?
For the time being:
I try to store the timers manually in a text field so i have my own timer log in dashticz..
Next script seems to work ok when i add 1 thing i dont now how to do...:
a) log execute date/time, see !!!! execute date time in the script for the exact place (this date/time = dz.time.rawTime + Durtimer
Code: Select all
return {
on = {devices = {'hetregent','voordeurbel','tuindeurbel','voice_vorstalarm','voice_wasmachine','regensensor'}},
logging = { level = domoticz.LOG_ERROR ,
marker = "Voices en bellen"},
execute = function(dz, device, info)
local switch0 = dz.devices('timerlog')
local switch1 = dz.devices('hetregent')
local switch2 = dz.devices('regensensor')
local Durtimer= 10 -- default secondes
local Durtimer_regen = 30 -- 24 uren = 86400 seconden
if device.state == 'On' then
if device.name == 'hetregent' or device.name == 'regensensor' then
Durtimer = Durtimer_regen
end
timertekst = dz.time.rawDate .. ' ' .. dz.time.rawTime .. ' : ' .. device.name .. ' wordt na: ' .. tostring(Durtimer) .. ' seconden uitgezet, om: ' .. 'execute date time!!!!!!!' .. '<br>' .. dz.devices('timerlog').text
device.switchOff().afterSec(Durtimer)
elseif device.state == 'Off' then
timertekst = dz.time.rawDate .. ' ' .. dz.time.rawTime .. ' : ' .. device.name .. ' is uitgezet en queue is geleegd' .. '<br>' .. dz.devices('timerlog').text
device.cancelQueuedCommands()
end
switch0.updateText(timertekst)
dz.log(timertekst, dz.LOG_DEBUG)
end
}