[homewizard] Add batteries channels to p1 meter#19389
Merged
lsiepel merged 9 commits intoopenhab:mainfrom Oct 21, 2025
Merged
Conversation
added 2 commits
September 26, 2025 08:55
Signed-off-by: Gearrel Welvaart <gearrel.welvaart@gmail.com>
Signed-off-by: Gearrel Welvaart <gearrel.welvaart@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds battery management channels to the P1 meter device to support HomeWizard Plug-In Battery control. The implementation introduces API v2 support with a bearer token for authentication and provides five new battery-related channels for monitoring and controlling battery systems.
Key Changes
- Added five new battery channels (mode, power, target_power, max_consumption, max_production) to the P1 meter
- Implemented API v2 support with bearer token authentication
- Refactored device handlers to use
handleMeasurementDataandretrieveDatanaming for clarity
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| HomeWizardP1MeterHandler.java | Added battery data retrieval and command handling for P1 meter |
| HomeWizardP1MeterBatteriesPayload.java | New DTO class for battery API response data |
| HomeWizardDeviceHandler.java | Refactored method names and added PUT request support for battery commands |
| HomeWizardBindingConstants.java | Added battery channel constants |
| hwe-p1.xml | Added battery channel group and updated thing version to 2 |
| update-hwe-p1.xml | New update instructions for adding battery channels to existing P1 meters |
| homewizard.properties | Added i18n labels for battery channels |
| README.md | Updated documentation with battery channel information |
| HomeWizardP1MeterHandlerTest.java | Added tests for battery channels with API v2 support |
| HomeWizardP1MeterBatteriesPayloadTest.java | New test class for battery payload deserialization |
| response-batteries-p1-meter.json | Test fixture with sample battery data |
| HomeWizardHandlerTest.java | Added CONFIG_V2 and battery channel helper methods |
| Various handler files | Updated method names for consistency across handlers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../openhab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterBatteriesPayload.java
Outdated
Show resolved
Hide resolved
...d/src/main/java/org/openhab/binding/homewizard/internal/devices/HomeWizardDeviceHandler.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: GearrelW <146448092+GearrelW@users.noreply.github.com>
…ab/binding/homewizard/internal/devices/HomeWizardDeviceHandler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: GearrelW <146448092+GearrelW@users.noreply.github.com>
…ab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterBatteriesPayload.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: GearrelW <146448092+GearrelW@users.noreply.github.com>
lsiepel
requested changes
Oct 20, 2025
Contributor
lsiepel
left a comment
There was a problem hiding this comment.
Looked at all files, left some minor comments to look at.
.../java/org/openhab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterHandler.java
Outdated
Show resolved
Hide resolved
.../java/org/openhab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.homewizard/src/main/resources/OH-INF/thing/hwe-p1.xml
Show resolved
Hide resolved
bundles/org.openhab.binding.homewizard/src/main/resources/OH-INF/thing/hwe-p1.xml
Show resolved
Hide resolved
…ab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterHandler.java Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: GearrelW <146448092+GearrelW@users.noreply.github.com>
…ab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterHandler.java Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: GearrelW <146448092+GearrelW@users.noreply.github.com>
Signed-off-by: Gearrel Welvaart <gearrel.welvaart@gmail.com>
Signed-off-by: Gearrel Welvaart <gearrel.welvaart@gmail.com>
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.
Extra channels were added to the p1 meter. These channels provide extra management for the batteries. In addition, some refactoring was done to the device handlers.