Skip to content

Add production power sensor that is compatible with the energy power dashboard for supported homewizard devices#159500

Merged
frenck merged 3 commits into
devfrom
homewizard-power-profile-settings
Dec 29, 2025
Merged

Add production power sensor that is compatible with the energy power dashboard for supported homewizard devices#159500
frenck merged 3 commits into
devfrom
homewizard-power-profile-settings

Conversation

@jbouwh
Copy link
Copy Markdown
Contributor

@jbouwh jbouwh commented Dec 20, 2025

Proposed change

For Home Wizard Energy devices that have a power sensor, this sensor is behaving positive values if the device is consuming, and negative values if the device is generating. Except for the P1 adapter, other devices are mainly for monitoring internal power.
The Home Assistant energy dashboard allows to visualize power generation and usage.
Consuming devices should supply a positive power sensor if a device is added to that category.
Generating devices, like home batteries and solar panels should be considered as a power source. The power sensor value should be positive value for the generated power.

This PR allows adds a production power sensor for supported devices, The production power sensor for plugin batteries is added by default. For energy monitoring devices the production power sensor will be disabled by default or the total energy export is 0.

Users can use the production sensor on the energy dashboard for the power generating devices, such as batteries or solar panels.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @DCSBL, mind taking a look at this pull request as it has been labeled with an integration (homewizard) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homewizard can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign homewizard Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@jbouwh jbouwh marked this pull request as draft December 20, 2025 11:11
@jbouwh jbouwh force-pushed the homewizard-power-profile-settings branch from 6a9cf4f to 486b728 Compare December 20, 2025 18:51
@jbouwh jbouwh changed the title WIP: Allow to (re)configure if the homewizard device is a power source or consumer to make the power sensor compatible with the energy power dashboard WIP: Add production power sensor that is compatible with the energy power dashboard for supported homewizard devices Dec 20, 2025
Comment thread homeassistant/components/homewizard/sensor.py
Comment thread homeassistant/components/homewizard/sensor.py Outdated
@jbouwh jbouwh changed the title WIP: Add production power sensor that is compatible with the energy power dashboard for supported homewizard devices Add production power sensor that is compatible with the energy power dashboard for supported homewizard devices Dec 22, 2025
@jbouwh jbouwh requested a review from DCSBL December 22, 2025 15:53
@jbouwh jbouwh marked this pull request as ready for review December 22, 2025 15:53
Copy link
Copy Markdown
Contributor

@DCSBL DCSBL left a comment

Choose a reason for hiding this comment

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

Looks great, Thanks! 🎄

Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @jbouwh 👍

../Frenck

@frenck frenck merged commit 7931cb4 into dev Dec 29, 2025
36 checks passed
@frenck frenck deleted the homewizard-power-profile-settings branch December 29, 2025 09:46
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HomeWizard plugin battery show negative power when discharing while enery panel expects a positive value instead

3 participants