New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Energy Production CC sensors #93839
Add support for Energy Production CC sensors #93839
Conversation
Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
4ec1126
to
074cd36
Compare
(prev_value := event_data["args"]["prevValue"]) is not None | ||
and (new_value := event_data["args"]["newValue"]) is not None | ||
and prev_value > new_value | ||
and self.state_class == SensorStateClass.TOTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use this kind of check? Don't we know the time of last reset since it's called "today"? Otherwise maybe we should just use state class TOTAL_INCREASING
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today is relative to what the device thinks right? I have no way of knowing what today represents for the device at the moment. I will switch to TOTAL_INCREASING
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the device collects data for a certain time period I'd expect it to either report the time period or define the time period criteria so we can keep track of time ourselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, perhaps we can switch back to total later when we have a better understanding of how to get time. It would also be nice to get a device dump for a device that actually has this CC
074cd36
to
8aed69f
Compare
Proposed change
Adds support for Energy Production CC sensors in the
zwave_js
integration. Please review the state classes, particularly the use ofTOTAL
for today's energy production, which I wasn't 100% on.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
.To help with the load of incoming pull requests: