Anyone using the Sankey Chart Card?

That did the trick … completed missed it…

Thanks

Has anyone been able to get the autoconfigure to work?

My Energy Distribution has a fair start, so I thought it would work well with autoconfigure.

However, when I try the code from the Sankey Chart Card github page;

- type: custom:sankey-chart
  # ...any other options
  autoconfig:
    print_yaml: true # optional
    # any additional autoconfig options (listed below)

All that I get is;

Here is what it looks like in edit mode;

I’m looking to take advantage of the print_yaml that “Prints the auto generated configuration after the card so you can use it as a starting point for customization.”

Does anyone have this working, and if so, where am I messing up?

i did the same thing and used the printed yaml. worked fine. let me try a new one.

Edit.
It worked fine again.
new card, sankey, enable print yaml, save. that’s it

I don’t have a battery or low carbon FYI

1 Like

I’m trying to show how consumption splits into the categories of Transportation (EV charging) and Home (residence), the latter of which splits into Space Heating, Kitchen, and later others once I get some of it working.

So far, the entities are showing up, though no lines are visible.

type: custom:sankey-chart
title: Realtime Energy
show_names: true
min_box_height: 8
height: 500
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.grid_import
        name: Grid Import
        color: ‘#4F00C0C’
        children:
          - entity_id: sensor.load_consumed_energy
      - entity_id: sensor.solaroutneg_wh
        name: Solar Energy
        color: '#e0b400'
        children:
          - entity_id: sensor.load_consumed_energy
          - entity_id: sensor.grid_export
      - entity_id: whatever321
        type: remaining_parent_state
        name: OtherInputs
  - entities:
      - entity_id: sensor.load_consumed_energy
        name: Total Load Consumption
      - entity_id: sensor.grid_export
        name: Grid Export
        children:
          - entity_id: sensor.transportation_consumption
          - entity_id: sensor.home
        remaining:
          name: Unmonitored
      - entity_id: Other-Consumption
        type: remaining_parent_state
        name: Other-Consumption
  - entities:
      - entity_id: sensor.transportation_consumption
        name: Transportation
        children:
          - entity_id: sensor.120v_ev_charger_total_daily_energy
          - entity_id: sensor.juicebox_energy_added
      - entity_id: sensor.home
        name: Home
        children:
          - entity_id: sensor.kitchen_load
      - entity_id: IntermediateUnmonitored
        type: remaining_parent_state
        name: Intermediate Unmonitored
  - entities:
      - entity_id: sensor.120v_ev_charger_total_daily_energy
        name: Clarity Charger
      - entity_id: sensor.juicebox_energy_added
        name: Soul Charger
      - entity_id: sensor.kitchen_load
        name: Kitchen Load
        children:
          - entity_id: sensor.refrigerator_total_daily_energy
          - entity_id: sensor.dishwasher_total_daily_energy
      - entity_id: UnmonitoredEnergy
        type: remaining_parent_state
        name: OtherUnmonitored
  - entities:
      - entity_id: sensor.refrigerator_total_daily_energy
        name: Refrigerator
      - entity_id: sensor.dishwasher_total_daily_energy
        name: Dishwasher
      - entity_id: RemainingEnergy
        type: remaining_parent_state
        name: OtherRemaining

Any mistakes jump out at anyone?

