that is very strange. let me check
@Ranjib with help of AI I've found the problem, it's in the Reef-Pi Home Assistant Integration. Here is the report:
Root cause
The issue is in the integration’s __init__.py file, specifically in the update_atos() function.
The code currently parses the timestamp returned by Reef-Pi using:
ato_states[id]["ts"] = datetime.strptime(
ato_states[id]["time"], REEFPI_DATETIME_FORMAT
).replace(tzinfo=dt_util.UTC)
The problem is that Reef-Pi appears to return timestamps in local time, but the integration assigns the UTC timezone directly using .replace(tzinfo=dt_util.UTC).
This does not convert the timestamp to UTC; it simply marks the local time as UTC.
As a result, Home Assistant applies the local timezone offset again, causing the displayed time to be incorrect.
I replaced the timestamp conversion with:
ato_states[id]["ts"] = dt_util.as_utc(
datetime.strptime(
ato_states[id]["time"], REEFPI_DATETIME_FORMAT
).replace(tzinfo=dt_util.get_time_zone("Europe/Rome"))
)
This change needs to be applied in
both timestamp conversion branches of update_atos().
I also noticed the same issue in update_pumps(), where the timestamp is parsed using the same UTC assignment.
I applied the equivalent fix there:
time = dt_util.as_utc(
datetime.strptime(
current["time"], REEFPI_DATETIME_FORMAT
).replace(tzinfo=dt_util.get_time_zone("Europe/Rome"))
)
After replacing the code and restarting Home Assistant, the timestamps are now displayed correctly.
For example:
Before the fix:
- Actual event time: 20:25
- Displayed event time: 21:25
After the fix:
- Actual event time: 20:42
- Displayed event time: 20:42
The fix has been successfully tested on my installation running integration version 4.0.6.