Repository navigation
Replies: 5 comments 4 replies
Yes, but the problem is to recognize what is stale and what is a real time shift... |
|
Yes, hard to tell in general. One idea: a stale updated_time should only ever be too old, not too new. So if a sample is newer than the stored offset allows (-3600 stored, but timestamp only 1 min behind now), that could be the signal to reset. A real shift shouldn't trigger it, since no sample would be newer. It wouldn't catch the stale value itself, the offset would still be off until the next fresh update, but it would no longer stay stuck until a reload. I don't know if the timestamps can also run ahead, or if this affects the energy queries, so you may see a problem here that I don't. |
|
I may only think of a shift larger than 30 min to be considered as reset to trigger recalculate. |
|
Seems the calculation for SB is different than for other systems. It may have been on purpose but I don't remember. I will look whether this can be harmonized or improved. |
|
Thanks for looking into it! One small thing in case it helps: because of the rounding, about 14 min old already gives -1800, so a 30 min limit wouldn't reset that one. I only had this checked in a small simulation with AI help, not in the real code, so it may be off. |
Uh oh!
There was an error while loading. Please reload this page.
Posting this here instead of an issue because I don't have debug logs from that time anymore (reloading the integration fixed it).
Version 3.9.1, HA 2026.10.4, Solarbank 3 E2700 Pro + Smart Meter, manual mode with 3 slots (00-06, 06-19, 19-24), timezone Europe/Berlin.
I change the system output preset by automation during the night. Last night some changes went into the wrong slot:
The
tz_offset_secattribute of the site timestamp sensor was -3600. After reloading the integration it's 0 again.I think this is where it comes from: the day before there was a cloud outage of about an hour (10:34-11:39). The first update afterwards had
updated_time10:31:30, so 68 min old. Inpoll_sitesthe offset is themin()of the old value andupdated_time - now - 2min, so this one stale value gives -4197 s ->energy_offset_tz= -3600, and because it's amin()it never goes back up.set_sb2_home_loadaddsenergy_offset_tzto now when it picks the slot, so every write is evaluated one hour too early.The night before (same version, before the outage) changes after midnight were fine.
Maybe ignore
updated_timevalues that are clearly stale, or let the offset recover instead of keeping the minimum?Best,
Ex
All reactions