[solaredge] Add Monitoring API V2 support - #21399
Conversation
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
7d0863b to
1f2f6cc
Compare
|
This AI review may help get the PR ready for review. The Monitoring API V2 support covers a lot of ground, including OAuth authentication, V2 telemetry, aggregate values, request accounting, tests, and documentation. A few correctness and recovery issues seem worth addressing while the PR is still a draft:
There are also a few static-analysis findings in the changed code, including implicit-default-time-zone warnings in the new V2 request classes, that seem worth cleaning up before marking the PR ready for review. |
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
|
Thanks for the detailed review. I addressed all the points in commit e49fb5d:
I also added tests for direct consumption and incomplete battery telemetry. The full binding build passes with 24 tests, static analysis reports no errors, and the OSGi feature verification succeeds. The updated binding was additionally tested against a live SolarEdge site, including live and aggregate polling. |
Description
This adds support for SolarEdge Monitoring API V2 while retaining the existing Monitoring API V1 and private API integrations.
Monitoring API V2 can be used with either a Fleet Access App API key or OAuth site access. The OAuth implementation provides the initial browser-based authorization flow, persists the access and refresh tokens in openHAB storage, renews access tokens before expiry, and stores rotated refresh tokens.
The binding retrieves live site power, meter telemetry, and storage telemetry. It also retrieves aggregate production, grid, and storage data for day, week, month, and year channels. Consumption and direct PV self-consumption are derived from the available energy balance while preserving the semantics of the existing status channels.
The Thing exposes locally recorded API requests for the last 30 days and the latest rate-limit information returned by SolarEdge. The README documents V2 configuration, OAuth authorization, request consumption, rate limits, derived values, and the observed long-running test behavior.
Motivation and impact
SolarEdge presents Monitoring API V2 as the current developer-platform API and plans to deprecate Monitoring API V1. This change allows existing SolarEdge Things to migrate to V2 without introducing a new Thing type or changing the established channel IDs.
Testing
mvn clean installupstream/main