github pnbruckner/ha-sun2 4.0.0b3
Major update & reorganization

pre-release22 hours ago

Beta testers needed

Since it is very difficult to test all locations & times of year, both of which affect the operation of these sensors, I would really appreciate it if people could give this beta release a try AND provide your feedback, good or bad. THANKS!!

What's Changed

4.0.0b0:

  • Make sensors use observer elevation that should but haven't
    This feature (or really, a bug fix, since these sensors should have always used observer elevation as an input) was first introduced in release 3.4.2, but the implementation was seriously flawed, so that release was retracted. This is a second attempt to implement the same improvement, but in a different way. Also, more manual testing was done than before.
    Sensors affected: Phase, deCONZ Daylight & Elevation binary sensor.
  • Simplify some sensor implementations
    Some of the sensors used an "elevation curve" search mechanism to determine their state. This is overly complex and leads to some sensors disagreeing with each other. Simplify the sensors that used this mechanism to use the time_at_elevation astral method instead.
    Sensors affected: Phase, deCONZ Daylight, Elevation & Elevation binary sensor.
  • Change sunrise & sunset elevation from -0.833 to -0.267
    The astral package made this change in its 2.0 release and was first used in Home Assistant with its 2021.5.0b0 release. This is because the astral package now accounts for refraction

4.0.0b1:

  • Remove outdated manual entity name translations
    Support for placeholders for entity name translations was added to Home Assistant in the 2024.2.0b0 release.

4.0.0b2:

  • Fix first update of elevation binary sensor
    If HA starts when the sun is setting (i.e., it is after solar noon), but it does not set today (e.g., it stays above or below the horizon for the whole day), this sensor's initial state was set incorrectly. This change fixes that bug.

4.0.0b3:

  • Make point in time sensors show next time event occurs
    If event does not occur in the current day, have the state show the next time the event does occur, as long as it occurs sometime within the next year. The yesterday, today & tomorrow attributes are not affected by this change.
  • Make updates atomic
    This was supposed to be the case initially, but due to a bug, atomic updates were not guaranteed.
  • Elevation sensor updates now use raw, unrounded values
    This could potentially be a breaking change. If multiples of 0.5 are still needed, this can be accomplished by leaving the display precision set to one decimal place, and use states(ENTITY_ID, rounding=True).
  • Limit some potentially long updates to 50 msec at a time
  • Round timestamp type states to nearest second
  • Change azimuth sensor update rates
    Take observer elevation into account. Make rate every 2 minutes when within 6 degrees of sunrise/sunset, and every 10 minutes otherwise.
  • Provide list of available time zones in config flow
  • Fix bug related to disabled entities when configuration is updated

Full Changelog: 3.4.3...4.0.0b3

Don't miss a new ha-sun2 release

NewReleases is sending notifications on new releases.