Skip to content

[fronius] Add battery Thing type#20650

Merged
lsiepel merged 9 commits intoopenhab:mainfrom
jimtng:fronius-storage
May 1, 2026
Merged

[fronius] Add battery Thing type#20650
lsiepel merged 9 commits intoopenhab:mainfrom
jimtng:fronius-storage

Conversation

@jimtng
Copy link
Copy Markdown
Contributor

@jimtng jimtng commented Apr 29, 2026

Resolves #12635
Resolves #19376

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@lsiepel lsiepel requested a review from Copilot April 29, 2026 15:16
@jimtng
Copy link
Copy Markdown
Contributor Author

jimtng commented Apr 29, 2026

For testing:

  • Disable or uninstall your standard Fronius binding
  • Remove the .txt extension of this file and drop it into your addons folder

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.

@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 battery Thing 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.

Comment thread bundles/org.openhab.binding.fronius/README.md Outdated
Comment thread bundles/org.openhab.binding.fronius/README.md Outdated
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng
Copy link
Copy Markdown
Contributor Author

jimtng commented Apr 29, 2026

Test JAR v2 - use floating point SOC in case Fronius returns a floating point

org.openhab.binding.fronius-5.2.0-SNAPSHOT.jar.txt

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 battery Thing type with battery-specific channels and channel-types.
  • Adds a new FroniusBatteryHandler plus storage DTOs used to deserialize GetStorageRealtimeData responses.
  • 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.

Comment thread bundles/org.openhab.binding.fronius/README.md Outdated
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@florian-h05
Copy link
Copy Markdown
Contributor

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>
@jimtng jimtng marked this pull request as ready for review April 30, 2026 13:39
jimtng added 2 commits May 1, 2026 00:57
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Copy link
Copy Markdown
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, one question though:

Copy link
Copy Markdown
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

Waiting for copilot to see if there are any blocking issues.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 battery Thing type with channel-types, i18n strings, and README documentation.
  • Add storage realtime DTOs + a FroniusBatteryHandler that polls GetStorageRealtimeData and 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.

jimtng added 2 commits May 2, 2026 02:59
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng requested a review from lsiepel May 1, 2026 17:08
@jimtng jimtng requested a review from florian-h05 May 1, 2026 17:08
Copy link
Copy Markdown
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM

@lsiepel lsiepel merged commit bd34ffb into openhab:main May 1, 2026
2 checks passed
@lsiepel lsiepel added this to the 5.2 milestone May 1, 2026
@jimtng jimtng deleted the fronius-storage branch May 2, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fronius] add battery temperature [fronius] add battery SOC

4 participants