rule "Licht Voordeur aan"
when
// Item Sunset_Event received command ON
Item Sunrise_Event received command ON
then
// sendCommand(Wandlampen Buiten, ON)
sendCommand(Licht_BG_BV, ON)
end
I see in de logs that the rule is loaded but does not fire the lights.
Most likely I have made a mistake somewhere.
That is what I have, and it works. Also, make sure you set the proper lat/long for the astro binding in the main .cfg file. If you see entries in your log file showing startup of the astro binding with your lat/long, you’ll know it’s being loaded correctly.
P.S. In my items file, I added an “offset=30” to the astro binding’s Sunset_Event, you can do this too to adjust the actual time the event fires and lights turn on, until it’s actually a bit darker.
I have changed the rule as you (@Bartus) stated but it is not working.
rule "Licht Voordeur aan"
when
// Item Sunset_Event received command ON
Item Sunrise_Event received update ON
then
// sendCommand(Wandlampen Buiten, ON)
sendCommand(Licht_BG_BV, ON)
end
In the debug log I see:
- Scheduled job with name Sunset_Event at 2015-09-05 18:08:00
I have used an offset of 10 minutes. I know that the sunset time is not correct in my debug setting but that should not make a difference.
Nowhere in the debug log I see the rule being executed.
Also nowhere I see that the sunset is switched to on.
Any ideas?
Actually I do trigger on Sunset. First I tried to trigger on Sunrise but then found out that with an off-set it also should work with Sunset.
In the log was something written that job was cancelled because of time is in the past.
Your rule code above has your sunset item commented out and sunrise not commented out, so it’s confusing. What is the actual rule code that’s not triggering?
The issue was because of the time difference with local time. So I was confused that the rule was not triggered. Now I changed the rule for item line for testing to :
I have similar problems with triggering my rollershutters.
Sunrise works, but Sunset doesn’t:
What’s weird is that the Event is extremely short (events.log).
2016-01-06 16:17:00 - Weather_Sunset_Event state updated to ON
2016-01-06 16:17:00 - Weather_Sunset_Event state updated to OFF
So I guess the rule does not recognize the event:
rule "Night has broken"
when
Item Weather_Sunset_Event received update ON
then
sendTelegram("OH_TeleBot", "Rollladen:\nSunset Event triggered")
Rollladen_Balkon.sendCommand(DOWN)
end
That looks OK to me - do you get any entries in the openhab.log when these fire? I would expect to see your “Rollladen:\nSunset Event triggered” entry. If so, you’re successfully entering the rule, and your problem may be with the actual Rollershutter command.
The rollershutter works fine, when manually triggered (separate debug trigger switch item).
So I think it’s the very short duration of the Sunset_Event (in the log it switches OFF again in the same second).
It would be great if I could set the duration of the Sunset_event to let’s say 10 seconds.
So an additional “duration” parameter would be helpful.
Do you use this event? is it also just less than a second log active?
@NCO - Yes, I use the astro binding to turn my outdoor lights on and off at sunset/sunrise. and I also see that my sunset event only lasts 1 second (even 0 seconds) in the events log. I think that is why you have to use the “end” property for your application, otherwise the event may not be long enough to allow the command to fire.
Doesn’t end mean, that the switch is triggered when the sunset ends (sun is gone) instead of the sun starting to descent!? So the duration should be the same!?
If you bind it to a Switch, a event is scheduled and the state of the
Switch is updated to ''ON'', immediately followed by a ''OFF'' at the
calculated time.
2016-01-21 19:55:00 - Night_start state updated to ON
2016-01-21 19:55:00 - Night_start state updated to OFF
2016-01-22 19:56:00 - Night_start state updated to ON
2016-01-22 19:56:00 - Night_start state updated to OFF