Design Pattern: Time Of Day

jodatime
designpattern
time
Tags: #<Tag:0x00007f014b7e5448> #<Tag:0x00007f014b7e5308> #<Tag:0x00007f014b7e5178>

(Rich Koshak) #223

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


(Angelos) #224

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


openHAB 2.4 Milestone builds
(Kristof Rado) #225

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.


(Rich Koshak) #226

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.


(Kristof Rado) #227

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…


(Rich Koshak) #228

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.


(Kristof Rado) #229

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


(Kristof Rado) #230

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…


(Kristof Rado) #231

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…


(Rich Koshak) #232

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.


(Kristof Rado) #233

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


(Julian Divett) #234

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

(Rich Koshak) #235

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).


(Kristof Rado) #236

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


(Julian Divett) #237

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


(Rich Koshak) #238

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.