This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Astronomical clock
#19
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:
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)
Reply


Messages In This Thread
Astronomical clock - by josep - 13.12.2016, 19:01
RE: Astronomical clock - by admin - 13.12.2016, 19:39
RE: Astronomical clock - by Jørn - 13.12.2016, 20:28
RE: Astronomical clock - by Jørn - 13.12.2016, 21:48
RE: Astronomical clock - by davidchispas - 19.07.2021, 08:34
RE: Astronomical clock - by Domoticatorino - 17.11.2022, 09:50
RE: Astronomical clock - by Mihail - 06.03.2017, 18:06
RE: Astronomical clock - by admin - 07.03.2017, 11:43
RE: Astronomical clock - by tuxtof - 08.03.2017, 21:07
RE: Astronomical clock - by buuuudzik - 07.03.2017, 12:07
RE: Astronomical clock - by admin - 09.03.2017, 07:10
RE: Astronomical clock - by admin - 19.07.2021, 09:13
RE: Astronomical clock - by davidchispas - 19.07.2021, 10:03
RE: Astronomical clock - by admin - 19.07.2021, 10:09
RE: Astronomical clock - by davidchispas - 19.07.2021, 10:25
RE: Astronomical clock - by admin - 19.07.2021, 10:29
RE: Astronomical clock - by asgeirsb - 30.06.2022, 13:24
RE: Astronomical clock - by asgeirsb - 01.07.2022, 06:55
RE: Astronomical clock - by asgeirsb - 01.07.2022, 10:03
RE: Astronomical clock - by admin - 30.06.2022, 14:42
RE: Astronomical clock - by asgeirsb - 04.09.2022, 16:08
RE: Astronomical clock - by admin - 05.09.2022, 06:12

Forum Jump: