Anyone using the Sankey Chart Card?

History stats are working for this sensor… So that’s not the problem. I’ll stick to using the separate sensors for now, but very strange this is not working!

for a final sep today, trying to get the remaining_parent_state

  - entities:
      - entity_id: al_het_andere
        type: remaining_parent_state
        name: Alle andere
      - entity_id: sensor.energy_consumed_daily
        name: Gemeten verbruik
        color: '#488FC2'
        children:
          - sensor.boiler_bijkeuken_daily
          - sensor.wasdroger_bijkeuken_daily
          - etcetc

to show up. Doesnt work though:

probably an obvious reason…?

al_het_andere must be in the last section and be in children of sensor.energy_consumed_daily

like this?

# last section
  - entities:
      - entity_id: al_het_andere
        type: remaining_parent_state
        name: Alle andere
      - entity_id: sensor.energy_consumed_daily
        name: Gemeten verbruik
        color: '#488FC2'
        children:
          - al_het_andere
          - sensor.boiler_bijkeuken_daily
          - sensor.wasdroger_bijkeuken_daily

apparently not, getting Error: Entity not found al_het_andere now…

sensor.energy_consumed_daily should not be in the last one. Everything that is in children must be in the next section and no entity in the last section can have children because there is nothing after it.

still all bit confusing to me, but Ive found it to work like this:

  - entities:
      - entity_id: sensor.energy_consumed_daily
        name: Gemeten verbruik
        color: '#488FC2'
        children:
          - al_het_andere
          - sensor.boiler_bijkeuken_daily
          - sensor.wasdroger_bijkeuken_daily
          - etcetcetc
#last_section
  - entities:
      - entity_id: al_het_andere
        type: remaining_parent_state
        name: Alle andere
      - entity_id: sensor.boiler_bijkeuken_daily
        name: Boiler
      - entity_id: sensor.wasdroger_bijkeuken_daily
        name: Wasdroger
      - etcetcetc

will bring it to the bottom, because this looks a bit silly

on the header: would there be any reason for this and not to respond to

type: custom:sankey-chart
title: Energie verbruik
card_mod:
  class: class-header-margin

which is a regular class I use on all of my cards, containing:

        .: |
          ha-card.class-header-margin .card-header {
            background-color: var(--background-color-off);
            font-weight: 400;
            font-size: 20px;
            color: var(--text-color-off);
            padding: 0px 12px;
            margin: 0px 0px 16px 0px;
          }

can not get it to kick in, even though the inspector shows the header to be
Scherm­afbeelding 2022-11-28 om 17.08.34

update

for now, the only way I can find a solution is to use the sankey inside an entities card:

type: entities
title: Energie verbruik
card_mod:
  class: class-header-margin
entities:

  - type: custom:hui-element
    card_type: custom:sankey-chart
    card_mod:
      style: |
        ha-card {
          margin: -8px -16px -16px -16px;
          box-shadow: none:
        }

to get

I have been able to add a type: energy-date-selection card to my normal dashboard but the sankey card seems to just ignore it. All sensors used in my sankey card have existed for months already.

Feature request: One thing that would be awesome, is to be able to set the width per section (as a % for instance). This would help me balance sections better depending on what’s in them.

update on my styling issue: we need to go into the shadow root…

type: custom:sankey-chart
title: Energie verbruik
card_mod:
  style:
    $: |
      .card-header {
         background-color: var(--background-color-off);
         font-weight: 400;
         font-size: 20px;
         color: var(--text-color-off);
         padding: 0px 12px;
         margin: 0px 0px 16px 0px;
       }

see: 🔹 Card-mod - Add css styles to any lovelace card - #3911 by arganto and thanks @arganto for solving this for me.

Sounds reasonable but Github is the proper place for feature requests

1 Like

hi, the card its awesome, but we have a problem, can you help me?
the solar its not connected,

