So i need the seconds between sunset and midnight
I tried the code below. I got stuck with the Time property. I do not know where to go or which function to use.
SunsetToMidnight is a uservariable
Code: Select all
return {
active = true,
on = {
timer = {'60 minutes before sunset'}
},
execute = function(domoticz,dummy)
local Time = require('Time')
local tA = Time('00:00:00')
local tB = Time('sunset')
print(tB.compare(tA).secs)
domoticz.variables('SunsetToMidnight').set(2378)
end
}