Skip to content

Fix Penman-Monteith daily solar radiation input (#152) - #153

Merged
kmich merged 8 commits into
mainfrom
fix/issue-152-et0-daily-solar
Sep 19, 2026
Merged

kmich merged 8 commits into
mainfrom
fix/issue-152-et0-daily-solar

Conversation

@kmich

@kmich kmich commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #152.

et0_penman_monteith() expects solar radiation as a 24-hour daily mean in W/m², but the coordinator was passing the weather station's instantaneous reading. Because the algorithm converts that value to MJ/m²/day, a noon reading could be treated as though it applied for 24 hours and substantially inflate ET₀.

Changes

  • Snapshot the completed day's accumulated solar irradiation (Wh/m²) at the local day boundary.
  • Persist the previous completed day's irradiation across Home Assistant restarts.
  • Promote a saved "today" accumulation to "previous day" when HA restarts after midnight.
  • Feed Penman-Monteith previous_day_whm2 / 24 instead of instantaneous solar W/m².
  • Leave the PM sensor unavailable until a complete measured solar day exists, rather than publish a knowingly invalid estimate.
  • Update the PM algorithm test to use a realistic daily-mean solar value.
  • Add persistence coverage for the completed-day solar promotion path.
  • Document the correction in CHANGELOG.

This intentionally takes the strict FAO-56 path rather than extrapolating a partial day's solar curve, avoiding unstable dawn estimates and errors after downtime/restarts.

@kmich
kmich merged commit ee3308b into main Sep 19, 2026
10 checks passed
@kmich kmich mentioned this pull request Sep 19, 2026
@kmich
kmich deleted the fix/issue-152-et0-daily-solar branch October 3, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ET₀ Penman-Monteith fed instantaneous solar radiation instead of daily mean (~3× overestimate)

1 participant