[fronius] Add battery Thing type#20650
Conversation
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
|
For testing:
Create a new Battery Thing and link the channels to items. org.openhab.binding.fronius-5.2.0-SNAPSHOT.jar.txt This may work on openhab 5.1.x - please report if it does. |
There was a problem hiding this comment.
Pull request overview
Adds first-class battery support to the Fronius binding by introducing a new battery Thing type backed by the Solar API v1 storage realtime endpoint, including new channels and documentation/i18n updates.
Changes:
- Introduce
batteryThing type + channel-types (SOC, temperature, DC voltage/current, capacities, status, timestamp) and wire a new handler in the factory. - Add new storage DTOs to deserialize GetStorageRealtimeData responses and map them to channels/properties.
- Update README and i18n strings to document/configure the new Thing type and improve action docs/examples.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/thing/thing-types.xml | Adds battery thing type and new battery-specific channel-types. |
| bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/i18n/fronius.properties | Adds i18n strings for the new battery thing/channels/channel-types and reorganizes action labels. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBatteryHandler.java | New handler to poll storage realtime data and expose values via channels/properties. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeResponse.java | New DTO root for the storage realtime endpoint response. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeBody.java | New DTO for Body node of the storage realtime response. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeBodyData.java | New DTO for Data node of the storage realtime response. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageController.java | New DTO mapping the Controller node fields to Java properties used by the handler. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageDetails.java | New DTO mapping Details fields for thing properties (vendor/model/serial). |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusHandlerFactory.java | Registers the new battery thing type and handler. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java | Adds battery thing type UID, channel IDs, and storage endpoint URL helper. |
| bundles/org.openhab.binding.fronius/README.md | Documents the new battery thing, channels/properties, and extends scripting examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
|
Test JAR v2 - use floating point SOC in case Fronius returns a floating point |
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
There was a problem hiding this comment.
Pull request overview
Adds a dedicated battery Thing type to the Fronius binding to expose storage controller metrics (e.g., SOC and temperature) via the Solar API V1 GetStorageRealtimeData endpoint.
Changes:
- Introduces a new
batteryThing type with battery-specific channels and channel-types. - Adds a new
FroniusBatteryHandlerplus storage DTOs used to deserializeGetStorageRealtimeDataresponses. - Updates i18n strings and README documentation/examples to include the new Thing.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/thing/thing-types.xml | Adds battery thing-type + battery channel-types; adjusts SOC tagging. |
| bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/i18n/fronius.properties | Adds i18n labels/descriptions for the new battery Thing and channel-types; reorganizes action strings. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBatteryHandler.java | New handler polling storage realtime data and mapping controller fields to channels/properties. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeResponse.java | New DTO root for storage realtime response. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeBodyData.java | New DTO for the storage Data node. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeBody.java | New DTO for the storage Body node. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageDetails.java | New DTO for battery manufacturer/model/serial details. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageController.java | New DTO for storage controller measurement fields. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusHandlerFactory.java | Registers the new battery Thing handler. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java | Adds battery thing type UID, channel IDs, and storage endpoint URL builder. |
| bundles/org.openhab.binding.fronius/README.md | Documents the new Thing type, config, channels, properties, and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
|
Nice work! I haven't seen this until you pinged me in the issue (its draft, therefore no review request), but having additional data available is really nice! |
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
florian-h05
left a comment
There was a problem hiding this comment.
Code LGTM, one question though:
lsiepel
left a comment
There was a problem hiding this comment.
Thanks, LGTM
Waiting for copilot to see if there are any blocking issues.
There was a problem hiding this comment.
Pull request overview
Adds a dedicated Fronius battery Thing type to the Fronius binding, polling the Solar API V1 storage realtime endpoint and exposing battery SOC/temperature and related controller fields as channels and properties.
Changes:
- Introduce a new
batteryThing type with channel-types, i18n strings, and README documentation. - Add storage realtime DTOs + a
FroniusBatteryHandlerthat pollsGetStorageRealtimeDataand maps controller fields to channels/properties. - Add a unit test covering JSON parsing for the storage realtime response.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| bundles/org.openhab.binding.fronius/src/test/java/org/openhab/binding/fronius/internal/api/StorageRealtimeResponseTest.java | Adds a parsing test for the storage realtime JSON response. |
| bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/thing/thing-types.xml | Registers the new battery Thing type and its channel-types; adjusts SOC tagging. |
| bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/i18n/fronius.properties | Adds i18n labels/descriptions for the new battery Thing/channels/channel-types; deduplicates action keys. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBatteryHandler.java | Implements polling + channel/property mapping for the battery storage controller data. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeResponse.java | New DTO root for GetStorageRealtimeData responses. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeBodyData.java | New DTO for Body.Data node. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageRealtimeBody.java | New DTO for Body node. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageDetails.java | New DTO for storage controller “Details” (manufacturer/model/serial). |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/dto/storage/StorageController.java | New DTO for the storage controller fields (SOC, temperature, capacities, etc.). |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusHandlerFactory.java | Wires the new battery Thing type to FroniusBatteryHandler. |
| bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java | Adds battery Thing UID, channel IDs, and storage realtime URL helper. |
| bundles/org.openhab.binding.fronius/README.md | Documents the new battery Thing type, configuration, channels, properties, and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Resolves #12635
Resolves #19376