Anyone using the Sankey Chart Card?

You’re asking in the wrong place. The developer is not here.

Try asking here Issues · MindFreeze/ha-sankey-chart · GitHub

Also how are your external loads not powered from one of your three phases?

I’m using Sheely 3EM to measure energy consumption, but unfortunatelly I did not have enough space to install it next to main grid connection (or rather I have not enough space to install clamps), instead it is installed in main fuses box inside the house. That means that connection to garage (which is other building) is made before place where I can make measurements. So external represents everything that is installed in garage or powered from garage building. Technically it is one of these 3 phases, but Im just not capturing consumption on this part of installation. As such I’m using Powercalc to estimate consumption there.

2 Likes

Just installed the card and I have an issue with the child entities:
The code used is as follows:

       - type: custom:sankey-chart
         show_names: true
         sections:
           - entities:
             - entity_id: sensor.counter_appt_overall_power_l2
               children:
                 - sensor.bw_br_washer_power
                 - sensor.bw_corridor_meas_power
           - entities:
             - sensor.bw_kitchen_coffeemachine_power
             - sensor.bw_kitchen_dishwasher_power

What is shows is only the parent entity like on screenshot, others are ignored. Maybe somebody can advice what can cause this?
зображення

@tom_I Would you like to share your code for your card? It looks really nice.

Because your level 2 section entities are different than one specified as children in section 1…
Though it is a biot strange, as they SHOULD show, but disconnected from section one sensor…
:man_shrugging:

I use the Sidebar view option for the extra width and I also use the Sankey chart card inside an entities card (using custom hui-element) so that the theme matches my other cards. Otherwise the native title option of the Sankey card would require extensive card-mod work as it does not follow the same structure as the core cards.

Power:

type: entities
title: Power Distribution
entities:
  - type: custom:hui-element
    card_type: custom:sankey-chart
    show_names: true
    height: 300
    round: 2
    unit_prefix: k
    wide: true
    sections:
      - entities:
          - entity_id: sensor.grid_power
            name: Solar Power
            color: '#e0b400'
            children:
              - sensor.metering_power_supplied
              - sensor.solar_power_consumed
      - entities:
          - entity_id: sensor.solar_power_consumed
            name: Solar Power Consumption
            color: '#e0b400'
            children:
              - sensor.total_power_consumed
          - entity_id: sensor.metering_power_supplied
            name: Solar Power to Grid
            color: '#8353d1'
          - entity_id: sensor.metering_power_absorbed
            name: Grid Power Consumption
            children:
              - sensor.total_power_consumed
            color: '#e45e65'
      - entities:
          - entity_id: sensor.total_power_consumed
            name: Total Power Consumption
            remaining:
              name: Unmonitored
            children:
              - sensor.known_loads
            color: '#ff8000'
      - entities:
          - entity_id: sensor.known_loads
            name: Monitored Loads
            children:
              - sensor.bar_fridge_power
              - sensor.cinema_av_power
              - sensor.cinema_subwoofer_power
              - sensor.comms_rack_power
              - sensor.dishwasher_power
              - sensor.downstairs_heat_pump_power
              - sensor.electric_blanket_power
              - sensor.electronics_bench_power
              - sensor.fridge_power
              - sensor.hot_water_power
              - sensor.led_table_power
              - sensor.lounge_av_power
              - sensor.lounge_dehumidifier_power
              - sensor.mechanical_bench_power
              - sensor.pc_monitor_power
              - sensor.pi3b_power
              - sensor.rack_fan_power
              - sensor.rumpus_dehumidifier_power
              - sensor.spb_electric_blanket_power
              - sensor.upstairs_heat_pump_power
              - sensor.washing_machine_power
              - sensor.workshop_chargers_power
            color: '#039BE5'
      - entities:
          - sensor.bar_fridge_power
          - sensor.cinema_av_power
          - sensor.cinema_subwoofer_power
          - sensor.comms_rack_power
          - sensor.dishwasher_power
          - sensor.downstairs_heat_pump_power
          - sensor.electric_blanket_power
          - sensor.electronics_bench_power
          - sensor.fridge_power
          - sensor.hot_water_power
          - sensor.led_table_power
          - sensor.lounge_av_power
          - sensor.lounge_dehumidifier_power
          - sensor.mechanical_bench_power
          - sensor.pc_monitor_power
          - sensor.pi3b_power
          - sensor.rack_fan_power
          - sensor.rumpus_dehumidifier_power
          - sensor.spb_electric_blanket_power
          - sensor.upstairs_heat_pump_power
          - sensor.washing_machine_power
          - sensor.workshop_chargers_power

Energy:

type: entities
title: Daily Energy Distribution
entities:
  - type: custom:hui-element
    card_type: custom:sankey-chart
    show_names: true
    height: 300
    round: 2
    unit_prefix: k
    wide: true
    sections:
      - entities:
          - entity_id: sensor.energy_from_grid_daily_peak
            name: Grid Peak Energy Used
            color: '#488fc2'
            children:
              - sensor.energy_imported_daily_total
          - entity_id: sensor.energy_from_grid_daily_offpeak
            name: Grid Offpeak Energy Used
            color: '#2f5f82'
            children:
              - sensor.energy_imported_daily_total
          - entity_id: sensor.energy_inverter_daily
            name: Solar Energy Produced
            color: '#ff9800'
            children:
              - sensor.energy_to_grid_daily
              - sensor.self_solar_consumption_daily
      - entities:
          - entity_id: sensor.energy_imported_daily_total
            name: Daily Imported Total
            children:
              - sensor.energy_consumed_daily_total
          - entity_id: sensor.self_solar_consumption_daily
            name: Self Consumed Solar
            color: '#ff9800'
            children:
              - sensor.energy_consumed_daily_total
          - entity_id: sensor.energy_to_grid_daily
            name: Solar Energy Exported
            color: '#8353d1'
      - entities:
          - entity_id: sensor.energy_consumed_daily_total
            name: Total Energy Used
            color: '#488FC2'
            remaining:
              name: Unmonitored
            children:
              - sensor.bar_fridge_daily_energy
              - sensor.cinema_av_daily_energy
              - sensor.comms_rack_daily_energy
              - sensor.dishwasher_daily_energy
              - sensor.electronics_bench_daily_energy
              - sensor.fridge_daily_energy
              - sensor.energy_downstairs_heat_pump_daily
              - sensor.energy_hot_water_daily_peak
              - sensor.energy_hot_water_daily_offpeak
              - sensor.led_table_daily_energy
              - sensor.lounge_av_daily_energy
              - sensor.lounge_dehumidifier_daily_energy
              - sensor.electric_blanket_daily_energy
              - sensor.mechanical_bench_daily_energy
              - sensor.pc_monitor_daily_energy
              - sensor.rack_fan_daily_energy
              - sensor.rumpus_dehumidifier_daily_energy
              - sensor.spb_electric_blanket_daily_energy
              - sensor.cinema_subwoofer_daily_energy
              - sensor.energy_upstairs_heat_pump_daily_peak
              - sensor.energy_upstairs_heat_pump_daily_offpeak
              - sensor.washing_machine_daily_energy
              - sensor.workshop_chargers_daily_energy
      - entities:
          - entity_id: sensor.bar_fridge_daily_energy
            name: Bar Fridge
            color: '#039BE5'
          - entity_id: sensor.cinema_av_daily_energy
            name: Cinema AV Gear
            color: '#039BE5'
          - entity_id: sensor.comms_rack_daily_energy
            name: Comms Rack
            color: '#039BE5'
          - entity_id: sensor.dishwasher_daily_energy
            name: Dishwasher
            color: '#039BE5'
          - entity_id: sensor.electronics_bench_daily_energy
            name: Electronics Bench
            color: '#039BE5'
          - entity_id: sensor.fridge_daily_energy
            name: Fridge
            color: '#039BE5'
          - entity_id: sensor.energy_downstairs_heat_pump_daily
            name: Downstairs Heat Pump
            color: '#039BE5'
          - entity_id: sensor.energy_hot_water_daily_peak
            name: Hot Water (Peak)
            color: '#039BE5'
          - entity_id: sensor.energy_hot_water_daily_offpeak
            name: Hot Water (Offpeak)
            color: '#039BE5'
          - entity_id: sensor.led_table_daily_energy
            name: LED Table
            color: '#039BE5'
          - entity_id: sensor.lounge_av_daily_energy
            name: Lounge AV Gear
            color: '#039BE5'
          - entity_id: sensor.lounge_dehumidifier_daily_energy
            name: Lounge Dehumidifier
            color: '#039BE5'
          - entity_id: sensor.electric_blanket_daily_energy
            name: Master Bedroom Elect Blanket
            color: '#039BE5'
          - entity_id: sensor.mechanical_bench_daily_energy
            name: Mechanical Bench
            color: '#039BE5'
          - entity_id: sensor.pc_monitor_daily_energy
            name: PC Monitor
            color: '#039BE5'
          - entity_id: sensor.rack_fan_daily_energy
            name: Rack Fan
            color: '#039BE5'
          - entity_id: sensor.rumpus_dehumidifier_daily_energy
            name: Rumpus Dehumidifier
            color: '#039BE5'
          - entity_id: sensor.spb_electric_blanket_daily_energy
            name: Spare Bedroom Elec Blanket
            color: '#039BE5'
          - entity_id: sensor.cinema_subwoofer_daily_energy
            name: Subwoofer
            color: '#039BE5'
          - entity_id: sensor.energy_upstairs_heat_pump_daily_peak
            name: Upstairs Heat Pump (Peak)
            color: '#039BE5'
          - entity_id: sensor.energy_upstairs_heat_pump_daily_offpeak
            name: Upstairs Heat Pump (Offpeak)
            color: '#039BE5'
          - entity_id: sensor.washing_machine_daily_energy
            name: Washing Machine
            color: '#039BE5'
          - entity_id: sensor.workshop_chargers_daily_energy
            name: Workshop Chargers
            color: '#039BE5'
