Skip to content

Conversation

@GearrelW
Copy link
Contributor

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.

Signed-off-by: Gearrel Welvaart <[email protected]>
@GearrelW GearrelW changed the title [homewizard] Added batteries channels to p1 meter [homewizard] Add batteries channels to p1 meter Sep 30, 2025
@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Oct 4, 2025
@lsiepel lsiepel requested a review from Copilot October 16, 2025 08:01
Copy link
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

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 handleMeasurementData and retrieveData naming 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.

GearrelW and others added 3 commits October 16, 2025 10:08
…ab/binding/homewizard/internal/devices/HomeWizardDeviceHandler.java

Co-authored-by: Copilot <[email protected]>
Signed-off-by: GearrelW <[email protected]>
…ab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterBatteriesPayload.java

Co-authored-by: Copilot <[email protected]>
Signed-off-by: GearrelW <[email protected]>
Copy link
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.

Looked at all files, left some minor comments to look at.

GearrelW and others added 4 commits October 20, 2025 20:37
…ab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterHandler.java

Co-authored-by: lsiepel <[email protected]>
Signed-off-by: GearrelW <[email protected]>
…ab/binding/homewizard/internal/devices/p1_meter/HomeWizardP1MeterHandler.java

Co-authored-by: lsiepel <[email protected]>
Signed-off-by: GearrelW <[email protected]>
Signed-off-by: Gearrel Welvaart <[email protected]>
Signed-off-by: Gearrel Welvaart <[email protected]>
Copy link
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 b93e7a0 into openhab:main Oct 21, 2025
2 checks passed
@lsiepel lsiepel added this to the 5.1 milestone Oct 21, 2025
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.

3 participants