https://www.domoticz.com/wiki/User_variables
It has a nice description on how to fill user variables that you can use in domoticz.
And it uses this nice function:
Code: Select all
function WhichSeason()
local tNow = os.date("*t")
local dayofyear = tNow.yday
local season
if (dayofyear >= 79) and (dayofyear < 172) then season = "Spring"
elseif (dayofyear >= 172) and (dayofyear < 266) then season = "Summer"
elseif (dayofyear >= 266) and (dayofyear < 355) then season = "Autumn"
else season = "Winter"
end
return season
end