5 Likes

Thanks, that provided sufficient clues on the card code structure. Now it works!

@tom_l Thanks

1 Like

2 new questions:

  1. can we name children? Didn’t find anything
  2. this is my config:
type: custom:sankey-chart
show_names: true
height: 400
round: 2
wide: true
sections:
  - entities:
      - entity_id: sensor.shelly_3em_power_total
        name: Watt_total
        remaining:
          name: Other
        children:
          - sensor.espressomaschine_power
          - sensor.server_power
          - sensor.heizung_strom_power
          - sensor.studio_power_2
          - sensor.kuhlmess_power
          - sensor.freezer_power
          - sensor.tv_power
          - sensor.trockner_power
          - sensor.spulmaschine_power
          - sensor.wallbox_watt
  - entities:
      - entity_id: sensor.server_power
        name: Server
        remaining:
          name: Other
        children:
          - sensor.ups_watt
  - entities:
      - sensor.espressomaschine_power
      - sensor.server_power
      - sensor.heizung_strom_power
      - sensor.studio_power_2
      - sensor.kuhlmess_power
      - sensor.freezer_power
      - sensor.tv_power
      - sensor.trockner_power
      - sensor.spulmaschine_power
      - sensor.wallbox_watt

works fine in general, but not the children part. sensor.ups_watt should be a child of sensor.server_power, but the “remaining” “other” part is never shown. Instead it looks like this

.

Is it because sensor.ups_watt is not a sensor, but a template? (excuse me if using the wrong nomenclature). Everywhere else sensor.ups_watt works fine.
in configuration.yaml it is defines like this:

  - sensor:
    - name: "UPS_Watt"
      unique_id: UPS_Watt
      state: >-
        {{ (states('sensor.myups_output_voltage')|float(0) * states('sensor.myups_output_current')|float(0))}}
      unit_of_measurement: W
      device_class: power
      state_class: measurement

I think everything that is listed under children needs to also be listed again later under an - entities. That should also let you name the children.

3 Likes

Really like this card as well!
Only thing I am struggling is with the coulouring scheme. Could anyone give me a hint how to use it?
I am used to Hex, RGB or CMYK, but never encountered this (var--xyz) scheme…

You don’t have to use that format for the color - you can stick to the simpler color: blue type settings. If you want a more specific color or only colors in certain circumstances then you can get fancier with it.

1 Like

Those are color variables defined in the theme.yaml. Here is example f this file content:

  dark-background: "#1C1E2E"        #var(--dark-background)
  medium-background: "#242635"      #var(--medium-background)
  light-background: "#2C2E3C"       #var(--light-background)
  components-background: "#242635"  #var(--components-background)
  bright-text: "#ffffff"            #var(--bright-text)
  dimmed-text: "#A4A7B4"            #var(--dimmed-text)
  dark-text: "#444856"              #var(--dark-text)
  cyan-text: "#1bbfff"              #var(--cyan-text)
  alert-text: "#CD1015"             #var(--alert-text)

