[Deprecated] Design Pattern: Time Of Day

Your search skills are better than mine. I did think this got fixed, but the behavior was exactly as rkrisi describes. Odd.

1 Like

Ooops… we may have another regression here: https://github.com/eclipse/smarthome/issues/6107

1 Like

Never thought of this, I was sure that maybe I messed up something because, prior to M6 it didn’t had any problem. However as I can see, it won’t change anytime soon (maybe if someone implements an alternate scheduler).

Ps.: So it seems that after running it for a few hours, the problem is gone and it starts working “automatically”. Really have no clue what can cause this.

The problem only occurs a few seconds after midnight. The problem is sometimes not all of your Astro Things get recalculated for the new day. When they don’t get calculated, the tests in the Rule above fail because one or more of your start times is still yesterday, not today.

But only that one or two start times will be wrong. All the rest of them will be correct. So one would expect the Rule to work when the next time period starts.

Ahh, now I understood it! Forgot that this not only gives HH:MM but a full date. (Maybe because I can only see the HH:MM in PaperUI).
Should I file an issue or it is not worth it? Others commented that this is hard to be reproduced/find the bug…

It’s probably best to go add a comment to the issue Dim posted a link to above. This is a regression (i.e. is was fixed and now is broken again) if it is caused by the same root problem.

Thanks for your help! I made a comment about this.

Hmm, it seems that not just happen after restart… it has been running for days now, it was okay a few hours ago, now when some rules didnt get executed I started looking what can cause this. It was afternoon again…
Any recommendations for a workaround?

Ps.: My bad, openHab exited itself…

Is this issue is solved in M7? I see that most of the issues are closed, but there are no merges associated with that issue?

I’m sure now that I always get this always afternoon problem at midnight…

I don’t know. If this is truly a regression then this is a problem that has been fixed but then reintroduced at some point.

But you can see that the issue that Dim linked to is still Open meaning it hasn’t been fixed.

I have been using M7 for days now, and it seems for me that the bug is gone!

3 Likes

Hi I think I am having the same problem - I’ve used the rules exactly as posted at the top of this post and I am not getting the changes from Morning to Day to Afternoon correctly. Do I need to upgrade something, I am on OH2.3 on Windows.

Thanks

2018-12-12 00:01:00.115 [vent.ItemStateChangedEvent] - vMorning_Time changed from 2018-12-11T06:00:00.000+0100 to 2018-12-12T06:00:00.000+0100
2018-12-12 00:01:00.117 [vent.ItemStateChangedEvent] - vNight_Time changed from 2018-12-11T23:00:00.000+0100 to 2018-12-12T23:00:00.000+0100
2018-12-12 00:01:00.119 [vent.ItemStateChangedEvent] - vBed_Time changed from 2018-12-11T00:00:00.000+0100 to 2018-12-12T00:00:00.000+0100
2018-12-12 00:01:00.125 [ome.event.ItemCommandEvent] - Item 'vTimeOfDay' received command BED
2018-12-12 00:01:00.126 [vent.ItemStateChangedEvent] - vTimeOfDay changed from NIGHT to BED

2018-12-12 06:00:00.123 [ome.event.ItemCommandEvent] - Item 'vTimeOfDay' received command MORNING
2018-12-12 06:00:00.137 [vent.ItemStateChangedEvent] - vTimeOfDay changed from BED to MORNING

2018-12-12 16:52:59.898 [vent.ChannelTriggeredEvent] - astro:sun:home:set#event triggered START
2018-12-12 16:52:59.898 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDusk#event triggered START
2018-12-12 16:52:59.899 [vent.ChannelTriggeredEvent] - astro:sun:minus90:set#event triggered START
2018-12-12 16:52:59.901 [vent.ChannelTriggeredEvent] - astro:sun:local:set#event triggered END
2018-12-12 16:52:59.901 [vent.ChannelTriggeredEvent] - astro:sun:home:daylight#event triggered END
2018-12-12 16:52:59.901 [vent.ChannelTriggeredEvent] - astro:sun:minus90:daylight#event triggered END
2018-12-12 16:53:00.009 [ome.event.ItemCommandEvent] - Item 'vTimeOfDay' received command DAY
2018-12-12 16:53:00.011 [vent.ItemStateChangedEvent] - vTimeOfDay changed from MORNING to DAY

The Asto binding is not generating the event for sunrise.

This was a known bug in OH 2.3 that hit some people which theoretically should be fixed in 2.4. Try the 2.4 milestone release or wait until next week for 2.4’s release (assuming they stick to schedule).

Yes I didn’t see this error in M7. Now M8 works as it should! So you should upgrade to it.

Hi do I need to upgrade the whole of Openhab or just the Astro binding? I’m a bit worried about breaking things I’ve just about got everything running smoothly on 2.3

You will be far better off upgrading everything. If you are worried, you can wait a week and OH 2.4 will be released and you can use that if the milestone releases worry you.

Take backups using openhab-cli backup before upgrading and you should be able to go back if you need to fairly easily.

Sorry for stupid question :sunglasses:, how to setup this two things?

I can change one in PaperUI, but how to add second?

In the Inbox press the + button and select Astro front the list. Populate with the appropriate information from there.

I’m going from memory here so I might have missed a step but this should get you close.

To add Astro Things in Paper UI go to Configuration > Things then hit “+” and choose “Astro Binding”, then “ADD MANUALLY”.

Set “Thing ID” as shown in the screenshot.

Finally set linked channel to “Evening_Time”.

1 Like

Thank you.
In this case i add second Thing "astro sun minus90".
Is it possible add only Channel to existing Thing?