And I have tried multiple approaches to getting passthrough working;

  1. Default (no explicit entry)

  2. Adding passthrough entries in the column they are to ‘passthrough’

  3. Labeling them as passthrough in the final ‘leaf’ column (didn’t expect this to work but tried it anyway.

Currently the most recent code for the Sankey chart (below) that follows #2 approach above has the following error (though the juicebox sensor exists, is populated, ahd has been showing up);

Error: Invalid entity config {“type”:“passthrough”,“children”:[{“entity_id”:“sensor.juicebox_energy_added”}],“entity_id”:“sensor.juicebox_energy_added”}

type: custom:sankey-chart
title: Energy Categories
show_names: true
min_box_height: 8
height: 500
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.grid_import
        name: Grid Import
        color: ‘#4F00C0C’
        children:
          - entity_id: sensor.load_consumed_energy
      - entity_id: sensor.solaroutneg_wh
        name: Solar Energy
        color: '#e0b400'
        children:
          - entity_id: sensor.load_consumed_energy
          - entity_id: sensor.grid_export
      - entity_id: whatever321
        type: remaining_parent_state
        name: OtherInputs
  - entities:
      - entity_id: sensor.load_consumed_energy
        name: Total Load Consumption
      - entity_id: sensor.grid_export
        name: Grid Export
        children:
          - entity_id: sensor.transportation_consumption
          - entity_id: sensor.home
        remaining:
          name: Unmonitored
      - entity_id: Other-Consumption
        type: remaining_parent_state
        name: Other-Consumption
  - entities:
      - entity_id: sensor.transportation_consumption
        name: Transportation
        children:
          - entity_id: sensor.120v_ev_charger_total_daily_energy
          - entity_id: sensor.juicebox_energy_added
      - entity_id: sensor.home
        name: Home
        children:
          - entity_id: sensor.kitchen_load
          - entity_id: sensor.space_heating
      - entity_id: IntermediateUnmonitored
        type: remaining_parent_state
        name: Intermediate Unmonitored
  - entities:
      - entity_id: sensor.juicebox_energy_added
        type: passthrough
        children:
          - entity_id: sensor.juicebox_energy_added
      - entity_id: sensor.120v_ev_charger_total_daily_energy
        type: passthrough
        children:
          - entity_id: sensor.120v_ev_charger_total_daily_energy
      - entity_id: sensor.kitchen_load
        name: Kitchen Load
        children:
          - entity_id: sensor.refrigerator_total_daily_energy
          - entity_id: sensor.dishwasher_total_daily_energy
      - entity_id: sensor.space_heating
        name: Space Heating
      - entity_id: UnmonitoredEnergy
        type: remaining_parent_state
        name: OtherUnmonitored
  - entities:
      - entity_id: sensor.juicebox_energy_added
        name: Level 2 Charger
      - entity_id: sensor.120v_ev_charger_total_daily_energy
        name: Level 1 Charger
      - entity_id: sensor.refrigerator_total_daily_energy
        name: Refrigerator
      - entity_id: sensor.dishwasher_total_daily_energy
        name: Dishwasher
      - entity_id: sensor.heat_pump_kwh
        name: Heat Pump
      - entity_id: sensor.furnace_kwh
        name: Furnace
      - entity_id: RemainingEnergy
        type: remaining_parent_state
        name: OtherRemaining

Please tell me what am I missing?

Update to above, determined and resolved the issue. See Update 2 for further issues.

I had incorrectly listed children entities starting with “entity_id:” which is incorrect. My chart now on this mostly rainy/cloudy/snowy day with the woodstove going;

image

Associated code;

type: custom:sankey-chart
title: Energy Categories
show_names: true
min_box_height: 8
height: 500
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.grid_import
        name: Grid Import
        color: purple
        children:
          - sensor.load_consumed_energy
      - entity_id: sensor.solaroutneg_wh
        name: Solar Energy
        color: '#e0b400'
        children:
          - sensor.load_consumed_energy
          - sensor.grid_export
      - entity_id: whatever321
        type: remaining_parent_state
        name: OtherInputs
  - entities:
      - entity_id: sensor.load_consumed_energy
        name: Total Load Consumption
        children:
          - sensor.transportation_consumption
          - sensor.home_load
      - entity_id: sensor.grid_export
        name: Grid Export
      - entity_id: Other-Consumption
        type: remaining_parent_state
        name: Other-Consumption
  - entities:
      - entity_id: sensor.transportation_consumption
        name: Transportation
        children:
          - sensor.120v_ev_charger_total_daily_energy
          - sensor.juicebox_energy_added
      - entity_id: sensor.home_load
        name: Home
        children:
          - sensor.kitchen_load
          - sensor.space_heating
      - entity_id: IntermediateUnmonitored
        type: remaining_parent_state
        name: Intermediate Unmonitored
  - entities:
      - entity_id: sensor.juicebox_energy_added
        type: passthrough
        children:
          - sensor.juicebox_energy_added
      - entity_id: sensor.120v_ev_charger_total_daily_energy
        type: passthrough
        children:
          - sensor.120v_ev_charger_total_daily_energy
      - entity_id: sensor.kitchen_load
        name: Kitchen
        children:
          - sensor.refrigerator_total_daily_energy
          - sensor.dishwasher_total_daily_energy
      - entity_id: sensor.space_heating
        name: Space Heating
        children:
          - sensor.heat_pump_kwh
          - sensor.furnace_kwh
      - entity_id: UnmonitoredEnergy
        type: remaining_parent_state
        name: OtherUnmonitored
  - entities:
      - entity_id: sensor.juicebox_energy_added
        name: Level 2 Charger
      - entity_id: sensor.120v_ev_charger_total_daily_energy
        name: Level 1 Charger
      - entity_id: sensor.refrigerator_total_daily_energy
        name: Refrigerator
      - entity_id: sensor.dishwasher_total_daily_energy
        name: Dishwasher
      - entity_id: sensor.heat_pump_kwh
        name: Heat Pump
      - entity_id: sensor.furnace_kwh
        name: Furnace
      - entity_id: RemainingEnergy
        type: remaining_parent_state
        name: OtherRemaining

Now I can proceed adding all the other appliances and circuits I am (and will be) tracking, as well as figuring out the right was to use remaining_parent_state.

Update 2: Alas, the inability to create daily-resetting energy entities seems to be messing up the daily values in the chart. And changing a template from kWh to Wh to get all the algorithm components in the same measurement unit doesn’t seem to actually change the range, it just messes up the value. For example, Transportation_Consumption should be 22Wh instead of 22,000 Wh, which the History shows, which is not reflected in the value in the chart.

So I will likely have to start from scratch if I ever find a way to create daily-resetting energy entities, and advise anyone looking at my chart code above to avoid relying on it for hints and clues.

is there a way to combine 2 separate parts?
my dryer for example, is 240v so uses both lines. it would be great for it to show half from Line1 half from Line 2

You can have it as a child of both but it won’t be split in half. It will be mostly random.
You can create 2 templates in HA “Dryer half 1” & “Dryer half 2” and have “Dryer” as a child of those but that would add new layer where the halves are combined.
Once #8 is done you would be able to do this without an extra layer but you would still need the template entities to say how much comes from each line.

yeah, the visual there, where its selected as a child for each, isnt clear. it makes Other1 small, and leaves the Other2 big (instead of equal out of both) so i ended up creating 2 new entities for each in iotawatt (same idea as the template sensor).

so now i have Line 1, Line 2, BothLines 240v. and then now that subtract works, i subtracted the half of each from both of the Others, and uses the full entity under BothLines

i think you are right about #8 but for now my solution seems to look and feel fine. thanks for the reply. wasnt sure if there was some better way to do it.

Success! After a number of trial and error attempts, I noticed the card I had tried the Autoconfig with now showed a good bit of data (no longer simply failing);

Upon examination of the yaml code, I picked up a number of very helpful hints. While the grid import and export did not show up correctly, I figured out how to adjust those. One template calculation I added is
sensor.total_energy_consumed

And instead of arranging my loads by area, I arranged them by function;

height: 450
show_names: true
unit_prefix: k
round: 1
min_box_height: 3
min_box_distance: 5
show_states: true
show_units: true
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.solaroutneg_wh
        type: entity
        name: Solar Generation
        color: var(--warning-color)
        children:
          - sensor.total_energy_consumed
          - sensor.export_wh
      - entity_id: sensor.grid_import
        type: entity
        name: Grid Import
        color: maroon
        children:
          - sensor.total_energy_consumed
  - entities:
      - entity_id: sensor.export_wh
        type: entity
        color: purple
        name: Grid Export
        children: []
      - entity_id: sensor.total_energy_consumed
        type: remaining_parent_state
        name: Total Consumption
        color: darkblue
        children:
          - transportation
          - space_heating
          - water_supply
          - kitchen
          - offices
          - studio
          - lighting
          - laundry
          - entertainment
          - unknown
  - entities:
      - entity_id: transportation
        type: remaining_child_state
        color: blue
        name: Transportation
        children:
          - sensor.120v_ev_charger_total_daily_energy
          - sensor.juicebox_energy_added
      - entity_id: space_heating
        type: remaining_child_state
        color: green
        name: Space Heating
        children:
          - sensor.heatpump_wh
          - sensor.furnace_wh
          - sensor.air_filter_energy
      - entity_id: water_supply
        type: remaining_child_state
        name: Water Supply
        color: green
        children:
          - sensor.test3_wh
      - entity_id: kitchen
        type: remaining_child_state
        color: green
        name: Kitchen
        children:
          - sensor.kitchen_ceiling_dimmer_2_energy
          - sensor.refrigerator_energy
          - sensor.dishwasher_total_daily_energy
      - entity_id: offices
        type: remaining_child_state
        color: green
        name: Offices
        children:
          - sensor.annoffice_wh
          - sensor.work_office_total_daily_energy
          - sensor.study_electronics_total_daily_energy
      - entity_id: studio
        type: remaining_child_state
        color: green
        name: Studio
        children:
          - sensor.studioplugs_wh
          - sensor.studio_musician_lights_energy_2
      - entity_id: lighting
        type: remaining_child_state
        color: green
        name: Other Lighting
        children:
          - sensor.front_porch_lights_energy
          - sensor.back_porch_light_energy
          - sensor.master_bath_light_energy
          - sensor.studio_landing_light_energy
          - sensor.side_porch_light_energy
      - entity_id: laundry
        type: remaining_child_state
        color: green
        name: Laundry
        children:
          - sensor.clothes_dryer_energy
      - entity_id: entertainment
        type: remaining_child_state
        color: green
        name: Entertainment
        children:
          - sensor.family_room_tv_energy_2
      - entity_id: unknown
        type: remaining_parent_state
        color: gray
        name: Not Yet Monitored
        children: []
  - entities:
      - entity_id: sensor.120v_ev_charger_total_daily_energy
        type: entity
        name: Level 1 Charger
        color: blue
        children: []
      - entity_id: sensor.juicebox_energy_added
        type: entity
        name: Level 2 Charger
        color: blue
        children: []
      - entity_id: sensor.heatpump_wh
        type: entity
        name: Heat Pump
        color: green
      - entity_id: sensor.furnace_wh
        type: entity
        name: HVAC Blower
        color: green
      - entity_id: sensor.air_filter_energy
        name: Air Filter
        type: entity
        color: green
      - entity_id: sensor.test3_wh
        type: entity
        name: Well Pump
        color: green
      - entity_id: sensor.kitchen_ceiling_dimmer_2_energy
        type: entity
        name: Kitchen Lights
        color: green
      - entity_id: sensor.dishwasher_total_daily_energy
        type: entity
        name: Dishwasher
        color: green
      - entity_id: sensor.refrigerator_energy
        type: entity
        name: Refrigerator
        color: green
      - entity_id: sensor.annoffice_wh
        type: entity
        name: Work Office 1
        color: green
      - entity_id: sensor.work_office_total_daily_energy
        type: entity
        name: Work Office 2
        color: green
      - entity_id: sensor.study_electronics_total_daily_energy
        type: entity
        name: Study
        color: green
      - entity_id: sensor.studioplugs_wh
        type: entity
        name: Studio
        color: green
      - entity_id: sensor.studio_musician_lights_energy_2
        type: entity
        name: Studio Lights
        color: green
        children: []
      - entity_id: sensor.front_porch_lights_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.back_porch_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.master_bath_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.studio_landing_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.side_porch_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.clothes_dryer_energy
        type: entity
        name: Clothes Dryer
        color: green
      - entity_id: sensor.family_room_tv_energy_2
        type: entity
        name: Family Room TV
        color: green
type: custom:sankey-chart
min_state: 0

I’ll be adding more sensors to chase down other yet-unmonitored consumption. And I will see if I can add another layer for Home for a clean classification to provide the Home and Transportation categories

The monthly view checks out well;

I very much appreciate the efforts that @MindFreeze has undertaken to provide this capability!

1 Like

I’ve updated the chart to cleanly delineate what is Transportation and what is Home energy consumption, to see how close I am to residential net-zero (or beyond). Still have some circuits/outlets to meter/monitor and may still find some phantom loads (or ones requiring better oversight). This is a very helpful tool to keep track of electrical energy consumption, can’t say enough nice things about what @MindFreeze has done with this specialty chart!

We had been painted indoors that day, so the Heat Recovery Ventilator was on high for about 48 hours, otherwise just comes on low about an hour every day.

2 Likes

Card works ok when using energy, no matter if 3 of 5 sections.
But when using power the connections get lost quite often.
I’m not yet sure if that’s a result that the card isn’t catching up state changes in time or something like that. I doubt this being the case since the machine idles more or less means it’s surely not related to an extensice load. Any chance one could force the card checking values? Sort of an update_interval as known from ESPhome sensors?

Values are always updated but the client browser can get overloaded with frequent updates and stutter. Try using the throttle option to limit updates.

1 Like

ups … that was an easy one, it solved the issue straight.
May I ask another thing.Would you mind updating the readme on github? I recently stumbled across a “remaining:” which I wasn’t aware of simply because not being documented. The one to be placed right below the chidrens.
I do fear I likely missed all the 99 dead cool options which are undocumented aswell :grinning_face_with_smiling_eyes:

Remaining is deprecated and will be removed in a future version. Only works for backwards compatibility. type: remaining_parent_state is the correct way of doing the same thing.

Love this card and this thread has been very helpful to getting this far. One frustrating issue I cannot seem to overcome is color blending and how to make sure the final entities carry the correct color from the parent. No matter what I do, I can’t seem to alter the final blue color and this results in some harsh lines which you can see most clearly in the ‘Second Floor Load’ branch. Anyone have this issue or know what might be causing it? Thank you in advance!

show_names: true
height: 600
unit_prefix: k
round: 2
wide: true
sections:
  - entities:
      - entity_id: sensor.totalpower
        name: Grid Consumption
        color: '#e45e65'
        remaining:
          name: Other
        children:
          - sensor.totalac
          - sensor.secondfl_load
          - sensor.firstfl_load
          - sensor.basement_load
          - sensor.apt_load
  - entities:
      - entity_id: sensor.totalac
        name: Air Conditioner Load
        color: '#e4a15e'
        children:
          - sensor.ac_1
          - sensor.air_handler_1
          - sensor.ac_2
          - sensor.air_handler_2
  - entities:
      - entity_id: sensor.secondfl_load
        name: Second Floor Load
        color: '#e4a15e'
        remaining:
          name: Other
        children:
          - sensor.second_floor
          - sensor.sub_pool_floorheat
  - entities:
      - entity_id: sensor.firstfl_load
        name: First Floor Load
        color: '#ff2bf8'
        children:
          - sensor.laundry_primary
          - sensor.kitchen_w_livingroom
          - sensor.kitchen_apps_dining
          - sensor.kitchendw_dinette
  - entities:
      - entity_id: sensor.kitchen_w_livingroom
        name: First Floor West
        color: '#ff2bf8'
        remaining:
          name: Fridge
        children:
          - sensor.living_room_media_plug_power
  - entities:
      - entity_id: sensor.basement_load
        name: Basement Load
        color: '#a6bfbb'
        children:
          - sensor.navien
  - entities:
      - entity_id: sensor.apt_load
        name: Apartment Load
        color: '#54b1f7'
        children:
          - sensor.apartment
  - entities:
      - sensor.apartment
      - sensor.ac_1
      - sensor.air_handler_1
      - sensor.ac_2
      - sensor.air_handler_2
      - sensor.second_floor
      - sensor.sub_pool_floorheat
      - sensor.laundry_primary
      - sensor.living_room_media_plug_power
      - sensor.kitchen_apps_dining
      - sensor.kitchendw_dinette
      - sensor.navien

You just have to specify color for all relevant entities. So use the long form with entity_id: and color: instead of just listing the entity id.
Also everyone please stop using remaning:. It is deprecated. Use type: remaining_parent_state instead. There are examples in the README.

2 Likes

Since you re-newed the information about remaining: (I removed it straight after your recently given explanation) 2 times within 1 week :slight_smile: , may I suggest you mention this on your github, best bet using RED BOLD text saying deprecated or something like that?
Poeple like me tend to a) read the options but also b) look in here for example YAML to get started.

Thank you, appreciate the reply! Incredible work on this. I grabbed ‘remaining’ from earlier messages in this thread without checking the docs on it so thanks for that too.

Updated chart looks much better.

type: custom:sankey-chart
show_names: true
height: 600
unit_prefix: k
round: 2
wide: true
sections:
  - entities:
      - entity_id: sensor.totalpower
        name: Grid Consumption
        color: '#e45e65'
        children:
          - sensor.totalac
          - sensor.secondfl_load
          - sensor.firstfl_load
          - sensor.basement_load
          - sensor.apt_load
          - sensor.balance
  - entities:
      - entity_id: sensor.totalac
        name: Air Conditioner Load
        color: '#e4a15e'
        children:
          - sensor.ac_1
          - sensor.air_handler_1
          - sensor.ac_2
          - sensor.air_handler_2
      - entity_id: sensor.secondfl_load
        name: Second Floor Load
        color: '#e4a15e'
        children:
          - sensor.second_floor
          - sensor.sub_pool_floorheat
      - entity_id: sensor.firstfl_load
        name: First Floor Load
        color: '#ff2bf8'
        children:
          - sensor.laundry_primary
          - sensor.kitchen_w_livingroom
          - sensor.kitchen_apps_dining
          - sensor.kitchendw_dinette
      - entity_id: sensor.basement_load
        name: Basement Load
        color: '#a6bfbb'
        children:
          - sensor.navien
      - entity_id: sensor.apt_load
        name: Apartment Load
        color: '#54b1f7'
        children:
          - sensor.apartment
  - entities:
      - entity_id: sensor.kitchen_w_livingroom
        name: First Floor West
        color: '#ff2bf8'
        children:
          - sensor.living_room_media_plug_power
  - entities:
      - entity_id: sensor.apartment
        color: '#54b1f7'
      - entity_id: sensor.ac_1
        color: '#e4a15e'
      - entity_id: sensor.air_handler_1
        color: '#e4a15e'
      - entity_id: sensor.ac_2
        color: '#e4a15e'
      - entity_id: sensor.air_handler_2
        color: '#e4a15e'
      - entity_id: sensor.second_floor
        color: '#e4a15e'
      - entity_id: sensor.sub_pool_floorheat
        color: '#e4a15e'
      - entity_id: sensor.laundry_primary
        color: '#ff2bf8'
      - entity_id: sensor.living_room_media_plug_power
        color: '#ff2bf8'
      - entity_id: sensor.kitchen_apps_dining
        color: '#ff2bf8'
      - entity_id: sensor.kitchendw_dinette
        color: '#ff2bf8'
      - entity_id: sensor.navien
        color: '#a6bfbb'
      - entity_id: sensor.balance
        color: '#e45e65'
        name: Unaccounted

Hi all,

Managed to get a basic energy flow Sankey chart working, however I cannot get the Energy Date Selection aspect to work. It works fine in HA’s energy dashboard, but the Sankey chart will only show today’s figures, clicking back a day or two does nothing.

Any ideas appreciated.