Anyone using the Sankey Chart Card?

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.

I have now updated to version 2.0.0 and with the configuration I used before without problems on version 1.21.1 I am given a circular reference.

I can’t figure out what the problem is, this is my current configuration:

Configuration
type: custom:sankey-chart
monetary_unit: EUR
electricity_price: 0.24
convert_units_to: monetary
min_state: 0.00001
show_names: true
wide: true
energy_date_selection: true
height: 550
unit_prefix: k
round: 2
min_box_height: 3
min_box_distance: 10
show_states: true
show_units: true
show_icons: true
throttle: 5000
sections:
  - entities:
      - type: entity
        remaining:
          name: Notte (non monitorato)
        children:
          - sensor.shellyem_055fbd_channel_2_energy
          - sensor.potenza_istantanea_varie_utenze_energy
        entity_id: sensor.shellyem_055fbd_channel_1_energy
  - entities:
      - type: entity
        color: purple
        children:
          - sensor.caldaia_energy
        name: Elettrodomestici cucina
        entity_id: sensor.shellyem_055fbd_channel_2_energy
        remaining:
          name: Altro
      - type: entity
        color: green
        name: Altre utenze
        children:
          - virtuale_luci
          - virtuale_network&IoT
          - virtuale_tv
          - sensor.macchina_caffe_energy
        entity_id: sensor.potenza_istantanea_varie_utenze_energy
        remaining:
          name: Altro
    sort_by: state
    sort_group_by_parent: true
  - entities:
      - type: remaining_child_state
        name: Luci
        color: yellow
        entity_id: virtuale_luci
        children:
          - sensor.luce_soggiorno_energy
          - virtuale_luci_cucina
          - virtuale_luci_bagno
          - sensor.interruttori_e_switch_iot_energy
          - virtuale_luci_camera_alfa
          - virtuale_luci_balconi
          - virtuale_luci_lavanderia
          - virtuale_luci_salotto
      - type: remaining_child_state
        name: Rete e dispositivi IoT
        color: RGB(255, 153, 80)
        entity_id: virtuale_network&IoT
        children:
          - sensor.nas_synology_ds920_energy
          - sensor.access_point_deco_zona_alfa_energy
          - sensor.access_point_deco_zona_beta_energy
          - sensor.router_huawei_4g_energy
          - sensor.echo_dot_camera_energy
          - sensor.echo_dot_cucina_energy
          - sensor.echo_dot_soggiorno_energy
      - type: remaining_child_state
        name: TV
        color: RGB(255, 130, 200)
        entity_id: virtuale_tv
        children:
          - sensor.tv_salotto_energy
          - sensor.amplificatore_salotto_energy
          - sensor.apple_tv_energy
    sort_by: state
    sort_group_by_parent: true
  - entities:
      - type: remaining_child_state
        name: Luci bagno
        color: yellow
        entity_id: virtuale_luci_bagno
        children:
          - sensor.faretti_bagno_alfa_energy
          - sensor.bagno_alfa_energy
      - type: remaining_child_state
        name: Luci cucina
        color: yellow
        entity_id: virtuale_luci_cucina
        children:
          - sensor.tavolo_cucina_energy
          - sensor.faretti_cucina_energy
      - type: remaining_child_state
        name: Luci camera Alfa
        color: yellow
        entity_id: virtuale_luci_camera_alfa
        children:
          - sensor.luce_camera_destra_energy
          - sensor.camera_ingresso_energy
          - sensor.camera_pianoforte_energy
          - sensor.luce_camera_sinistra_energy
      - type: remaining_child_state
        name: Luci balconi
        color: yellow
        entity_id: virtuale_luci_balconi
        children:
          - sensor.balcone_salotto_energy
          - sensor.balcone_soggiorno_energy
          - sensor.balcone_cucina_energy
          - sensor.balcone_camera_energy
      - type: remaining_child_state
        name: Luci lavanderia
        color: yellow
        entity_id: virtuale_luci_lavanderia
        children:
          - sensor.lavanderia_ripostiglio_energy
          - sensor.lavanderia_striscia_led_energy
      - type: remaining_child_state
        name: Luci salotto
        color: yellow
        entity_id: virtuale_luci_salotto
        children:
          - sensor.divano_destro_energy
          - sensor.divano_sinistro_energy
          - sensor.scrivania_energy
    sort_by: state
    sort_group_by_parent: true
  - entities:
      - sensor.faretti_bagno_alfa_energy
      - sensor.bagno_alfa_energy
      - sensor.tavolo_cucina_energy
      - sensor.faretti_cucina_energy
      - sensor.camera_ingresso_energy
      - sensor.camera_pianoforte_energy
      - sensor.luce_camera_destra_energy
      - sensor.luce_camera_sinistra_energy
      - sensor.balcone_salotto_energy
      - sensor.balcone_soggiorno_energy
      - sensor.balcone_camera_energy
      - sensor.balcone_cucina_energy
      - sensor.divano_destro_energy
      - sensor.divano_sinistro_energy
      - sensor.luce_soggiorno_energy
      - sensor.scrivania_energy
      - sensor.interruttori_e_switch_iot_energy
      - sensor.nas_synology_ds920_energy
      - sensor.access_point_deco_zona_alfa_energy
      - sensor.access_point_deco_zona_beta_energy
      - sensor.router_huawei_4g_energy
      - sensor.echo_dot_camera_energy
      - sensor.echo_dot_cucina_energy
      - sensor.echo_dot_soggiorno_energy
      - sensor.tv_salotto_energy
      - sensor.amplificatore_salotto_energy
      - sensor.apple_tv_energy
      - sensor.lavanderia_ripostiglio_energy
      - sensor.lavanderia_striscia_led_energy
      - entity_id: sensor.macchina_caffe_energy
        color: brown
        icon: mdi:coffee
      - entity_id: sensor.caldaia_energy
        color: red
        icon: mdi:water
    sort_by: state
    sort_group_by_parent: true

I hope someone can give me some tips to identify the problem.

1 Like

Had the same issue, I created a powercalc group for the entities as a workaround.

Bug. I think I fixed it in v2.0.1

1 Like

Thanks for the very quick response @MindFreeze, I updated to the new version, now the error message no longer appears but the graph is not seen correctly.

Example before:

Example now:

I tried changing browsers but nothing changes.

Thanks for the feedback. Working on it. You can track the progress here Maximum call stack · Issue #171 · MindFreeze/ha-sankey-chart · GitHub

Great, thanks.

Does anyone know how to get back to an old version via HACS? When I try to select an old version it automatically repositions me on the last available one and therefore I cannot install 1.21.1.

Just released v2.0.2 . Hopefully that fixes your connections

Now everything seems to be working properly, thanks