Skip to content

Update API docs from 2026-09 HAR export; shorten JWT fallback expiry - #5

Merged
andreasthell merged 2 commits into
mainfrom
claude/checkwatt-har-export-xx48od
Sep 1, 2026
Merged

andreasthell merged 2 commits into
mainfrom
claude/checkwatt-har-export-xx48od

Conversation

@andreasthell

Copy link
Copy Markdown
Owner

Summary

CheckWatt updated the EnergyInBalance web app, so docs/api.md was re-verified against a fresh HAR export (2026-09-01). All endpoints the integration uses still exist with compatible response shapes — nothing is broken — but several API details changed and are now documented.

API changes found

  • Token handling: JwtTokenExpires was removed from the login response and the JWT lifetime was cut from ~2.25 hours to ~15 minutes; the refresh token lifetime was extended from 7 to 14 days. The client already reads expiry from the JWT's own exp claim, so it is unaffected.
  • /SiteMeasurements/{id}/Data gained resolution=Minute and new per-minute power/SoC dataTypes (SolarProductionPower, BatteryChargePower, BatteryDischargePower, BoughtPower, SoldPower, Soc), which the web app now uses for the live view instead of /datagrouping/series with delta grouping.
  • /ems/ActivationSchedule is greatly expanded: spot prices (EUR/MWh), total buy/sell energy prices, the full hourly EMS schedule, user settings (SoC limits etc.) and system settings.
  • New endpoint /Tariff/assignableTariffsForSite; new fields on /site/{id}, /site/Statuses, /user/FacilitiesV2 and /user/Login; siteId param on /ems/spotprice.
  • /measurements/SolarNow, /ems/gridtariff and /ems/service/Pending are no longer observed in web traffic and are marked as likely deprecated.
  • Added a note that all examples come from a single site and that grid services (mFRR, FCR-D, …) vary per site, so service-specific fields must be treated as dynamic.

Code change

  • api.py: the JWT-expiry fallback used when decoding the token fails is reduced from 2 hours to 10 minutes, matching the new ~15-minute token lifetime.

All examples in the docs use anonymized placeholder values; no real identifiers from the HAR export are included.

Testing

  • ruff check and ruff format --check pass
  • pytest tests — 49 passed

🤖 Generated with Claude Code

https://claude.ai/code/session_01P2N4Hw4yUxPDRE7DcfRQ46


Generated by Claude Code

CheckWatt's updated web app revealed several API changes:
- JwtTokenExpires removed from login response; JWT lifetime cut to ~15 min
- Refresh token lifetime extended to 14 days
- New SiteMeasurements dataTypes (per-minute power/SoC) replacing
  datagrouping delta for the live view
- ActivationSchedule greatly expanded (spot prices, EMS schedule, settings)
- New /Tariff/assignableTariffsForSite endpoint; new fields on
  /site/{id}, /site/Statuses, /user/FacilitiesV2 and /user/Login
- /measurements/SolarNow, /ems/gridtariff, /ems/service/Pending no longer
  observed in web traffic

Code: JWT-expiry decode fallback reduced from 2 h to 10 min to match the
new ~15-minute token lifetime.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2N4Hw4yUxPDRE7DcfRQ46
@andreasthell
andreasthell merged commit 77f3a3f into main Sep 1, 2026
3 checks passed
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.

2 participants