Utility meter, add STATE_CLASS_TOTAL_INCREASING#54871
Conversation
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
|
Hey there @dgomes, mind taking a look at this pull request as it has been labeled with an integration ( |
dgomes
left a comment
There was a problem hiding this comment.
We should probably leave a test for when state_class is measurement
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
| "source": "sensor.energy", | ||
| }, | ||
| "gas_meter": { | ||
| "net_consumption": True, |
There was a problem hiding this comment.
Is this just for the test here? Because gas_meter should also get a status_class=STATE_CLASS_TOTAL_INCREASING shouldn't ?
There was a problem hiding this comment.
For all devices that can measure both decreasing and increasing values.
Changed it to energy_meter since it is more realistic to have an energy meter that can both increase and decrease.
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
There was a problem hiding this comment.
Thanks, @Danielhiversen 👍
One thing I wonder, should we mark this as a breaking change?
I know it isn't, as the default net_comsumption isn't changed. But I can imaging a lot of people are using this currently without that setting... (and thus this might be unexpected behavior).
If so, lets add the breaking-change label and add a breaking changes section. Maybe mentioning it saves a bit of comments/unexpected behaviors with users.
I think we should fix this by setting the proper state_class depending on the net_consumption config option |
|
I like that suggestion even beter 👍 |
|
What is the proper state_class ? If |
Good question, I guess this is mainly about backward compatibility to reduce the number of breaking changes. |
|
I do not see any better way to solve this. (Without reintroduce STATE_CLASS_TOTAL ) |
|
Can we reintroduce the STATE_CLASS_TOTAL without reintroducing the Edit: It's not fully clear why the |
|
Currently, I do not see any better option than using |
|
@Danielhiversen Right. Are you aware of any realistic real world examples of meters which measure a net consumption, for example the sum of imported and exported energy in terms of electricity, and also periodically resets? |
|
No, so for me the current pull request is fine :) |
We can ask the author of #21204 But until recently in Portugal the same thing happened (we are changing meters country wide as we discuss this) old meters would run backwards. So I guess they are still out there for some of our users |
|
@emontnemery Do you plan to finish #55103 before the beta cut? |
@Danielhiversen That will not be in the beta. At this point we are undecided. 2021.9 will have some additional information to index the needs for these things. |
|
Ok, then I suggest merging this as it is. |
|
@Danielhiversen Although #55103 will not be merged now, #55136 has been merged. |
Signed-off-by: Daniel Hjelseth Høyer github@dahoiv.net
Breaking change
Proposed change
Utility meter, add STATE_CLASS_TOTAL_INCREASING
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: