Anyone using the Sankey Chart Card?

wait, I missed that, do we need to set anything or is it truly automatic.

For mobile I am still using a view with a hacked Swiper card config,

  - type: custom:state-switch
    entity: mediaquery
    states:
      '(min-width: 800px)':
        !include /config/dashboard/includes/include_sankey_energie.yaml
      all:
        type: custom:swipe-card
        card_width: 200%
        parameters:
          grabCursor: false
          allowTouchMove: true
          slidesPerView: auto
          freeMode: true
          preventInteractionOnTransition: false
        spaceBetween: 0
        scrollbar:
          hide: false
          draggable: false
          snapOnRelease: false
        cards:
          - !include /config/dashboard/includes/include_sankey_energie.yaml

and automatic vertical might just solve it for me too

Edit

Right: automatic :wink:

Though it’s a bit odd/off

And changing to landscape makes it even worse

Sounds good … tried to adapt this but there is a problem with the parent_state if I use battery power.

how can I add the battery power for a source next to solar and grid

Blockquote

type: custom:sankey-chart
show_names: true
show_icons: false
energy_date_selection: false
unit_prefix: W
round: 0
throttle: 10
wide: true
height: 400
min_box_height: 7
sections:
  - entities:
      - type: entity
        children:
          - sensor.apf_solar2house
          - sensor.apf_solar2batt
          - sensor.apf_solar2grid
        entity_id: sensor.solarenergy
        name: Solar
        color: orange
      - type: entity
        children:
          - sensor.apf_grid2batt
          - sensor.apf_grid2house
        entity_id: sensor.apf_grid_entity
        name: Grid
        color: red
  - entities:
      - type: entity
        entity_id: sensor.apf_solar2house
        children:
          - sensor.apf_house_entity
        name: To House
        color: orange
      - type: entity
        entity_id: sensor.apf_solar2batt
        children:
          - sensor.apf_battery_entity
        name: To Battery
        color: orange
      - type: entity
        entity_id: sensor.apf_solar2grid
        children: []
        color: green
        name: Export
      - type: entity
        entity_id: sensor.apf_grid2house
        children:
          - sensor.apf_house_entity
        name: To House
        color: red
      - type: entity
        entity_id: sensor.apf_grid2batt
        children:
          - sensor.apf_battery_entity
        name: To Battery
        color: red
  - entities:
      - type: passthrough
        children:
          - sensor.apf_house_entity
        entity_id: sensor.apf_house_entity
        name: House
      - type: entity
        children:
          - sensor.apf_house_entity
          - sensor.apf_batt2grid
#          - BatteryLeft
        entity_id: sensor.apf_battery_entity
        name: Battery
        color: purple
  - entities:
      - type: entity
        children:
          - office_today
          - kitchen_today
          - house_other
          - sensor.plug_meter_2_blitzwolf_tv_active_power
        entity_id: sensor.apf_house_entity
        name: House
#      - type: remaining_parent_state
#        children: []
#        entity_id: BatteryLeft
#        name: Battery Left
        color: purple
      - type: entity
        entity_id: sensor.apf_batt2grid
        children: []
        color: Green
        name: Export
    sort_by: state
  - entities:
      - type: remaining_child_state
        children:
          - sensor.tasmota_schreibtisch_energy_power
          - >-
            sensor.plug_meter_1_blitzwolf_network_55dbf8fe_electrical_measurement
        entity_id: office_today
        name: Office
      - type: remaining_child_state
        children:
          - sensor.plug_meter_4_blitzwolf_kuhlschrank_electrical_measurement
          - sensor.tasmota_waschmaschine_energy_power
          - sensor.tasmota_spulmaschine_energy_power
        entity_id: kitchen_today
        name: Kitchen
      - type: passthrough
        children:
          - sensor.plug_meter_2_blitzwolf_tv_active_power
        entity_id: sensor.plug_meter_2_blitzwolf_tv_active_power
        name: TV
      - type: remaining_parent_state
        children: []
        entity_id: house_other
        name: Other
    sort_by: state
  - entities:
      - type: entity
        children: []
        entity_id: sensor.plug_meter_1_blitzwolf_network_55dbf8fe_electrical_measurement
        name: Network
      - type: entity
        children: []
        entity_id: sensor.tasmota_schreibtisch_energy_power
        name: Computers
      - type: entity
        children: []
        entity_id: sensor.plug_meter_4_blitzwolf_kuhlschrank_electrical_measurement
        name: Fridge
      - type: entity
        children: []
        entity_id: sensor.tasmota_spulmaschine_energy_power
        name: Dishwasher
      - type: entity
        children: []
        entity_id: sensor.tasmota_waschmaschine_energy_power
        name: Washing Machine
      - type: entity
        children: []
        entity_id: sensor.plug_meter_2_blitzwolf_tv_active_power
        name: TV
    sort_by: state

hi Tom,

looks great. Could you share your code pls ?

Greets
Matze

Already have. https://community.home-assistant.io/t/anyone-using-the-sankey-chart-card/423125/30?u=tom_l

Using the sankey chart component since a couple of days. Very powerfull tool!

Having issues with my ‘house’ sensor. It’s simply not showing, but the
sensor has a value. Therefore there are also no flows going to the appliances.

Both the PV and Grid output (shown) should go to ‘House’ (missing) and then to appliances on the right side (shown). The PV Export is shown and is also a similar sensor as sensor.daily_energy_usage_total.

What am I missing? :slight_smile:

type: custom:sankey-chart
layout: horizontal
height: 250
unit_prefix: k
round: 2
convert_units_to: ''
co2_intensity_entity: sensor.co2_signal_co2_intensity
gas_co2_intensity: 2351.6459999999997
min_box_size: 3
min_box_distance: 5
show_states: true
show_units: true
min_box_height: 3
min_state: 0
show_names: true
show_icons: true
wide: false
sort_dir: asc
sort_by: ''
energy_date_selection: true
sections:
  - entities:
      - type: entity
        icon: mdi:solar-power-variant
        color: orange
        name: PV
        children:
          - sensor.daily_energy_usage_total
          - sensor.export_total_daily
        entity_id: sensor.pv_kwh_daily
      - type: entity
        icon: mdi:arrow-down
        color: grey
        name: Grid
        children:
          - sensor.daily_energy_usage_total
        entity_id: sensor.import_total_daily
  - entities:
      - type: entity
        icon: mdi:home
        color: blue
        name: Total usage
        children:
          - sensor.vaatwasser_energy
          - sensor.kwh_meter_3_phase_5c2faf0e28a0_total_power_import
        entity_id: sensor.daily_energy_usage_total
      - type: entity
        icon: mdi:arrow-up
        color: grey
        name: Grid
        entity_id: sensor.export_total_daily
  - entities:
      - type: entity
        color: lightblue
        name: Vaatwasser
        entity_id: sensor.vaatwasser_energy
      - type: entity
        color: lightblue
        name: EV charger
        entity_id: sensor.kwh_meter_3_phase_5c2faf0e28a0_total_power_import
      - type: entity
        color: lightblue
        name: Koelkast
        entity_id: sensor.koelkast_energy
      - type: entity
        color: lightblue
        name: Droger
        entity_id: sensor.droger_energy
      - type: entity
        color: lightblue
        name: Wasmachine
        entity_id: sensor.wasmachine_energy
      - type: entity
        color: lightblue
        name: Printers
        entity_id: sensor.printers_energy

Sensors should have a proper state_class in order for statistics to work. Most commonly state_class: total. See Sensor Entity | Home Assistant Developer Docs

Don’t know what else it could be

I just realized now, I think after installing version 3.0 a few days ago, that the ‘remaining’ are no longer being shown to me.

Reading the documentation, I saw that ‘remaining’ should be replaced with ‘remaining_parent_state’ if I understood correctly. However, I can’t seem to find the correct syntax, and the code is throwing an error.

This is the code that previously worked correctly:

type: custom:sankey-chart
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

Has anyone else encountered this issue before and can help me?

I managed to write the code correctly, now it no longer gives errors. However, I have some display issues as you can see below.

This is the code used:

type: custom:sankey-chart
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:
      - entity_id: sensor.shellyem_055fbd_channel_1_energy
        children:
          - sensor.shellyem_055fbd_channel_2_energy
          - sensor.potenza_istantanea_varie_utenze_energy
          - rimanenza_notte_non_monitorato
  - entities:
      - entity_id: sensor.shellyem_055fbd_channel_2_energy
        children:
          - sensor.caldaia_energy
          - rimanenza_cucina
      - entity_id: sensor.potenza_istantanea_varie_utenze_energy
        color: green
        name: Altre utenze
        children:
          - virtuale_luci
          - virtuale_network&IoT
          - virtuale_tv
          - sensor.macchina_caffe_energy
          - rimanenza_altre_utenze
    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
      - entity_id: rimanenza_notte_non_monitorato
        type: remaining_parent_state
        name: Notte (non monitorato)
        color: purple
      - entity_id: rimanenza_cucina
        type: remaining_parent_state
        name: Rimanenza cucina
        color: purple
      - entity_id: rimanenza_altre_utenze
        type: remaining_parent_state
        name: Rimanenza altro
        color: purple
    sort_by: state
    sort_group_by_parent: true

In version 2.4.0, it appears like this where everything is represented correctly:

In version 3.0.0 it appears like this, the data is correct but there are many intersections on the lines:

At a glance, I think the sort order on each layer is different…

You used group by parent? Not sure how that’s supposed to work out but it sure looks like it’s doing either as or desc and ignoring that. try a different sort and see if that moves things around - if so clarify that group by parent is working as you expect/require Maybe it was working incorrectly and got ‘fixed’ or it broke in the 3.0 update (if it’s not working as desired open a bug - mindfreeze is incredibly responsive)

I’ve already tried to modify the group by part but I can’t achieve the correct result.
I am now trying to open an issue on GitHub, as you suggested.

@ma9mwah do you have a list of the entity names that you summed up to create your various summed entities?

I have a Hybrid Gen 3 5.0kW with 2 batteries, but I don’t see any entities that provide data such as Grid to Battery, Grid to House, Solar to Grid, etc

I have plenty of other entities from the integration, like Battery Discharge Today, PV Energy Today, and so on, but none that break down the various X to Y routes that you describe from yours.

If your inverter doesn’t keep track of these you may need to do it yourself using template sensors and integrations.
You would use the power measurements to add/minus grid/battery/solar/home to have single sensors for each of:

  • Solar to Home
  • Solar to Battery
  • solar to Grid
  • grid to battery,
  • grid to home
  • battery to grid
  • battery to home

Then you would use the integration sensor (use ‘left’) to measure the total energy in each.

All those sensors came from GivTCP for my GivEnergy All-In-One.

Hello can someone help me? My Sankey Chart no longer works

type: custom:sankey-chart
show_names: true
show_icons: true
wide: true
round: 0
height: 75
show_units: true
min_box_height: 10
sections:
  - entities:
      - entity_id: sensor.senec_solar_generated_power
        color: var(--energy-solar-color)
        name: Solar
        children:
          - sensor.senec_solar_house_used_power
          - sensor.produced_power_produktionsueberschuss
      - entity_id: sensor.senec_grid_imported_power
        color: var(--energy-grid-consumption-color)
        name: Netz
        children:
          - sensor.senec_grid_house_used_power
      - entity_id: sensor.senec_battery_export_power
        color: var(--energy-battery-out-color)
        name: Speicher
        children:
          - sensor.senec_battery_house_used_power
          - sensor.senec_grid_exported_power
  - entities:
      - entity_id: sensor.senec_solar_house_used_power
        color: var(--energy-solar-color)
        name: Haus
        children:
          - sensor.senec_house_power
      - entity_id: sensor.senec_grid_house_used_power
        type: passthrough
        color: var(--energy-grid-consumption-color)
        name: Haus
        children:
          - sensor.senec_house_power
      - entity_id: sensor.senec_battery_house_used_power
        type: passthrough
        color: var(--energy-battery-out-color)
        name: Haus
        children:
          - sensor.senec_house_power
      - entity_id: sensor.produced_power_produktionsueberschuss
        color: var(--energy-solar-color)
        name: Gewinn
        children:
          - sensor.senec_grid_exported_power
          - sensor.senec_battery_import_power
        type: entity
  - entities:
      - entity_id: sensor.senec_house_power
        color: grey
        name: Haus
      - entity_id: sensor.senec_grid_exported_power
        color: var(--energy-grid-return-color)
        name: Netz
      - entity_id: sensor.senec_battery_import_power
        color: var(--energy-battery-in-color)
        name: Speicher
card_mod:
  style: |
    ha-card {
      background: var(card-background-color);
      padding: 0px;
      #border-radius: 0px;
      font-size: 0.8rem;
      font-weight: bold;
      border: none;
      box-shadow: none;
      overflow-x: clip !important;
    }
    .container {
      padding: 0px !important;
    }
    .box div:first-child {
        color: white;
    }             

Can you be more specific? What does “no longer works” mean?