The first column shows actual definitions of different interface components, the second one displays as comment variable to be used to use specific color in the UI. For this matter you can define in your theme additional colors, that are not specific to UI elements, but also can be used same way. Here is sample of color palette I’m using in my theme:

  orange1: "#F5A624"
  orange2: "#DBBC09"
  orange3: "#AB6D09"
  orange4: "#784E07"
  orange5: "#452F05"
  orange6: "#121003"

Please note that not all cards accpt variables as color definition, though…

3 Likes

Thanks a lot! Now I understand the sysstem.

Did anyone got it working with the children naming?
Tried it with different options via the children part or in the entities part, but nothing seems to work (or is miss something).

For example:

children:
          - sensor.shellyplug01_power
            name: test plug
          - sensor.shellyplug02_power
          - sensor.shellyplug03_power
          - sensor.shellyplug04_power
          - sensor.shellyplug05_power
  - entities:
      - sensor.shellyplug01_power
        name: test plug
      - sensor.shellyplug02_power
      - sensor.shellyplug03_power
      - sensor.shellyplug04_power
      - sensor.shellyplug05_power

The names will always go under the - entity_id: sensor.my_sensor.

Here’s my current config, hopefully it’ll be a bit clearer:

type: custom:sankey-chart
title: Realtime Power
show_names: true
min_box_height: 8
sections:
  - entities:
      - entity_id: sensor.breaker_panel_electric_consumption_w
        name: Total
        children:
          - sensor.network_rack_electric_consumption_w
          - sensor.cam_plug_power
          - sensor.washer_electric_consumption_w
          - sensor.smart_bulbs_power
        remaining:
          name: All Others
  - entities:
      - entity_id: sensor.washer_electric_consumption_w
        name: Washer
      - entity_id: sensor.network_rack_electric_consumption_w
        name: Network Rack
        children:
          - sensor.idrac_host1_powerconsumption
          - sensor.idrac_host2_powerconsumption
          - sensor.idrac_host3_powerconsumption
        remaining:
          name: Other Network
      - entity_id: sensor.cam_plug_power
        name: Driveway Cam
      - entity_id: sensor.smart_bulbs_power
  - entities:
      - entity_id: sensor.idrac_host1_powerconsumption
        name: Host 1
      - entity_id: sensor.idrac_host2_powerconsumption
        name: Host 2
      - entity_id: sensor.idrac_host3_powerconsumption
        name: Host 3

4 Likes

Awesome! thx. its working now.

1 Like

Just starting to play with this amazing looking card, but not getting the fill in effect and flow displaying. I’ve tweaked my sensors so that they’re all in a similar range of each other, in case the line couldn’t be drawn because of huge variation in value, but I can’t get it to display the flows.

type: custom:sankey-chart
show_names: true
unit_prefix: k
round: 1
wide: true
sections:
  - entities:
      - entity_id: sensor.givtcp_ce2209g009_pv_power
        name: Solar
        color: var(--warning-color)
        children:
          - sensor.givtcp_ce2209g009_pv_energy_today_kwh
      - entity_id: sensor.givtcp_ce2209g009_grid_power
        name: Grid
        children:
          - sensor.givtcp_ce2209g009_import_energy_today_kwh
      - entity_id: sensor.givtcp_ce2209g009_battery_power
        name: Battery
        colora: var(--success-color)
        children:
          - sensor.givtcp_ce2209g009_battery_throughput_today_kw
  - entities:
      - entity_id: sensor.kitchen_fridge_current_energy
        name: Kitchen Fridge
      - entity_id: sensor.garage_fridge_current_energy
        name: Kitchen Fridge

@Fayrewood wherever you have a sensor listed as a child, you also have to list it again under a subsequent -entities and - entity_id:. Also, it doesn’t look like you have your fridges listed as children anywhere, so you’ll need to add those in as children under one of the other entities.

2 Likes

Hi Tom.
This is a fantastic (!) layout and exactly what I’m trying to establish. Are each of the cards in the screenshot above a separate sankey card in the dashboard view, or is it a single sankey card with code?