Help for date and time

Hi all,
I’m new to hass.io, i think my hass.io on the Pi 3b has a date-time problem.
I’ve googled for a while, can’t find any clue:
logbook


ssh


sun

It looks like:
The “sensor Sun” and the “ssh date” use the different date-time than the Logbook.

I made an automation rule:

- action:
  - data:
      message: sensor value greater than 10
    service: persistent_notification.create
  alias: Random Automation
  condition: []
  id: '1508639450841'
  trigger:
  - above: '10'
    entity_id: sensor.random_1
    platform: numeric_state

Send a notification to the frontend when the randome sensor state is greater than 10.

The rule seemed won’t work properly:
The notifications come out unexpected.
ps:
I can trigger the automation manually:

I’m really confused…

I just add the time&date sensor.
it shows “1 day ago” too:
datetime

is it normal?

Anybody knows why?
:confounded::confounded::confounded:

I added a Twitter notification.
Then I called the service from the hass.io frontend.
Then, I got a Error 401:

2017-10-20 05:45:47 ERROR (SyncWorker_8) [homeassistant.components.notify.twitter] Error 401: [{‘code’: 135, ‘message’: ‘Timestamp out of bounds.’}]

I then did a google search, find an explanation, by a twitter staff:

So, what should i do to correct my hass.io date-time?

I think i found the reason:
I’m setting up another card for raspbian, the time is also not updated.
When i entered following command

pi@raspberrypi:~ $ journalctl | grep ntp

The result is:

Sep 08 04:49:54 raspberrypi kernel: Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
Sep 08 04:50:36 raspberrypi systemd-timesyncd[313]: Timed out waiting for reply from 204.2.134.164:123 (2.debian.pool.ntp.org).
...
...

All servers are unreachable.
I think this happens because I’m using a vpn and a proxy to access the internet.

I will try to find a way.

Had set up a home-assistant based on raspbian + python.
Raspbian can update date time now by setting my router as its ntp time server.
I will try to resolve my problem on hass.io later.

Did you ever get this resolved? My hassio is 5 hours off and I cannot figure out how to set the time.

I would check your config.json file to see what you have set for your NTP servers (should be the default). Also try to ping them from your network to ensure you can reach them. If not make sure your have port 123 open.

I know this thread is old but I had the same issue and wanted to share what fixed it for me as I didn’t see this solution spelled out anywhere else. My system time was correct, and the latitude/longitude/elevation was all manually set correctly in my config file. Still the sun component was 6.5 hours off from my actual sunrise/sunset times. On my samba share I went into the .storage folder and opened core.config in a text editor. The latitude and longitude here was incorrect. I ended up renaming this file core.config_backup, and restarted home assistant. I thought the system might recreate this file but it hasn’t. However now it appears the sun component is using the latitude/longitude/elevation set in my configuration.yaml. My sun component shows sunset is going to be at 8:47PM instead of the previous 2:17 PM :upside_down_face:

I know it’s an old thread, but I’m facing similar issue. My Hassio server date is 4 days and one and half hour back. Found core.config file, but everything is as same as configuration.yaml specifications and same location.
May I know how can I find config.json file from hassio?

Hi did you manage to fix this as I have the same issue

I know it’s frustrating, but after tried everything (logs, configs, too many reboots of server and host) apparently It was resolved itself. Still don’t know the root cause for this issue and don’t know how did I resolved.

You can find the steps I’ve taken in the process of resolution here.

Hi, i’m having a similar problem, when i restart hassio the datetime is wrong, all automations are not working correctly and it’s imposible to connect by nuba. There are some service that my router block but i don’t know what it is because when i connect the hassio in a friend router, it works correctly. I checked the port 123 and it 's working. it’s frustrating. If i want to update i have to go to my friend house.

1 Like

Why is even a regular date command failing?

~ $ date
Sun May 30 14:21:43 CEST 2021
~ $ date -s 05301427
date: can’t set date: Operation not permitted
Sun May 30 14:27:00 CEST 2021
~ $ date
Sun May 30 14:22:01 CEST 2021
~ $ id
uid=0(root) gid=0(root) groups=0(root),0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)

Did you find a solution for this? I am having the same issue and reported it to developers.

2 Likes

Same issue here, not being able to find a way to set the datetime correctly (I can set the time via ssh with date -s 00:00:00, not the complete date…).
Also I’m a bit surprised the hardware did not keep the datetime after being off during a couple of days… is that the normal behavior? I’m using the odroid blue edition… which already gave problems with the installation because of this datetime problem due to a certificate, and now I see this.
Also a suggestion for the HA developers, probably it’s a good thing to show the system date-time, not just the zone where you’re in, just to make sure datetime from HA is aligned with what the user is asuming.

You can use the Time & Date Integration.
Time & Date - Home Assistant (home-assistant.io)

  - platform: time_date
    display_options:
      - "time"
      - "date"

but the hardware date and time are wrong… so I guess this integration will still use the wrong data…

I was trying to address this :point_up_2:

As far as the hardware date wrong, it was a HA OS issue for me. I spent hours trying to troubleshoot and the only way for me to resolve it was to backup, fresh install and restore. It was a year ago and it has been perfect since.

Now I get it, thanks!

About fresh install, I think on my case would not help, I had the same issue after reinstalling several times, I think it’s a hardware problem… I’m using the HA-blue… what a surprise is so little supported :frowning: