Exposing season transitions as timestamp sensors

It looks like the Season integration calculates the date of the next season change that but does not expose it. That may be a little beyond my ability to make that happen, even if it’s possible.

From Season:

def get_season(
    current_date: date, hemisphere: str, season_tracking_type: str
) -> str | None:
    """Calculate the current season."""

    if hemisphere == "equator":
        return None

    if season_tracking_type == TYPE_ASTRONOMICAL:
        spring_start = ephem.next_equinox(str(current_date.year)).datetime()
        summer_start = ephem.next_solstice(str(current_date.year)).datetime()
        autumn_start = ephem.next_equinox(spring_start).datetime()
        winter_start = ephem.next_solstice(summer_start).datetime()
    else:
        spring_start = datetime(2017, 3, 1).replace(year=current_date.year)
        summer_start = spring_start.replace(month=6)
        autumn_start = spring_start.replace(month=9)
        winter_start = spring_start.replace(month=12)

if you use the meteorological seasons it seems quite simple, the it’s the first of the month of the next month which is divisible by 3

For astrological you could fix it to the 21st instead of the 1st

Sometimes 20th, sometimes 21st. Depends how particular you are.

There are other options - write a python script and execute it via one of the python script integrations being the most obvious.

Full reference PyEphem Quick Reference — PyEphem home page

Since the calculation is there on the Season integration, is it possible to expose them as an attribute by adding to the code already there?

Attributes like this are being deprecated, but as a separate sensor provided by the integration, your luck may be in. I mean, if you submit a PR it may be accepted. As an FR it’s unlikely to be implemented, if you ask me.