I have a sunrise & sunset rules in OH2. What I’ve notice is after a few days of uptime the global variables are not updating in the rules. I’m using Astro plugin and can see where it’s updating date values @ midnight:
2016-05-22 00:00:00.110 [INFO ] [marthome.event.ItemStateChangedEvent] - astro_sun_local_rise_end changed from 2016-05-21T05:45:00.000-0600 to 2016-05-22T05:44:00.000-0600
Now in my rule I define my sunrise time as:
var DateTime SunRiseTime = new DateTime((astro_sun_local_rise_end.state as DateTimeType).calendar.timeInMillis)
And in my rule I log the result: logInfo (“Sunrise”, "Sunrise Time = " + SunRiseTime)
Which gives me this value:
2016-05-22 04:00:00.036 [INFO ] [lipse.smarthome.model.script.Sunrise] - Sunrise Time = 2016-05-20T05:45:00.000-06:00
So clearly the SunRiseTime hasn’t updated it’s value in the last two days. If I restart the OH2 service everything runs fine for a few days until this happens again.
Any thoughts / add’l debugging I can do to help pinpoint the issue?