19.07.2021, 10:29
For objects you can enable logging and check the time at which the write happens.
You can also use this script to log current sunrise and sunset time:
You can also use this script to log current sunrise and sunset time:
Code:
require('uci')
latitude = uci.get('genohm-scada.core.latitude')
latitude = tonumber(latitude) or 0
longitude = uci.get('genohm-scada.core.longitude')
longitude = tonumber(longitude) or 0
sunrise, sunset = rscalc(latitude, longitude)
sunrise_hour = math.floor(sunrise / 60)
sunrise_minute = sunrise % 60
sunset_hour = math.floor(sunset / 60)
sunset_minute = sunset % 60
sunrise_text = string.format('%02d:%02d', sunrise_hour, sunrise_minute)
sunset_text = string.format('%02d:%02d', sunset_hour, sunset_minute)
log('Sunrise: ' .. sunrise_text)
log('Sunset: ' .. sunset_text)