Openhab 2 Wrong Time

Good morning,

I have a little issue with the time in openhab.
Explanation:
On my openhabpanel the correct time is displayed.
But when I introduce the command “date” into the command line, the wrong time is displayed.

I already tried to change the time zone through the openhabian-config menu. But unfortunately, this time is also not the correct one.

When I introduce the commande timedatectl, I didn’t find the RTC clock

[09:59:00] openhabian@openHABianPi:~$ timedatectl
      Local time: Sat 2017-11-04 10:02:16 CET
  Universal time: Sat 2017-11-04 09:02:16 UTC
        RTC time: n/a
       Time zone: Europe/Berlin (CET, +0100)
     NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: yes
      DST active: no
 Last DST change: DST ended at
                  Sun 2017-10-29 02:59:59 CEST
                  Sun 2017-10-29 02:00:00 CET
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2018-03-25 01:59:59 CET
                  Sun 2018-03-25 03:00:00 CEST

Warning: The system is configured to read the RTC time in the local time zone. This
         mode can not be fully supported. It will create various problems with time
         zone changes and daylight saving time adjustments. The RTC time is never updated,
         it relies on external facilities to maintain it. If at all possible, use
         RTC in UTC by calling 'timedatectl set-local-rtc 0'.

Issue
Each time-based rule isn’t working correct.

How can I fixe this problem?

Thanks,
Thomas

Well, if you are on a raspberry pi or similar board controller there is no real-time clock.

Can this machine reach the internet?

What happens when you run

sudo /etc/init.d/ntp stop
sudo ntpd -q -g
sudo /etc/init.d/ntp start

Hey Rich
I had a similar issue and your suggestion fixed it. Can you please tell what the issue was and how it fixed it?
Thanks,
Guy

I have no idea what the issue was. The command restart the network time server daemon which synchronizes the clock on the machine with a configured time server. Restarting it should force it to reach out and grab the current time.

Thanks…

Dear Colleagues,

Even doing as you suggest it does not working for me, system (raspbian) is with currently correct date as below:

[15:04:25] openhabian@openhabian:~$ timedatectl
Local time: qua 2020-02-05 15:08:09 -03
Universal time: qua 2020-02-05 18:08:09 UTC
RTC time: n/a
Time zone: America/Sao_Paulo (-03, -0300)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no

However, from ntp binbding and logview it’s not correct. Also on BASICUI where we use following think

Thing ntp:ntp:br “DATA” @ “GERAL” [hostname=“pool.ntp.br”, refreshInterval=60, refreshNtp=30, timeZone=“America/Sao_Paulo”]

i’m in Brazil gmt-3 but it’s not working.
May you please help me?

@rlkoshak did you have any clue about it?

I don’t have anything to suggest beyond what has already been said in this thread.

Для меня
sudo /etc/init.d/ntp stop
не работает . Выдает :
sudo: /etc/init.d/ntp: command not found
Время глобальное никак изменить не могу .

List time zone

  • $ sudo timedatectl list-timezones

Change time zone

  • $ sudo timedatectl set-timezone Asia/Kuala_Lumpur

Check time status

  • $ sudo timedatectl status

@Kencho:
What shows timedatectl status ?

If NTP is inactive, activate NTP with sudo timedatectl set-ntp True and check afterwards the status again with timedatectl status. NTP should be running now and the time should be set correctly.

2 Likes