I have been chasing this for a while on my forecast card… It’s 6 hours prior to current time. Exactly what my diff is from UTC (but doubled). All my time based automation start correctly… Any ideas are appreciated.
root@ham:/opt/homeassistant/config# timedatectl status
Local time: Sat 2019-02-02 16:58:24 CST
Universal time: Sat 2019-02-02 22:58:24 UTC
RTC time: n/a
Time zone: America/Chicago (CST, -0600)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
I assume includes/hass.yaml is included from configuration.yaml for the basic homeassistant config, is that right? If so, I don’t see the time_zone configuration variable.
Do you see a WARNING in home-assistant.log that starts “Incomplete core configuration. Auto detected”? And, if so, was time zone one of the things that was auto detected, and if so, is it correct?
Sorry - was out to dinner… Ya, the hass.yalm is included in the config. I actually remove time_zone setting while testing attempting to see what was going on, here is the WARNING you are looking for…
2019-02-02 21:28:26 WARNING (MainThread) [homeassistant.config] Incomplete core configuration. Auto detected time_zone: America/Chicago
It autodetected it correctly, I am in the mid-west (unfortunately).
I added time_zone back and the warning disappears.
I also tried adding sensor:
platform: time_date
display_options:
‘time’
‘date’
‘date_time’
‘time_date’
‘time_utc’
‘beat’
to verify against UTC (and that I wasn’t crazy). I actually rationalized and assumed that the forecast was busted until I found this thread. Now I’m beating my head against something that seems so easy.
Well, that seems to indicate the clock is set correctly on your system, and the time zone in both HA and the environment in which HA runs are set correctly as well. And you say your time based automations run at the right time. So it seems like all that is correct.
So you say your “forecast card” is 6 hours too early. Can you post the config items that affect that? And maybe a screen capture of what doesn’t look right?
Wait, before you do that, I just looked at the darksky.py code for the weather component. It passes latitude and longitude to the package that obtains the forecast. I wonder … are your GPS coordinates entered correctly in your HA configuration?
Also, looking at how the code gets the times for the hourly forecasts, it gets a Unix Epoch timestamp from the server, then uses datetime.fromtimestamp() to convert it to local time. So, try this in the Template Editor: