Anyone using the Sankey Chart Card?

I suspected that was the case so that it could be specified differently for each section. So, I did previously try that but was putting the line before the entity_id list. I moved it to after and it works now. Thank you.

FWIW, should min_width be in the Entities object table on the README instead of the Sections object table?

Also, now that I’m trying to optimize the layout on mobile, when it does switch to vertical, the height seems excessive. Any chance this statement could be revisited allowing for a separate height_horizontal and height_vertical to be specified?

Only matters while in horizontal layout. Vertical layout height is dynamic based on content.

Having more or less up and working now I am not quite understanding how to use remaining_child_state.

I wanted to have a remaining_parent_state and a remaining_child_state together.

So if I have 2 sections, either the child will have more than the parent or the parent will have more than the child. So one will need to show a value and the other is not being displayed.

sections:
  - entities:
      - type: entity
        children:
          - sensor.mains_0_untracked
          - sensor.fixed_value_consumers_energy_today
          - sensor.boiler_2_energy_today
        entity_id: sensor.shelly_3em_energy_today_0
      - entity_id: sensor.mains_0_excess
        type: remaining_child_state
        name: Mains 0 Excess
        children:
          - sensor.mains_0_untracked
          - sensor.fixed_value_consumers_energy_today
          - sensor.boiler_2_energy_today

This, however, corrupted the card and it showed infinity for the remaining_child_state. Is what I am trying to do not possible? Or am I doing it wrong?

In addition, I have one entity that belongs to all parents (fixed value consumer). I am guessing that Sankey is assigning the parent consumption alphabetically, i.e. fixed value will be supplied before the other children.

Is there a way to have fixed value filled last? BEcause the other children “Office” and “Siemens” should have priority (it is also closer to reality because the “fixed value” is a calculated template sensor which is less accurate than the measured ones).

You are creating a circular dependacy with the remaining entities. It might work if you remove sensor.mains_0_untracked from the children of Mains 0 Excess.
State is calculated based on the order in the config, not alphabetical.

1 Like

Just played around with this card and tried to mimic the client distribution in my Unifi network :smile:
Maybe not intended to be used for non-energy-entities but the first result is good enough :yum:

3 Likes

What am I missing, as I can not seem to figure out where this unmeasured is coming from?
Is is a calculation error?
That the unmeasured needs to be a remaing_child_state instead of a remaining_parent_state?

This unmeasured value is driving me nuts…
it looks OK, as I have a grid import and Solar production which totals to the second second, this total adds up

but the other childs are less then the total of solar and grid import which gives me the unmeasured.

code is here:

