Sun integration reports incorrect sunrise/sunset times


Nothing wrong with the Sun integration; just me jumping to (wrong) conclusions. :roll_eyes:

While helping someone else with a question about the Sun integration, I discovered that, on my system, it’s reporting the wrong times for sunrise and sunset. In fact, I run two, similarly configured instances of Home Assistant and both are reporting incorrect sunrise/sunset times (versions 2023.3.6 and 2023.3.3).

For my location (Eastern Time Zone) Home Assistant reports incorrect times for the attributes of sun.sun.

  • Sunset (next_dusk) is a half-hour too late.
  • Sunrise (next_dawn) is a half-hour too early.

System configuration of time zone and location (latitude/longitude) is correct. For comparison, I installed the Sun2 custom integration and it reports the correct time for sunrise and sunset.

The Sun2 integration reports the correct sunrise/sunset times but not the Sun integration (both are using the same, common data for local time, timezone, and lat/long). The time discrepancy is plus a half-hour for sunset and minus a half-hour for sunrise. :thinking: :man_shrugging:t3:

Anyone have an idea why the Sun integration is misreporting the times?


I’ve reported this in the GitHub Core repo but given that it’s currently 2 days prior to a major release (and there’s a backlog of over 2000 unresolved Issues) I’m hoping someone here might resolve this sooner than in GitHub (unless it’s an actual bug).

You’re looking at next_dusk & next_dawn. I think you want to look at next_setting & next_rising.


I need a vacation :man_facepalming:t3:


A post was split to a new topic: Next_rising and next_setting still shows appr. 2 minutes too late (GMT+1, central europe, Slovenia,)

EDIT: The linked thread could still be useful, but the problem I was having seems not being related with the sun integration, that actually seems to work just fine.

There seems to be actually an issues with the sun integration, at least when using it in automation. I’ve found this topic on github, maybe it can be useful for anyone experiencing the same problem. If it gets fixed, that is.