All, I looked through a few searches in the forum and I think I have my programming correct however my sunrise / sunset did not trigger.
Items:
DateTime Sunrise_Time “Sunrise [%1$tH:%1$tM]” { channel = “astro:sun:home:rise#start” }
Any idea’s ?, I tried to look in my log however for some reason it doesn’t go back to yesterday or even this morning (only shows a few hours) when it should have triggered, any idea on that as well ?.
As for the log, I think it only fills in data when the screen is open, is there any way to get the past history (haven’t searched this yet so I may end up finding it).
Did this change recently? I did not find anything in the docs, unfortunately.
As this is asked very often it is important
From what I know from the past: the start and end triggers are for displaying the astro time, for example on the sitemap and the event is the channel trigger.
I did a quick test and only the event channel got triggered:
rule "test astro channel trigger event"
when
Channel 'astro:sun:wss3:set#event' triggered START
then
logInfo("EXTRA", "Test astro event set channel")
end
rule "test astro channel trigger start"
when
Channel 'astro:sun:wss3:set#start' triggered START
then
logInfo("EXTRA", "Test astro start set channel")
end
The log:
2021-01-02 16:20:00.141 [INFO ] [org.openhab.core.model.script.EXTRA ] - Test astro event set channel
2021-01-03 16:21:00.007 [INFO ] [org.openhab.core.model.script.EXTRA ] - Test astro event set channel
All thoughts on how to keep a light on if it’s dark (between civil dusk and civil dawn), for instance if someone manually turns the light off it automatically comes back on
What I did is set up a virtual switch I call “IsItDark”. i use astro rules to turn the switch on when it is dark & off otherwise. If on a site map you can also enable the switch manually for testing your rules.
The other rules just need to check the status if that switch to know if it is dark. I got the idea from this forum years ago.
Item
Switch IsItDark <moon>
Rules
rule "Sunset"
when
Channel 'astro:sun:local:civilDusk#event' triggered START
then
IsItDark.postUpdate(ON)
end
rule "Sunrise"
when
Channel 'astro:sun:local:civilDawn#event' triggered START
then
IsItDark.postUpdate(OFF)
end
Finally got around to this and I have it working to the point where if it’s dark it comes on (thank you for the tip about adding a switch for testing, this was helpful). How do I get the lights to come back on should someone turn it off and it’s still dark
Rule:
rule “keep outside lights on if dark”
when
Item IsItDark received update
then
if (Light_GF_Front_Outside.state == OFF)
Light_GF_Front_Outside.sendCommand(ON)
end