-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support for hierarchy of individual energy devices #23185
base: dev
Are you sure you want to change the base?
Conversation
@MindFreeze - saw you were also working on some energy charts, was curious if you think this is a worthwhile idea or would be something you're interested in leveraging as well. |
I would definitely leverage this in a Sankey Chart if we have it. We have even discussed something like this for the future. We'll need to review it from a UX perspective though |
I haven't added it yet, but would probably just add a select selector in the device configuration dialog, to select one of the other devices (and filter it to prevent from selecting a cyclic loop). |
We could also link a power entity this way |
For what purpose? |
To display real time power consumption. There is a WTH thread for this. |
Proposed change
When adding individual devices to energy configuration, allow an entry to designate another entry as its parent. This will have the following effects:
Consider the following example, which has a montior on the breaker, but also monitors on individual items downstream of the breaker. In the current implementation the child items would be double counted, significantly throwing off the untracked calculation, and making the total height of the energy stack much higher than the true consumption.
With this change they would be "nested" within the parent item, and therefore the remaining area of each parent item then becomes the "untracked energy" remaining in that parent, or the energy not consumed by known tracked children.
I realize the actual visualization of the hierarchy is a bit weak here, there may be additional options in chartjs to improve this, or maybe can do something in the tooltip, not sure yet.
This also works for >1 level nesting, so you could have breaker -> smart power strip -> individual item if you wanted.
There hasn't been any work done yet on visualizing this for the summary bar graph, but that doesn't strictly need to be implemented for this to be correct. Could do more in the future.
This has still a bit more work to do polishing the configuration UI, but just wanted an early feedback if this is something of interest.
Type of change
Example configuration
Additional information
This PR fixes or closes issue: fixes #
This PR is related to issue or discussion:
https://community.home-assistant.io/t/energy-enable-nested-devices/327537
https://community.home-assistant.io/t/wth-does-ha-not-support-nesting-energy-sensors/805624
https://community.home-assistant.io/t/wth-why-cant-i-nest-energy-consumption/803993
Link to documentation pull request:
Checklist
If user exposed functionality or configuration variables are added/changed: