How to display sunrise/sunset times on NAC/SHAC system

Create sunrise and sunset userparameter


Object will display the actual value
Resident Script

Visualization page

Add parameter sunrise/sunset in Visualization


Display
:Note: make sure your regional settings are correct and for specific times to add Latt and Long settings??
Sunset/Sunrise requires change the latitude and longitude,
– eg Adelaide latitude and longitude
latitude = -34.929
longitude = 138.601
sunrise, sunset = rscalc(latitude, longitude)
-- sunset and sunrise variable
sunrise = string.format('%d:%.2d', math.floor(sunrise / 60), sunrise % 60)
sunset = string.format('%d:%.2d', math.floor(sunset / 60), sunset % 60)