Skip to content

Fix powerwall data incompatibility with energy integration#67245

Merged
frenck merged 4 commits intohome-assistant:devfrom
bdraco:powerwall_reject_transient_errors
Feb 25, 2022
Merged

Fix powerwall data incompatibility with energy integration#67245
frenck merged 4 commits intohome-assistant:devfrom
bdraco:powerwall_reject_transient_errors

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Feb 25, 2022

Breaking change

Powerwall import and export sensors are reported now reported as positive values since any negative values are not compatible with state class total increasing. This is being reverted in #67300

Fixes

2022-02-25 18:35:21 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.powerwall_site_export from integration powerwall has state class total_increasing, but its state is negative. Triggered by state -47025.4 with last_updated set to 2022-02-25T18:29:59.999999+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+powerwall%22
2022-02-25 18:35:21 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.powerwall_site_import from integration powerwall has state class total_increasing, but its state is negative. Triggered by state -33046.6 with last_updated set to 2022-02-25T18:29:59.999999+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+powerwall%22

When a value of 0 is reported, we now reject the data by reporting the state as unavailable. These are likely read failures.

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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • 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
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

Fixes #67237

@probot-home-assistant
Copy link
Copy Markdown

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

@bdraco bdraco changed the title Reject powerwall data with transient errors Fix powerwall data incompatibility with energy integration Feb 25, 2022
@frenck frenck merged commit 3f16c6d into home-assistant:dev Feb 25, 2022
bdraco added a commit to bdraco/home-assistant that referenced this pull request Feb 26, 2022
While this fixed
```
2022-02-25 18:35:21 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.powerwall_site_export from integration powerwall has state class total_increasing, but its state is negative. Triggered by state -47025.4 with last_updated set to 2022-02-25T18:29:59.999999+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+powerwall%22
2022-02-25 18:35:21 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.powerwall_site_import from integration powerwall has state class total_increasing, but its state is negative. Triggered by state -33046.6 with last_updated set to 2022-02-25T18:29:59.999999+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+powerwall%22
```

This change broke net returned to grid.  All battery energy is now showing
returned to grid.  It appears the frontend expects negative values but the
datebase warns on them.  Revert this change until more research can be done
to determine a better solution.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.