Sunset and sunrise times in DomoticzEvents
Posted: Monday 25 March 2019 23:01
Hello all!
Assigning the code below to a Device event
gives the following log result
Given the names
DomoticzEvents.sunset_in_minutes
DomoticzEvents.sunrise_in_minutes
I expected a minute count from now to when the next sunset or sunrise occurs, but the values seems to have 00:00:00 as a refrence. Is this intended or a bug that might be fixed at some time?
I also wonder what values to expect when the sun do not set nor rise for several days (for example north sweden)?
Assigning the code below to a Device event
Code: Select all
import DomoticzEvents
print ("This will only show up in the shell where you start domoticz");
DomoticzEvents.Log("Hi Domoticz! Hello world")
DomoticzEvents.Log("Minutes until sun sets: " + str(DomoticzEvents.sunset_in_minutes))
DomoticzEvents.Log("Minutes until sun rises: " + str(DomoticzEvents.sunrise_in_minutes))
...
Code: Select all
2019-03-25 18:45:01.914 (vrd_rpi_rfxtrx433) Lighting 2 (framsida_takfot_ljus)
2019-03-25 18:45:01.916 Hi Domoticz! Hello world
2019-03-25 18:45:01.917 Minutes until sun sets: 1115
2019-03-25 18:45:01.917 Minutes until sun rises: 359
2019-03-25 18:45:01.917 The device that got changed is: framsida_takfot_ljus
2019-03-25 18:45:01.917 device framsida_takfot_ljus is On
2019-03-25 18:45:01.866 Status: Schedule item started! Name: framsida_takfot_ljus, Type: After Sunset, DevID: 1, Time: 2019-03-25 18:45:01
2019-03-25 21:53:41.778 Status: Incoming connection from: 192.168.1.70
2019-03-25 21:58:01.413 (vrd_rpi_rfxtrx433) Lighting 2 (framsida_takfot_ljus)
2019-03-25 21:58:01.417 Hi Domoticz! Hello world
2019-03-25 21:58:01.418 Minutes until sun sets: 1115
2019-03-25 21:58:01.418 Minutes until sun rises: 359
2019-03-25 21:58:01.418 The device that got changed is: framsida_takfot_ljus
2019-03-25 21:58:01.418 device framsida_takfot_ljus is Off
2019-03-25 21:58:01.369 Status: Schedule item started! Name: framsida_takfot_ljus, Type: On Time, DevID: 1, Time: 2019-03-25 21:58:01
DomoticzEvents.sunset_in_minutes
DomoticzEvents.sunrise_in_minutes
I expected a minute count from now to when the next sunset or sunrise occurs, but the values seems to have 00:00:00 as a refrence. Is this intended or a bug that might be fixed at some time?
I also wonder what values to expect when the sun do not set nor rise for several days (for example north sweden)?