hass-circadian_lighting icon indicating copy to clipboard operation
hass-circadian_lighting copied to clipboard

No longer adjusting for time zone.

Open ACrazyConcept opened this issue 3 years ago • 8 comments

Efter the latest update my sunset and sunrise shifted 2 hours back. I am in UTC+1 (+1 more for DST), so I suspect something is up with time zone adjustment. My config said sunrise_time: '07:00' sunset_time: '22:00' But the sensor now changed and showed sunset at 00:00 and sunrise at 09:00.

ACrazyConcept avatar May 31 '21 15:05 ACrazyConcept

The version bump to v2 included changes to remove a dependency on timezonefinder which had a dependency on numpy which was causing a lot of installation issues for people who were using HA Core installations. This is almost definitely what caused the change in behavior for you.

A couple questions -

  1. Do you have your time zone properly set in Home Assistant?
  2. Does the time zone on the host that's running Home Assistant match the time zone set in Home Assistant?

claytonjn avatar Jun 01 '21 13:06 claytonjn

I'm having this issue as well. My timezone is set correctly, it appears as though when sunrise and sunset times are configured that it bypasses the timezone and uses UTC. Removing the set times returns it to normal behavior.

hackworth avatar Jun 02 '21 15:06 hackworth

Debian:

:~ $ date
Wed  2 Jun 17:24:10 CEST 2021

Home Assistant docker terminal:

bash-5.0# date
Wed Jun  2 17:24:57 CEST 2021

Home Assistant Info: image

I am not sure if there are other ways/places to check?

ACrazyConcept avatar Jun 02 '21 15:06 ACrazyConcept

I think I'm having the same issue. I also had sunrise_time and sunset_time set to static values and it seems that those values are not taking timezones into account, so my 06:00:00 sunrise happens at 09:00:00 as I'm UTC+3. Running date in the Home Assistant OS "Terminal & SSH" add on gives me the correct time and timezone.

Let me know if there is any way for me to find out more details that could help and thank you for the great work you're doing!

oehnstro avatar Jun 03 '21 05:06 oehnstro

Please figure out issue with wrong time and let circadian lighting use timezone instead of core time.

Zufan81 avatar Jun 15 '21 17:06 Zufan81

I haven't yet had a chance to look into this or do any testing...my understanding is that the time zone discrepancy is only an issue when sunrise_time and/or sunset_time are set - is that correct? Is there any reason why as an immediate workaround users can't just adjust the settings to be the desired time +/- their respective offset from UTC?

claytonjn avatar Jun 16 '21 12:06 claytonjn

I haven't yet had a chance to look into this or do any testing...my understanding is that the time zone discrepancy is only an issue when sunrise_time and/or sunset_time are set - is that correct? Is there any reason why as an immediate workaround users can't just adjust the settings to be the desired time +/- their respective offset from UTC?

That's correct, and yes, setting the time as the time +/- the time difference to UTC works as a workaround. e.g. I can set my sunrise time to 3AM when I am at UTC+3 and want the sunrise ti happen at 6AM. So that works as an easy workaround for now :)

oehnstro avatar Jun 16 '21 12:06 oehnstro

@claytonjn As this has been open for over a year are we able to adjust the docs here:

https://github.com/claytonjn/hass-circadian_lighting/wiki/Advanced-Configuration

to show that these times are in UTC? As it's in the wiki i cant submit a PR.

Confused me for a little bit and it would be great if others don't encounter this :)

scarby avatar Nov 08 '22 21:11 scarby