type: custom:sankey-chart
show_names: true
title: Live energy dashboard
energy-date-selection: true
wide: true
height: 400
min_box_height: 10
sections:
  - entities:
      - entity_id: sensor.solaredge_current_power
        color: var(--warning-color)
      - entity_id: sensor.actuele_energie
        color: var(--warning-color)
      - entity_id: sensor.p1_meter_active_power
        name: P1
        color: '#1fc527'
        children:
          - sensor.meterkast_power
          - sensor.oplader_dashboard_tablet_power
          - sensor.afzuiging_stand_1_power
          - sensor.lumi_lumi_switch_n0agl1_bebc0900_electrical_measurement
          - sensor.oplader_jonathan_power
          - sensor.voorvensterbank_watt_power
          - sensor.achtervensterbank_power
          - sensor.deurbel_watt_power
          - sensor.diepvries_power
          - sensor.wasmachine_electrical_measurement
          - sensor.droger_electrical_measurement
          - sensor.koelkast_electrical_measurement
          - sensor.tz3000_amdymr7l_ts011f_ce6b9c7b_electrical_measurement
          - sensor.hybride_pomp_power
          - sensor.shellyswitch25_e66d26_channel_1_power
          - sensor.keukenkast_power
          - sensor.lumi_lumi_switch_n0agl1_electrical_measurement
          - sensor.grondspots_power
          - sensor.plafondspots_power
          - sensor.samsung_scherm_power
          - sensor.vogels_boven_power
          - sensor.vogels_onder_power
          - >-
            sensor.leidingwaterklep_en_ledstrip_regenton_waterniveau_channel_2_power
          - sensor.vloerlamp_power_2
          - sensor.keuken_google_power
          - sensor.schuur_google_power
          - sensor.chromecast_power
          - >-
            sensor.back_up_stroom_netwerk_apparaten_schuur_electrical_measurement
          - sensor.keukenspots_level_on_off_power
          - sensor.oplader_fiets_jonathan_active_power
          - sensor.ledbalken_power
          - sensor.google_nest_hub_voeding_jonathan_power
          - sensor.google_nest_hub_voeding_karin_power
          - sensor.afzuigkap_power
          - Overig
  - entities:
      - sensor.meterkast_power
      - sensor.oplader_dashboard_tablet_power
      - sensor.afzuiging_stand_1_power
      - sensor.lumi_lumi_switch_n0agl1_bebc0900_electrical_measurement
      - sensor.oplader_jonathan_power
      - sensor.voorvensterbank_watt_power
      - sensor.achtervensterbank_power
      - sensor.deurbel_watt_power
      - sensor.diepvries_power
      - sensor.wasmachine_electrical_measurement
      - sensor.droger_electrical_measurement
      - sensor.koelkast_electrical_measurement
      - sensor.tz3000_amdymr7l_ts011f_ce6b9c7b_electrical_measurement
      - sensor.hybride_pomp_power
      - sensor.shellyswitch25_e66d26_channel_1_power
      - sensor.keukenkast_power
      - sensor.lumi_lumi_switch_n0agl1_electrical_measurement
      - sensor.grondspots_power
      - sensor.plafondspots_power
      - sensor.samsung_scherm_power
      - sensor.vogels_boven_power
      - sensor.vogels_onder_power
      - sensor.leidingwaterklep_en_ledstrip_regenton_waterniveau_channel_2_power
      - sensor.vloerlamp_power_2
      - sensor.keuken_google_power
      - sensor.schuur_google_power
      - sensor.chromecast_power
      - sensor.back_up_stroom_netwerk_apparaten_schuur_electrical_measurement
      - sensor.keukenspots_level_on_off_power
      - sensor.oplader_fiets_jonathan_active_power
      - sensor.ledbalken_power
      - sensor.google_nest_hub_voeding_jonathan_power
      - sensor.google_nest_hub_voeding_karin_power
      - sensor.afzuigkap_power
      - entity_id: Overig
        type: remaining_parent_state
        name: Overig
        color: '#e56353'

You have to add children to it. It doesn’t have any connections configured right now.

can you please share your full code? I am struggling with low and high tariff and it seems you have this nicely setup


Its working now

1 Like

I’m attempting to get the totals side done first before I narrow it down to the known areas and devices (With the helpful “remaining state” functions).

I can’t get two pieces to work, any help would be appreciated.

  1. At the leftmost column, I am trying to also show the “Totaal Ingekocht” from one column to the right.
    Despite using this piece of yaml, the likes of which functions properly elsewhere in the card, I’m getting an error TypeError: e.attributes is undefined
yaml attempt 1
      - entity_id: Inkoop
        type: remaining_child_state
        children:
          - TotaalIngekocht
  1. found a workaround, documentation suggests it would work better
    Given that my solar inverter’s lifetime production includes both the energy given back to the grid and energy directly used in the grid, I am attempting to pass the direct usage (Direct Verbruik, which is the remaining_parent_state after production has been subtracted from the solaredge production) two levels down to be added into TotaalVerbruik. This gives Error: Entity Not Found Totaalverbruik.
    In reading the documentation, I’m led to believe the sankey chart would automatically show a passthrough node.
    As a workaround, I’ve created an extra dummy node in the layer in between. (Not shown in below yaml or screenshot)
    Perhaps remaining_parent_node and skipping levels does not play nicely together?
yaml and screenshot

type: custom:sankey-chart
show_names: true
unit_prefix: k
round: 1
height: 1000
wide: true
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.solaredge_lifetime_energy
        type: entity
        color: orange
        children:
          - DirectVerbruik
          - TotaalGeproduceerd
  - entities:
      - entity_id: TotaalIngekocht
        name: Totaal Ingekocht
        type: remaining_child_state
        children:
          - sensor.energy_consumed_tariff_1
          - sensor.energy_consumed_tariff_2
      - entity_id: DirectVerbruik
        type: remaining_parent_state
      - entity_id: TotaalGeproduceerd
        name: Totaal Teruggeleverd
        type: remaining_child_state
        children:
          - sensor.energy_produced_tariff_1
          - sensor.energy_produced_tariff_2
  - entities:
      - entity_id: sensor.energy_consumed_tariff_1
        children:
          - TotaalVerbruik
      - entity_id: sensor.energy_consumed_tariff_2
        children:
          - TotaalVerbruik
      - entity_id: sensor.energy_produced_tariff_1
      - entity_id: sensor.energy_produced_tariff_2
  - entities:
      - entity_id: TotaalVerbruik
        name: Totaal Verbruik
        type: remaining_parent_state

I am working on am autoconfig option right now and some aggregation functions. An initial version will probably be released today or tomorrow. This should give you a config very similar to what you want and good starting point.

4 Likes

Hi Guys, need some help. Not sure what I am doing wrong. As soon as I change “energy_date_selection” to “true” it removes all the relation lines from the graph. Is this supposed to work like his? What am I missing here?


Looks like you have no data. Try changing the date in the date selection card

Thanks but unfortunately that is not changing anything. I will wait for your “auto config” option :slight_smile: Thank you for the great work!

I saw the autoconfig was in the latest release. Tried it, but it continuously shows “Loading…” I did add a energy-date-selection

Any thoughts?