I’m trying to trigger an outdoor light to come on/off at sunrise / sunset. I’ve installed the openHAB2 Astro binding, and added the rules:
rule "Turn porch light off at Sunrise"
when
Channel 'astro:sun:local:rise#event' triggered START
then
logInfo("rules", "It's sunrise, I'm turning off the porch light")
sendCommand(outdoorFrontPorchLight,0)
end
rule "Turn porch light on at Sunset"
when
Channel 'astro:sun:local:set#event' triggered START
then
logInfo("rules", "It's sunset, I'm turning the porch light on")
sendCommand(outdoorFrontPorchLight,23)
end
It worked a couple times, then stopped working, I restarted openhab, it worked once more, then stopped. Any thoughts? Is there a better way to trigger this?
Which openHAB2 release are you using? (stable 2.0, 2.1 or snapshot 2.2)
From what I remember, there were some issues with the Astro binding and the scheduler but they were fixed recently.
I didn’t follow these threads closely since I don’t use the Astro channel triggers in my rules but if you search the forum for “astro +scheduler +full” you may find some relevant info (not sure if this is connected to the issue that you are experiencing… you need to check your logs for more hints)
Hey, just to add to this thread. I’m on OH2.2 and experienced the same issue. I upgraded to OH2.3 still no luck. I finally figured out that if you use the event trigger:
You can only have a single rule that uses this event. If you have multiple (like I did), only one of them get executed. Which one is not clear and seems to change randomly.
Anyone, since I’ve been struggling with this for a few days, I thought I share this tip:
Unfortunately this is not true. I’m using the same trigger channel in different rules and for another case the same trigger channel multiple times in a single rule and all are executed without any problems.
Make sure you have different rule names!
I don’t remember, 2.2. was ages ago
There have been issues with the astro binding a year ago, but those were solved. Since 2.3 and 2.4 snapshot (maybe also with 2.2. snapshot) it works without any problems.