Hey. My goal is to turn an item group ON at Civil Dusk, and OFF at Civil Dawn. The “Off at dawn” rule works, but the on at dusk does not.
I’m quite confused. I don’t believe the sunset “switch” is triggering based on the event logs. I can see no obvious reason for this. Does anything in this look wrong?
OpenHAB v1.8.3
Additional modules zwave, mqtt, insteonplm, dscalarm, exec
Item configuration
pi@raspberrypi:/etc/openhab/configurations/rules $ cat ../items/astro.items
Switch Sunrise_Event {astro="planet=sun, type=civilDawn, property=start"}
Switch Sunset_Event {astro="planet=sun, type=civilDusk, property=start"}
DateTime Sunset_Time "Sunset [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {astro="planet=sun, type=civilDusk, property=start"}
DateTime Sunrise_Time "Sunrise [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {astro="planet=sun, type=civilDawn, property=start"}
The Rule:
pi@raspberrypi:/etc/openhab/configurations/rules $ cat securityLighting.rules
rule "Security Lights Off At Dawn"
when
Item Sunrise_Event received update ON
then
sendCommand(securityLighting, OFF)
end
rule "Security Lights On at Dusk"
when
Item Sunset_Event received update ON
then
sendCommand(securityLighting, ON)
end
Log file
2017-03-14 01:XX:XX.051 [DEBUG] [.b.astro.internal.job.DailyJob] - Sun[
sunrise=Range[start=Tue Mar 14 12:XX:00 UTC 2017,end=Tue Mar 14 12:XX:00 UTC 2017]
noon=Range[start=Tue Mar 14 18:XX:00 UTC 2017,end=Tue Mar 14 18:XX:00 UTC 2017]
sunset=Range[start=Wed Mar 15 00:XX:00 UTC 2017,end=Wed Mar 15 00:XX:00 UTC 2017]
night=Range[start=Wed Mar 15 01:XX:00 UTC 2017,end=Wed Mar 15 10:XX:00 UTC 2017]
morningNight=Range[start=Tue Mar 14 01:XX:00 UTC 2017,end=Tue Mar 14 10:XX:00 UTC 2017]
astroDawn=Range[start=Tue Mar 14 10:XX:00 UTC 2017,end=Tue Mar 14 11:XX:00 UTC 2017]
nauticDawn=Range[start=Tue Mar 14 11:XX:00 UTC 2017,end=Tue Mar 14 11:XX:00 UTC 2017]
civilDawn=Range[start=Tue Mar 14 11:XX:00 UTC 2017,end=Tue Mar 14 12:XX:00 UTC 2017]
civilDusk=Range[start=Wed Mar 15 00:XX:00 UTC 2017,end=Wed Mar 15 00:XX:00 UTC 2017]
nauticDusk=Range[start=Wed Mar 15 00:XX:00 UTC 2017,end=Wed Mar 15 01:XX:00 UTC 2017]
astroDusk=Range[start=Wed Mar 15 01:XX:00 UTC 2017,end=Wed Mar 15 01:XX:00 UTC 2017]
daylight=Range[start=Tue Mar 14 12:XX:00 UTC 2017,end=Wed Mar 15 00:XX:00 UTC 2017]
eveningNight=Range[start=<null>,end=<null>]
Searching the event log for “sun * state updated”
pi@raspberrypi:/var/log/openhab $ cat *.log | grep "Sun" | grep "_Event state updated"
2017-03-13 11:XX:00 - Sunrise_Event state updated to ON
2017-03-13 11:XX:00 - Sunrise_Event state updated to OFF