Closed Kagey-cmd closed 1 week ago
Hey there @thomdietrich, mind taking a look at this feedback as it has been labeled with an integration (statistics
) you are listed as a code owner for? Thanks!
Hello @Kagey-cmd, I agree and this ability to freely overwrite the unit should be added. It is on my personal todo list of new additions to the component but I won't realistically attend to this soon. Contributions are always welcome!
In the meantime I suggest to add a template sensor "in front" of the statistics sensor.
That said, could you please re-check your issue? The "total" characteristic does not alter the unit_of_measurement taken from the source sensor. See: https://github.com/home-assistant/core/blob/0f90a3cf606e2665d9576b97f8709cb7e9d803c1/homeassistant/components/statistics/sensor.py#L156 Edit: Now I get it. Your hourly source sensor is in "in/hr", therefore, that unit is carried over. Got you. This is a good example for why this PR would make sense. Teaser: The correct unit would be "in/day" :-P
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Thank you for reaching out. We use GitHub for tracking issues, not for providing support or tracking feature requests.
If you want to suggest a feature, you should try our Community Forum: Feature Requests.
If you have additional questions, feel free to join our Discord chat server.
Thanks! 👍
Feedback
My use case: I've created a "Total" Statistics helper that gives me total precipitation over the previous 24 hours using hourly precipitation data from a weather integration. My issue: The resulting sum should have units [in.], not [in./hr], but I don't think there's a way to change that. I think this should be an option in the Statistics options UI.
URL
https://www.home-assistant.io/integrations/statistics/
Version
2024.8.2
Additional information
No response