Hi, i´m on oh 2.4 snapshot #1336, but this problem is since a long time:
My rollershutter/blinds should open in the morning, when astro binding sends a command:
// Rollos morgens Astro hoch
rule "Rollos Astro hoch"
when
Channel 'astro:sun:home-offset:rise#event' triggered START
then
Rollos_is_day.sendCommand(ON)
...
This works most of the time. But maybe 1 or 2 days in the week, this doesn´t work. So i implemented this into a rule:
...
else if (Rollos_is_day.state != ON) {
if (now.isAfter((Rollos_up_time.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)) {
logInfo("Rollosteuerung", "--- 2 --- Achtung !!! - Fehler --- Rollos hätten jetzt hochfahren müssen --- Rollos Auffahrzeit bereits erreicht: " + Rollos_up_time.state)
Rollos_is_day.sendCommand(ON)
...
So when the first rule is not working, i get an information to the logfile and the second rule opens the blinds. This is working without problems.
But it would be better, when i don´t have to use a helper rule to eliminate an error of openhab/astro-binding. So in my case, astro binding is not usable standalone, when i can´t be sure this will fire a rule.
Sometimes it works a day, then the next days it doesn´t work and the day after that it works again - even without service restart.
Sometimes i make a openhab serive restart, then it will work the next day again, but sometimes this doen´t help and it will not work again on the next day.
could you please elaborate a bit more about which roller shutters you are using, how you are communicating with them (Z-Wave, RFX, …) so we can figure out where the root cause of your problem is. I have similar rules to yours and I never have problems, except for some rollershutter that is just at the edge of the range of my RFX controller so the radio signal does not arrive there always.
I have wired rollershutters with knx actuators. This works 100%.
The problem is not triggering or not seeing the trigger “sunrise start”.
I have a proxy switch between, and this switch is not switched to on --> so i can totally exclude the wiring side of my shutters.
Switch Rollos_is_day is my proxy item. When this switch changes to on, another rule sends the driving commands to the shutters. When i manually switch it to on, then it works. And in the cases, the astro-rule isn´t working, the switch is still off, when it is day outside already.
// Rollos morgens Astro hoch - wenn nach xx Uhr
rule "Rollos Astro hoch"
when
Channel 'astro:sun:home-offset:rise#event' triggered START
then
Rollos_is_day.sendCommand(ON)
Thread::sleep(500) // give persistence time to catch up
logInfo("Rollosteuerung", "morgens vor oder nach 6:45 SunriseLimit: " + SunriseLimit.state + " Rollos is day: " + Rollos_is_day.state)
if (SunriseLimit.state == ON) {
Rollos_Nachtstellung.sendCommand(OFF)
}
end
Every day i get a logInfo at the time of the sunrise.
But today there was no such logInfo. Today i got the error again. Yesterday i got the logInfo at about 6 a.m. and the rollershutters opened like they should do.
I can add another logInfo as first command in the rule, but i think, this wouldn´t tell us anything new…
(I have added a thread:sleep. Without this, i get the old switch state of Rollo_is_day in my logInfo. With this Thread::sleep, i get the new state (ON) in the logInfo.)
Around midnight (for me about 30 seconds after) in your Rules do you see log statements that say “Scheduled Astro event-jobs for thing astro:sun:home-offset”? Particularly do you see these on the nights before the Rule doesn’t trigger?
Did this start recently or has it been a problem for a long time?
Do you have any DateTime Item’s linked to this Thing? Do you see in events.log that these Items are updated around midnight on the days where the Rule fails to trigger?
I have a datetime item with the same event, see my post above.
When the trigger at sunrise fails, then my helper-rule will do the job with comparing now to this datetime. This works everytime, when the first rule failed.
This happens every now and then since a long time. Sometimes 1 time in a month, sometimes 2 times a week.
You are right:
Today the rule failed, i only got this at midnight:
OK, this does point to a problem with the Astro binding. Please file an issue. Astro lives over on the Eclipse Smarthome project so file the issue here. Search first to make sure someone hasn’t already filed an issue.
The specific issue is that sometimes the event doesn’t get scheduled for all your Astro Things.
Do you happen to have any old logs around you could use to maybe figure out when it started to become a problem, or is this a relatively new Thing and you are just noticing this problem now?
It will help the devs figure out what may have changed to know when the problem started.
I can think of several work arounds but you already have a good one so I wouldn’t worry too much about alternatives.
The 3rd astro thing is exactly like the other two, only another name and a location with 2 degrees difference to my place.
Working most of the time. It worked the last 2 weeks very good. But today i got a entry in my log (i have some logging to check this), that it has not worked.
You can write a Rule to touch the .items file and I think that will cause Astro to reschedule the events. If not you could define your Astro Things in a .things file and touch that which I know will cause the events to be rescheduled.
You can create your own Timers based on the Astro Action and use a System started/cron triggered Rule to create your own Timers instead of relying on Astro.
Those are the only ideas I have beyond restarting the binding.