Commit fbe5e16
committed
Cap time extrapolation gap to prevent charging SOC plateaus
Uncapped extrapolation in get_predicted_soc() inflated prediction
during long MQTT gaps (53 min observed), then the never-decrease
constraint locked in the inflated value. accumulate_energy() already
caps at MAX_ENERGY_GAP_SECONDS (600s) but get_predicted_soc() did
not, creating a mismatch that caused visible prediction plateaus.
Trace: MQTT burst 10:33-10:35, 53-min gap, extrapolation inflated
51.4%->58.7%, real energy stuck at 0.307 kWh, plateau until
re-anchor. After HA restart, 74-min gap from persisted session
inflated to 61.5%, second plateau at 61.7% until API sync-up at 62%.1 parent b0f022d commit fbe5e16
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
977 | 980 | | |
978 | 981 | | |
979 | 982 | | |
| 983 | + | |
980 | 984 | | |
981 | | - | |
| 985 | + | |
982 | 986 | | |
983 | 987 | | |
984 | 988 | | |
| |||
0 commit comments