Your passthrough is strange. Try this

type: custom:sankey-chart
show_names: true
show_icons: true
wide: true
round: 0
height: 75
show_units: true
min_box_height: 10
sections:
  - entities:
      - entity_id: sensor.senec_solar_generated_power
        color: var(--energy-solar-color)
        name: Solar
        children:
          - sensor.senec_solar_house_used_power
          - sensor.produced_power_produktionsueberschuss
      - entity_id: sensor.senec_grid_imported_power
        color: var(--energy-grid-consumption-color)
        name: Netz
        children:
          - sensor.senec_grid_house_used_power
      - entity_id: sensor.senec_battery_export_power
        color: var(--energy-battery-out-color)
        name: Speicher
        children:
          - sensor.senec_battery_house_used_power
          - sensor.senec_grid_exported_power
  - entities:
      - entity_id: sensor.senec_solar_house_used_power
        color: var(--energy-solar-color)
        name: Haus
        children:
          - sensor.senec_house_power
      - entity_id: sensor.senec_house_power
        type: passthrough
        color: var(--energy-grid-consumption-color)
        name: Haus
      - entity_id: sensor.senec_battery_house_used_power
        type: passthrough
        color: var(--energy-battery-out-color)
        name: Haus
        children:
          - sensor.senec_house_power
      - entity_id: sensor.produced_power_produktionsueberschuss
        color: var(--energy-solar-color)
        name: Gewinn
        children:
          - sensor.senec_grid_exported_power
          - sensor.senec_battery_import_power
        type: entity
  - entities:
      - entity_id: sensor.senec_house_power
        color: grey
        name: Haus
      - entity_id: sensor.senec_grid_exported_power
        color: var(--energy-grid-return-color)
        name: Netz
      - entity_id: sensor.senec_battery_import_power
        color: var(--energy-battery-in-color)
        name: Speicher
card_mod:
  style: |
    ha-card {
      background: var(card-background-color);
      padding: 0px;
      #border-radius: 0px;
      font-size: 0.8rem;
      font-weight: bold;
      border: none;
      box-shadow: none;
      overflow-x: clip !important;
    }
    .container {
      padding: 0px !important;
    }
    .box div:first-child {
        color: white;
    }

Oh this isn’t going to work. Why are all your entities passthrough? Remove that

@MindFreeze Many thanks for this incredible useful card. It’s an eye-opener for people in my household :wink:

@all
I would like to propose an improvement which would make it least my life a little easier when it comes to add entities to the sankey chart card.

Currently there are parent entities and their children defined, here an example for appliances and its children dryer and fridge:

  - entities:
      - type: entity
        children:
          - sensor.dryer_power
          - sensor.fridge_power
        entity_id: sensor.appliances_power
        name: Appliances
        color: purple
  - entities:
      - type: entity
        entity_id: sensor.dryer_power
        name: Dryer
        color: purple
      - type: entity
        entity_id: sensor.fridge_power
        name: Fridge
        color: purple

If I want to add an entity, let’s say the dishwasher, I have to do it in two areas.
At the parent:

  - entities:
      - type: entity
        children:
          - sensor.dryer_power
          - sensor.fridge_power
          - sensor.dishwasher_power
        entity_id: sensor.appliances_power
        name: Appliances
        color: purple

And add the child:

      - type: entity
        entity_id: sensor.dishwasher_power
        name: Dishwasher
        color: purple

Problem
It happens sometimes to me, that I forget to extend the list of children of the parent when I add a child.

Proposal
So, what about changing the definition of the relationship by adding the parent to the child entity:

  - entities:
      - type: entity
        entity_id: sensor.appliances_power
        name: Appliances
        color: purple
  - entities:
      - type: entity
        entity_id: sensor.dryer_power
        name: Dryer
		parent: sensor.appliances_power
        color: purple
      - type: entity
        entity_id: sensor.fridge_power
        name: Fridge
		parent: sensor.appliances_power
        color: purple

when I now add the dishwasher I need to do it only at one place:

      - type: entity
        entity_id: sensor.dishwasher_power
        name: Dishwasher
		parent: sensor.appliances_power
        color: purple

What do you think?

If it makes sense I am happy to create a related issue on Github.

2 Likes

It makes sense, I guess. But I don’t want to maintain 2 ways to define this and the new way would be a breaking change. I will consider it next time I am introducing breaking changes but it won’t be soon.

1 Like