layout: auto
height: 630
round: 0
min_box_size: 15
min_box_distance: 8
show_states: true
show_units: true
sections:
  - entities:
      - type: entity
        children:
          - total
        entity_id: sensor.envoy_122220030405_current_power_production
        color: var(--warning-color)
        name: Solar Power
      - type: entity
        children:
          - total
        entity_id: sensor.p1_meter_power
        color: red
        name: Import Grid
  - entities:
      - type: remaining_parent_state
        children:
          - livingroom
          - kitchen
          - schuur
          - bedrooms
          - offices
          - washok
          - aircos
          - unknown
        entity_id: total
        name: Total Consumption
  - entities:
      - type: remaining_child_state
        children:
          - sensor.beneden_power
          - sensor.aquarium_power
          - sensor.tv_receiver_power
        entity_id: livingroom
        name: Beneden totaal
        color: green
      - type: remaining_child_state
        children:
          - sensor.kitchen_power
          - sensor.vaatwasser_power
        entity_id: kitchen
        color: pink
        name: Keuken
      - type: remaining_child_state
        children:
          - sensor.datacenter_power
        entity_id: offices
        name: Network
        color: green
      - type: remaining_child_state
        children:
          - sensor.vriezer_power
          - sensor.bierkoelkast_power
          - sensor.myenergi_zappi_21621507_power_ct_internal_load
        entity_id: schuur
        name: Schuur
        color: purple
      - type: remaining_child_state
        children:
          - sensor.1_2_verdieping_power
          - sensor.werkplek_ronald_power
          - sensor.werkplek_jacq_power
        entity_id: bedrooms
        name: 1e & 2e totaal
        color: green
      - type: remaining_child_state
        children:
          - sensor.wasmachine_power
          - sensor.droger_power
        entity_id: washok
        name: Washok
        color: orange
      - type: remaining_child_state
        children:
          - sensor.airco_power
        entity_id: aircos
        name: Aircos
        color: green
      - type: remaining_parent_state
        children: []
        entity_id: unknown
        color: grey
        name: Unmeasured
  - entities:
      - type: entity
        children: []
        entity_id: sensor.beneden_power
        name: Beneden verdieping
        color: green
      - type: entity
        children: []
        entity_id: sensor.aquarium_power
        name: Aquarium
        color: green
      - type: entity
        children: []
        entity_id: sensor.tv_receiver_power
        name: TV&Receiver
        color: green
      - type: entity
        children: []
        entity_id: sensor.kitchen_power
        name: Keuken
        color: pink
      - type: entity
        children: []
        entity_id: sensor.vaatwasser_power
        name: Vaatwasser
        color: pink
      - type: entity
        children: []
        entity_id: sensor.datacenter_power
        name: Network
        color: green
      - type: entity
        children: []
        entity_id: sensor.vriezer_power
        name: Vriezer
        color: purple
      - type: entity
        children: []
        entity_id: sensor.bierkoelkast_power
        name: Bier&Wijnkoelkast
        color: purple
      - type: entity
        children: []
        entity_id: sensor.myenergi_zappi_21621507_power_ct_internal_load
        name: Zappi
        color: purple
      - type: entity
        children: []
        entity_id: sensor.1_2_verdieping_power
        name: Slaapkamers + zolder
        color: green
      - type: entity
        children: []
        entity_id: sensor.werkplek_ronald_power
        name: Werkplek Ronald
        color: green
      - type: entity
        children: []
        entity_id: sensor.werkplek_jacq_power
        name: Werkplek Jacq
        color: green
      - type: entity
        children: []
        entity_id: sensor.droger_power
        name: Droger
        color: orange
      - type: entity
        children: []
        entity_id: sensor.wasmachine_power
        name: Wasmachine
        color: orange
      - type: entity
        children: []
        entity_id: sensor.airco_power
        name: Aircos
        color: green
type: custom:sankey-chart
show_names: true
show_icons: false
min_box_height: 10
wide: true
title: Current Power (Development)
static_scale: 500
min_state: 1

I don’t see a problem. You have a 27W discrepancy. This is normal. No sensor is perfect and there are always losses everywhere.
If you are certain that you have no unmeasured power and can’t recalibrate your sensors, you can use children_sum or parents_sum to reconcile the difference. They are not easy to understand though

1 Like

For anyone interested, I’ve just added a new custom card, specifically targeting homeassistant energy monitoring.

image

This deliberately aims to take the pain out of the setup, and automatically configures both energy and power cards using the HA energy configuration.

Some of it is still work in progress, but it is totally usable.

Feedback/comments/issues/PRs welcome!

4 Likes

Installed, worked. Good shot :wink:

1 Like

Just wanted to show off an example of your very fine work. Many thanks.

1 Like

hi again. don’t want to open an issue, since i’m quite sure i do something wrong, therefore i am asking here, why is this piece of code showing like the screen shot below? there is no connection to one of the children and it looks that its value is also not added as per the code.

      - type: entity
        children:
          - sensor.priza_centrala_termica_energy_power
          - sensor.priza_ups_centrala_termica_energy_power
          - sensor.priza_pompa_basa_energy_power
        add_entitites:
          - sensor.priza_ups_centrala_termica_energy_power
          - sensor.priza_pompa_basa_energy_power
        entity_id: sensor.priza_centrala_termica_energy_power
        name: Utilitati
        color: red

thanks for any help/suggestions!

because one of the children already “drained” the parent. Your Utilitati has a smaller value than the sum of its children.
The card can correct the values if you want. Search for “reconcile” in the Readme

thanks, that was really fast. i’ll look for reconcile right now. however, ‘Utilitati’ shouldn’t be the sum of ‘centrala_termica’ and ‘ups_centrala_termica’ according to the ‘add entities’ section of the code? it looks that 'ups_centrala_termica" is not added. 'pompa_basa" can be ignored, since is currently 0. i have a couple identical sections (different entities, of course) working correctly. what am i missing?

great! ‘reconcile’ fixed it! thanks a lot!