Code: Select all
function IsDark()
local dark
if (domoticz.time.isNightTime ) then
dark = "True"
else
dark = "False"
end
return dark
end
Here(Netherlands) is night and the current script constantly returns; dark = False
Then I tested the same script but then with isDayTime and then it returns; dark = True
Added 2 notifies;
Code: Select all
function IsDark()
local dark
domoticz.notify("isNightTime: "..tostring(domoticz.time.isNightTime))
domoticz.notify("isDayTime: "..tostring(domoticz.time.isDayTime))
if (domoticz.time.isNightTime ) then
dark = "True"
else
dark = "False"
end
return dark
end