openHAB 3 time is two hours behind

Everything is set correctly, I just checked it again.

These are the settings for the time zone in OH. I have already set another one for testing, but the result remains the same. OH only takes UTC time.

Do you also have the latitude and longitude set as well?

When openhab starts does the /var/log/openhab/openhab.log look similar to below?

2021-06-06 11:31:55.896 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to ‘Australia/Sydney’.
2021-06-06 11:31:55.951 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to ‘-36.553225183712215,152.3733062744141’.
2021-06-06 11:31:55.952 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to ‘en_AU’.

Hello Wolfgang,
the first screenshot is the time zone of the raspi. I want Berlin time zone.
The second screenshot is the time stamp of OH 3. You can find it by clicking on “About & Help”, then on “Technical information”, then on “Show details”. Scroll all the way down and the time stamp is there.
The third screenshot is from my “test alarm clock” item. I wanted to send my alarm time to OH and then I noticed that the alarm clock would “ring” 2 hours earlier than it should. I’ve tested it on different devices and the result is always the same. For example, I set the alarm clock for 10 o’clock, OH says the alarm clock will go off at 8 o’clock.

That’s CEST, Central European Summertime, correct for Berlin.

This is the part you need to tell us more about.

Are you sending this time and telling openHAB it is CEST? How does it get processed, is there any reason for openHAB not to assume it is UTC?

1 Like

Everything in the log is correct and the time is right.

The location is also right, but I will certainly not post it on the Internet. :wink:

That’s Ok the co-ordinates I posted are not mine either. :wink:

You can send your alarm clock to OH via the Android app. And that’s what I actually want to do to say OH, for example: "When the alarm goes off, turn on the heating in the bathroom or turn on the coffee machine.
And when I wanted to test that, I noticed in the test item that UTC time is always used and not the current one.
And it doesn’t matter what I set, OH always uses UTC time.

Really strange problem.

Okay, so it’s nothing to do with system clocks and all about parsing data sent from an external source.

Show me.

This looks relevant

That looks interesting and I’ll check that out.

Thank you very much for this link, it helped me a lot and I did a few tests. In fact, the item shows the UTC time, but it doesn’t matter because the alarm clock from the Android device triggers the item.
I have already checked this with a test rule and it already works. But to check whether the correct alarm time is displayed in the sitemap, i first have to find out how to display the date and time in the sitemap. :slight_smile:
If you have a link to that, that would be great.

It gets discussed here, for an example -

There is no easy solution if openHAB don’t first get the correct data with timezone info. What do you actually send from the android? Note that Epoch time is by definition in UTC and carries no timezone info.

I tested the following: set the alarm clock on the mobile phone, the item in OH gets the time … but in UTC. No matter. Cell phone removed from WiFi, waited for the alarm to go off. Nothing happens in OH. Cell phone put back into WiFi, alarm clock set, cell phone left in WiFi, waited until the alarm goes on, the item is triggered. Theoretically, the item could also say “Hello World”, the content doesn’t matter because it only functions as a trigger channel.

That doesn’t explain why the UTC time is displayed in the item, but that obviously doesn’t matter.

Now I have to find out how to display a “datetime” item in a sitemap so that I can check which date and time is displayed there.

Because it all depends what you sent to the Item from the android.

In theory, you can also configure the item as a switch, which then simply switches as soon as the alarm goes off. But you have to know that first because it is not documented anywhere.
Of course, it is better to have the date and alarm time displayed. But I can’t find anything how to format the “datetime” item and then display it as text in the sitemap. I’m just about to go crazy. I want to do this through the OH3 GUI.

Are you following any kind of document? It is not possible to guess what you are doing at all from info supplied in this thread.

It’s all okay now. You have already given me the correct solution in one of your links. The user had the same problem and then also noticed that the UTC time is in the item and that the “correct” local wake-up time is displayed when the time is displayed in the sitemap. I have now also figured out how to format the date and time so that the sitemap shows them. Everything solved.

Just a remark: I have had the same problem.
Install the NTP binding and do not forget again to fill in the time zone in the bottom line of the binding window.
This helped me with the problem

1 Like