-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
ina2xx should be total increasing for energy sensor - #10711
#10711ina2xx should be total increasing for energy sensor#10711jesserockz merged 2 commits intoesphome:devesphome/esphome:devfrom mikelawrence:ina2xx-fix-energy-sensormikelawrence/esphome:ina2xx-fix-energy-sensorCopy head branch name to clipboard
Conversation
|
To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file: external_components:
- source: github://pr#10711
components: [ina2xx_base]
refresh: 1h(Added by the PR bot) |
|
👋 Hi there! This PR modifies 1 file(s) with codeowners. @latonita - As codeowner(s) of the affected files, your review would be appreciated! 🙏 Note: Automatic review request may have failed, but you're still welcome to review. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #10711 +/- ##
=======================================
Coverage 65.89% 65.89%
=======================================
Files 52 52
Lines 10560 10560
Branches 1416 1416
=======================================
Hits 6959 6959
Misses 3220 3220
Partials 381 381 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
If you want to test the PR you actually need this: external_components:
- source: github://pr#10711
components: [ina2xx_base, ina2xx_i2c, ina2xx_spi]
refresh: 1h |
|
I do not have access to a SPI version of this sensor to test but this PR should not care what interface you use. |
Given the files in the interface specific components have not changed, you shouldn't need to override them from this PR, they will load the external_component version of the |
What does this implement/fix?
The ina2xx component reports the
energysensor with device_class=energy and state_class=measurement. Home Assistant produces a warning on this.I think the
energysensor should be device_class=energy and state_class=total increasing.While looking at the component I think the
energy joulessensor is also reported incorrectly although it does not produce a warning because it is not declared with device class=energy. I think is should be the same as the energy sensor including state_class=total increasing.I also wonder that both of these sensors have an accuracy_decimals=8.
8 decimal places is equivalent to a resolution of 10 microwatt hr (10e-6) resolution for the
energysensor which is not too bad.8 decimal places for the
energy_joulessensor is a bit odd. There are 3.6e6 J in 1 kWh, 8 decimal places would divide that further for resolution of something around 2.8 femtowatt hr (2.8e-15).But maybe this is for a later PR...
Types of changes
Related issue or feature (if applicable):
No bug reports that I can find.
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml:Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed: