Anyone using the Sankey Chart Card?

Finally managed to make the Sankey chart work with auto config (took some time changing the area of the energy sensors to something meaningfull).

Now only challenge I would expect an additional level before power consumption and an additional lower level called “energy delivered to grid” or something. So at “first level” the sensors “sensor.p1_meter_3c39e72bf1a4_total_power_import” and “sensor.solaredge_lifetime_energy” and at the utmost right level the sensor “sensor.p1_meter_3c39e72bf1a4_total_power_export”

Any thoughts on how to achieve that?

Relevant yaml:

height: 600
unit_prefix: k
round: 1
min_box_height: 3
min_box_distance: 5
show_states: true
show_units: true
sort_group_by_parent: true
sort_dir: desc
sort_by: state
sections:
  - entities:
      - type: entity
        children:
          - sensor.p1_meter_3c39e72bf1a4_total_power_export_t2
          - sensor.p1_meter_3c39e72bf1a4_total_power_export_t1
          - total
        entity_id: sensor.solaredge_lifetime_energy
        color: var(--warning-color)
      - type: entity
        children:
          - sensor.p1_meter_3c39e72bf1a4_total_power_export_t2
          - sensor.p1_meter_3c39e72bf1a4_total_power_export_t1
          - total
        entity_id: sensor.p1_meter_3c39e72bf1a4_total_power_import_t1
        color: grey
        add_entities:
          - sensor.p1_meter_3c39e72bf1a4_total_power_import_t2
        subtract_entities:
          - sensor.p1_meter_3c39e72bf1a4_total_power_export_t1
          - sensor.p1_meter_3c39e72bf1a4_total_power_export_t2
  - entities:
      - type: entity
        children: []
        entity_id: sensor.p1_meter_3c39e72bf1a4_total_power_export_t2
        subtract_entities:
          - sensor.p1_meter_3c39e72bf1a4_total_power_import_t1
          - sensor.p1_meter_3c39e72bf1a4_total_power_import_t2
      - type: entity
        children: []
        entity_id: sensor.p1_meter_3c39e72bf1a4_total_power_export_t1
        subtract_entities:
          - sensor.p1_meter_3c39e72bf1a4_total_power_import_t1
          - sensor.p1_meter_3c39e72bf1a4_total_power_import_t2
      - type: remaining_parent_state
        children:
          - keukenapparatuur
          - 43a45af3549445e786330f52db481831
          - 65f8b051c0414faa94ac399177d2cf73
          - verlichting
          - eabfaf2be1fe4994b06a860eddbd3216
          - no_area
          - unknown
        entity_id: total
        name: Total Consumption
  - entities:
      - type: remaining_child_state
        children:
          - sensor.integral_dishwasher
          - sensor.integral_fridge
          - sensor.integral_quooker
          - sensor.sensor_magnetron_energy_nieuw
          - sensor.integral_oven
        entity_id: keukenapparatuur
        name: Keukenapparatuurz
        color: green
      - type: remaining_child_state
        children:
          - sensor.integral_dryer
          - sensor.integral_wasmachine
          - sensor.integral_cvketel
          - sensor.3d_printer_energy_nieuw
          - sensor.integral_koelvriezer
          - sensor.zolder_plug_energy
        entity_id: 43a45af3549445e786330f52db481831
        name: Zolder
        color: purple
      - type: remaining_child_state
        children:
          - sensor.sensor_fj_stopcontact_energy_nieuw
          - sensor.sensor_kamer_laurens_energy_nieuw
          - sensor.airco_power_plug_energy
        entity_id: 65f8b051c0414faa94ac399177d2cf73
        name: Eerste etage
      - type: remaining_child_state
        children:
          - sensor.tv_spot_group_energy
          - sensor.eettafel_group_energy
          - sensor.schuur_poort_group_energy
          - sensor.zolder_spots_groep_energy
          - sensor.keuken_alarm_energy
          - sensor.lamp_trapkast_energy
          - sensor.plafondlamp_overloop_eerste_energy
          - sensor.plafondlamp_zolder_voorkant_energy
          - sensor.plafondlamp_zolder_achterkant_energy
          - sensor.plafondlamp_zolder_overloop_energy
          - sensor.voordeur_energy
          - sensor.zijmuur_energy
        entity_id: verlichting
        name: Verlichting
        color: yellow
      - type: remaining_child_state
        children:
          - sensor.straalkachel_energy
          - sensor.sensor_eettafel_stopcontact_energy_nieuw
          - sensor.gang_beneden_energy
          - sensor.vloerverwarming_alpha3_energy
        entity_id: eabfaf2be1fe4994b06a860eddbd3216
        name: Begane grond
      - type: remaining_child_state
        children:
          - sensor.integral_tv
          - sensor.integral_smarthome
          - sensor.energie_2_deco_m5_wifi_punten_energy
        entity_id: no_area
        name: No area
      - type: remaining_parent_state
        children: []
        entity_id: unknown
        name: Unknown
  - entities:
      - type: entity
        children: []
        entity_id: sensor.integral_dishwasher
        color: green
      - type: entity
        children: []
        entity_id: sensor.integral_fridge
        color: green
      - type: entity
        children: []
        entity_id: sensor.integral_quooker
        color: green
      - type: entity
        children: []
        entity_id: sensor.sensor_magnetron_energy_nieuw
        color: green
      - type: entity
        children: []
        entity_id: sensor.integral_oven
        color: green
      - type: entity
        children: []
        entity_id: sensor.integral_dryer
      - type: entity
        children: []
        entity_id: sensor.integral_wasmachine
        color: purple
      - type: entity
        children: []
        entity_id: sensor.integral_cvketel
        color: purple
      - type: entity
        children: []
        entity_id: sensor.3d_printer_energy_nieuw
        color: purple
      - type: entity
        children: []
        entity_id: sensor.integral_koelvriezer
        color: purple
      - type: entity
        children: []
        entity_id: sensor.zolder_plug_energy
        color: purple
      - type: entity
        children: []
        entity_id: sensor.sensor_fj_stopcontact_energy_nieuw
      - type: entity
        children: []
        entity_id: sensor.sensor_kamer_laurens_energy_nieuw
      - type: entity
        children: []
        entity_id: sensor.airco_power_plug_energy
      - type: entity
        children: []
        entity_id: sensor.tv_spot_group_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.eettafel_group_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.schuur_poort_group_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.zolder_spots_groep_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.keuken_alarm_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.lamp_trapkast_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.plafondlamp_overloop_eerste_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.plafondlamp_zolder_voorkant_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.plafondlamp_zolder_achterkant_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.plafondlamp_zolder_overloop_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.voordeur_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.zijmuur_energy
        color: yellow
      - type: entity
        children: []
        entity_id: sensor.straalkachel_energy
      - type: entity
        children: []
        entity_id: sensor.sensor_eettafel_stopcontact_energy_nieuw
      - type: entity
        children: []
        entity_id: sensor.gang_beneden_energy
      - type: entity
        children: []
        entity_id: sensor.vloerverwarming_alpha3_energy
      - type: entity
        children: []
        entity_id: sensor.integral_tv
      - type: entity
        children: []
        entity_id: sensor.integral_smarthome
      - type: entity
        children: []
        entity_id: sensor.energie_2_deco_m5_wifi_punten_energy
energy_date_selection: true
type: custom:sankey-chart
min_state: 0
show_names: true

HI! I have ben fiddling with sankey and come up with a result that is quite good. As i have 3 phase system i was interested how my phases are utilized and what consumer uses what phase.

I have made one level for total house consumption, but then it will highlight everything that are on the left side of it. I would like to highlight only the phase 1 on the grid and PV side. As far as i know when i have the total between its not possible. Maybe somebody has some trick how to do this? Like some passttrough but still have th total in between.

No way with the total there. You could move the total to the beginning though. This way the phases will be connected directly.

Thanks for quick replay. That’s what I thought. I would like to see total consumption and its ok if I don’t see the phases flow end to end.

I think I am missing something the config generated with the auto config is not close to the examples of things working and has the following error.

Error: No energy data received. Make sure to add a `type: energy-date-selection` card to this screen.

height: 200 
unit_prefix: k 
round: 1 
convert_units_to: '' 
co2_intensity_entity: 
sensor.co2_signal_co2_intensity 
gas_co2_intensity: 66.6 
min_box_height: 3 
min_box_distance: 5 
show_states: true 
show_units: true 
energy_date_selection: true
sections: [] 
energy-date-selection: true 
type: 
custom:sankey-chart 
autoconfig: 
  print_yaml: true 
min_state: 0 
show_names: true 
show_icons: true 
wide: true

1 Like

A post was split to a new topic: Mini Graph Card Help

Yet another theoretical solution to your idea (not sankey-chart related):

1 Like

Thank you!
Good idea!
I will look into it.

Seeing the same error.

Hi Danema,
I just use this code in the card:

gridrows: auto
grid-template-columns: 100%

This works for me

hope it helps

@tom_l
I am still VERY interested in what these Meter/Guage looking cards are.


Can you point me to the card page?

1 Like
1 Like

It would be nice to have there sankey chart also available for esp32 displays (3.5 inch) would be enough :slight_smile:
Has anyone seen something similar for small displays?

I’m having trouble using the “convert_units_to” feature to show the electricity costs of all entities.

What I have right now is this (Upper is kWh, lower shall become €):

 - title: Elektrizitätskoten (dieses Jahr)
    type: custom:sankey-chart
    monetary_unit: EUR
    electricity_price: 0.3
    convert_units_to: monetary
    unit_prefix: k

I get it to change the kWh units to €, but it does not do the multiplication with 0,3 (30 Cents/kWh) to get to the correct cost value.

In the Readme on Github there is no example unfortunately that shows how to use this feature.

Looking at the code, this might happen if your devices don’t have unit_of_measurement=kWh . This would be a bug. You can submit a bug report here in Github

I used (utility meter) helper to read the energy value of my sensors and separate them into years, month and days by periodically resetting.

I’d gladly help tracking this bug.

What informations (sources) do you all need?

I’m new to HASS and not firm in what data and code snippets to gather.

the whole code of the sankey is this:

title: Stromkosten (dieses Jahr)
type: custom:sankey-chart
monetary_unit: EUR
convert_units_to: monetary
electricity_price: 0.31
height: 300
unit_prefix: k
round: 2
min_box_height: 1
min_box_distance: 30
show_states: true
show_units: true
sort_by: state
sort_dir: desc
show_names: true
min_state: 0
show_icons: false
wide: true
static_scale: 0
sections:
  - entities:
      - entity_id: sensor.energieverbrauch_gesamt_jahrlich
        name: Gesamtkosten
        color: red
        children:
          - sensor.energie_elektroherd_jahrlich
          - sensor.energie_kuhlschrank_jahrlich
          - sensor.energie_pc_jahrlich
          - sensor.energie_server_jahrlich
          - sensor.energie_waschmaschine_jahrlich
          - sensor.energie_waschetrockner_jahrlich
          - sensor.energie_tv_jahrlich
        remaining:
          name: für sonstige Verbraucher
  - entities:
      - type: entity
        children: []
        entity_id: sensor.energie_elektroherd_jahrlich
        name: für Elektroherd
        color: red
      - type: entity
        children: []
        entity_id: sensor.energie_kuhlschrank_jahrlich
        name: für Kühlschrank
        color: red
      - type: entity
        children: []
        entity_id: sensor.energie_pc_jahrlich
        name: für PC Arbeitsplatz
        color: red
      - type: entity
        children: []
        entity_id: sensor.energie_server_jahrlich
        name: für Serverschrank
        color: red
      - type: entity
        children: []
        entity_id: sensor.energie_waschmaschine_jahrlich
        name: für Waschmaschine
        color: red
      - type: entity
        children: []
        entity_id: sensor.energie_waschetrockner_jahrlich
        name: für Wäschetrockner
        color: red
      - type: entity
        children: []
        entity_id: sensor.energie_tv_jahrlich
        name: für TV
        color: red


Hi everyone,
Loving this chart. But I’m wondering if there’s an option to align the data of the children to the mother entity?
So the picture on the left is what is automatically generated from my HA data. I used some very bad paint skills to show what I want to achieve in the picture on the right.
→ Is this possible or would this be a feature request?

There is a similar feature request already

@PieterVandenBerge
Another solution could be to ‘repeat’ the ones you can (eg the ‘1kWh injected to grid’ and the ‘5kWh battery charging’) and create another block for whatever remains out of the 9kWh house consumption after you deduct the dryer, washer, garage and climatecontrol to e.g. an ‘other’ bucket of 5.89kWh, on the right.
(so basically all three ‘vertical’ levels’ have the same total)

1 Like

Household energy flow is almost working stable. My biggest problem has been coping with having a greater discharge than charge in any time frame, as that messes up the sankey code (can’t have a child bigger than the parent).

I’ll add code in comment.