Repository navigation
Fix spot price (pricezone endpoint gone), add last API poll sensor - #9
Merged
Merged
Conversation
…uses
- New diagnostic sensor "Last API poll": its value is the last successful
refresh. Its attributes show the last refresh error and, for each slow
update (revenue, price, energy, logbook, diagnostics, news), its last
success, last error and next attempt. The attributes are excluded from
the recorder, and the sensor stays available when a refresh fails so
the error remains visible.
- Request errors now name the HTTP status or a timeout ("Request to
/ems/pricezone failed: HTTP 404") instead of just ClientResponseError,
still without the URL's query values. aiohttp's total timeout raises
TimeoutError, which is now caught as well.
- The price zone is read from the site's Mba (market balance area) in
/site/Statuses, which is already fetched every cycle. /ems/pricezone is
only a fallback, so spot prices no longer depend on it: it returns an
HTTP error for at least one site.
- Slow updates return an error description instead of a bool; the six
status fields replace the separate next-update map.
Version 1.5.3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tt2YacbPwiWKinpfhCss29
A HAR export from the EnergyInBalance web app (2026-09-23) shows it no longer calls /ems/pricezone: it takes the zone from Mba in /site/Statuses and requests /ems/spotprice with zone, fromDate, toDate and siteId. The integration now sends siteId too, so the request matches the web app. Verified by running the coordinator against the HAR's Statuses and spot price responses with /ems/pricezone returning 404: the zone resolves to SE4 and the current slot's price is selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tt2YacbPwiWKinpfhCss29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spot price, spot price incl. VAT and price zone were unavailable on 1.5.2.
/ems/pricezonenow returns an HTTP error, and the spot price request came after it in the same step, so it was never sent. The request itself is unchanged since 1.5.1, but the zone is fetched only once per HA start, so a 1.5.1 instance started earlier kept a zone from when the endpoint still worked.A HAR export from the EnergyInBalance web app (2026-09-23) shows it no longer calls
/ems/pricezoneat all. It takes the zone fromMbain/site/Statusesand requests/ems/spotpricewithzone,fromDate,toDateandsiteId.Changes
Mbain/site/Statuses, which the integration already fetches every cycle./ems/pricezoneis only a fallback.siteIdso it matches the web app.Senaste API-hämtning):revenue,price,energy,logbook,diagnostics,news),last_success,last_errorandnext_attempt.Request to /ems/pricezone failed: HTTP 404instead ofClientResponseError, still without query values. aiohttp's total timeout raisesTimeoutError, which is now caught as well.docs/api.mdnotes the pricezone change, and the README's troubleshooting section points to the new sensor. The version is bumped to 1.5.3.Testing
/site/Statusesand/ems/spotpriceresponses, with/ems/pricezonereturning 404 and the clock set to the HAR's time. The zone resolved toSE4and the price for the 12:30 slot was selected, matching the HAR. The HAR itself is not committed.Mbaand the fallback;ruff checkandruff format --checkare clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Tt2YacbPwiWKinpfhCss29
Generated by Claude Code