ha-sankey-chart icon indicating copy to clipboard operation
ha-sankey-chart copied to clipboard

Feature - Support Entity Groups

Open XtremeOwnageDotCom opened this issue 1 year ago • 5 comments

So, I have been having great success using this to plot my home's energy utilization from source, to consumer.

image

image

However, while I have been making these diagrams- I thought of a way which would make this much nicer. The ability to configure things using groups.

Say, for example, instead of this:

  - entities:
      - entity_id: sensor.load_power_essential
        color: blue
        children:
          - sensor.bedroom_power
          - sensor.lights_power
          - sensor.server_power
      - entity_id: sensor.load_power_non_essential
        color: yellow
        children:
          - sensor.dishwasher_power
          - sensor.dryer_power
          - sensor.garage_power
          - sensor.kitchen_power
          - sensor.livingroom_power
          - sensor.hvac_total_power
          - sensor.noncritical_other_loads
          - untracked
  - entities:
      - entity_id: sensor.server_power
        color: plum
        children:
          - sensor.kube01_current_consumption
          - sensor.kube05_current_consumption
          - sensor.kube06_current_consumption
          - sensor.unifi_aggregation_switch_current_consumption
          - sensor.nvr_current_consumption
          - sensor.kasa_smart_plug_383a_2_current_consumption
          - sensor.truenas_power
          - Server - Other
      - entity_id: sensor.bedroom_power
        name: Office
        color: LightBlue
        children:
          - sensor.gaming_pc_current_consumption
          - sensor.wife_pc_current_consumption
          - sensor.monitors_current_consumption
          - sensor.internet_current_consumption
          - sensor.work_pc_current_consumption
          - sensor.bedroom_switch_current_consumption
          - Office - Other

We could specify this:

  - entities:
      - entity_id: sensor.load_power_essential
        color: blue
        remaining: untracked_critical
        children_group: group.power_rollup_load_power_essential
      - entity_id: sensor.load_power_non_essential
         children_group: group.power_rollup_load_power_non_essential
  - entities:
      - entity_id: sensor.server_power
        color: plum
        children_group: group.power_rollup_server
        children_group_remaining: 
            name: Server - Other
      - entity_id: sensor.bedroom_power
        name: Office
        color: LightBlue
        children_group: group.power_rollup_office_essential
        children_group_remaining: 
            name: Office - Other

If, such a thing were feasible, it would make it easily possible to reuse the groups for other dashboard panels as well.

Lastly, I think this would improve the overall usability, and reduce the amount of configuration required. Potentially.

Just- an idea.

XtremeOwnageDotCom avatar Mar 18 '23 17:03 XtremeOwnageDotCom

Interesting idea. I'll have think about this

MindFreeze avatar Mar 18 '23 17:03 MindFreeze

@MindFreeze "The ability to configure things using groups." As an addition, maybe having the grouping done based on area (if configured) might be an idea as well.

bartgrefte avatar Oct 01 '23 16:10 bartgrefte

Area makes more sense than groups tbh. According to HA groups are meant to combine entities and get an aggregate state, not just to organize stuff. You are supposed to organize based on areas and entity types.

I already do this with areas for autoconfig but there I already have a list of devices and just group them by area. Starting from an area and figuring out which entities to display will be more difficult

MindFreeze avatar Oct 01 '23 18:10 MindFreeze

If you go with areas, make sure you add functionality to apply filtering logic, like custom:auto-entities.

Otherwise, picking out the specific entities you are wanting to plot, can be challenging.

That being said- i'd still lean towards being able to use groups, as it gives very granular control to the user.

XtremeOwnageDotCom avatar Oct 01 '23 18:10 XtremeOwnageDotCom

Agree with leveraging areas; I have really leand into using them for various things.

So it is was in the Sankey I could then see it broken down by room (Area) and then to the individual consumers.

BradleyFord avatar Oct 03 '23 05:10 BradleyFord

Maybe the new(-ish) labels could be used for groupings?

mvdwetering avatar May 10 '24 11:05 mvdwetering

Maybe the new(-ish) labels could be used for groupings?

That would be a fantastic idea.

XtremeOwnageDotCom avatar May 10 '24 12:05 XtremeOwnageDotCom