Anyone using the Sankey Chart Card?

Success! After a number of trial and error attempts, I noticed the card I had tried the Autoconfig with now showed a good bit of data (no longer simply failing);

Upon examination of the yaml code, I picked up a number of very helpful hints. While the grid import and export did not show up correctly, I figured out how to adjust those. One template calculation I added is
sensor.total_energy_consumed

And instead of arranging my loads by area, I arranged them by function;

height: 450
show_names: true
unit_prefix: k
round: 1
min_box_height: 3
min_box_distance: 5
show_states: true
show_units: true
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.solaroutneg_wh
        type: entity
        name: Solar Generation
        color: var(--warning-color)
        children:
          - sensor.total_energy_consumed
          - sensor.export_wh
      - entity_id: sensor.grid_import
        type: entity
        name: Grid Import
        color: maroon
        children:
          - sensor.total_energy_consumed
  - entities:
      - entity_id: sensor.export_wh
        type: entity
        color: purple
        name: Grid Export
        children: []
      - entity_id: sensor.total_energy_consumed
        type: remaining_parent_state
        name: Total Consumption
        color: darkblue
        children:
          - transportation
          - space_heating
          - water_supply
          - kitchen
          - offices
          - studio
          - lighting
          - laundry
          - entertainment
          - unknown
  - entities:
      - entity_id: transportation
        type: remaining_child_state
        color: blue
        name: Transportation
        children:
          - sensor.120v_ev_charger_total_daily_energy
          - sensor.juicebox_energy_added
      - entity_id: space_heating
        type: remaining_child_state
        color: green
        name: Space Heating
        children:
          - sensor.heatpump_wh
          - sensor.furnace_wh
          - sensor.air_filter_energy
      - entity_id: water_supply
        type: remaining_child_state
        name: Water Supply
        color: green
        children:
          - sensor.test3_wh
      - entity_id: kitchen
        type: remaining_child_state
        color: green
        name: Kitchen
        children:
          - sensor.kitchen_ceiling_dimmer_2_energy
          - sensor.refrigerator_energy
          - sensor.dishwasher_total_daily_energy
      - entity_id: offices
        type: remaining_child_state
        color: green
        name: Offices
        children:
          - sensor.annoffice_wh
          - sensor.work_office_total_daily_energy
          - sensor.study_electronics_total_daily_energy
      - entity_id: studio
        type: remaining_child_state
        color: green
        name: Studio
        children:
          - sensor.studioplugs_wh
          - sensor.studio_musician_lights_energy_2
      - entity_id: lighting
        type: remaining_child_state
        color: green
        name: Other Lighting
        children:
          - sensor.front_porch_lights_energy
          - sensor.back_porch_light_energy
          - sensor.master_bath_light_energy
          - sensor.studio_landing_light_energy
          - sensor.side_porch_light_energy
      - entity_id: laundry
        type: remaining_child_state
        color: green
        name: Laundry
        children:
          - sensor.clothes_dryer_energy
      - entity_id: entertainment
        type: remaining_child_state
        color: green
        name: Entertainment
        children:
          - sensor.family_room_tv_energy_2
      - entity_id: unknown
        type: remaining_parent_state
        color: gray
        name: Not Yet Monitored
        children: []
  - entities:
      - entity_id: sensor.120v_ev_charger_total_daily_energy
        type: entity
        name: Level 1 Charger
        color: blue
        children: []
      - entity_id: sensor.juicebox_energy_added
        type: entity
        name: Level 2 Charger
        color: blue
        children: []
      - entity_id: sensor.heatpump_wh
        type: entity
        name: Heat Pump
        color: green
      - entity_id: sensor.furnace_wh
        type: entity
        name: HVAC Blower
        color: green
      - entity_id: sensor.air_filter_energy
        name: Air Filter
        type: entity
        color: green
      - entity_id: sensor.test3_wh
        type: entity
        name: Well Pump
        color: green
      - entity_id: sensor.kitchen_ceiling_dimmer_2_energy
        type: entity
        name: Kitchen Lights
        color: green
      - entity_id: sensor.dishwasher_total_daily_energy
        type: entity
        name: Dishwasher
        color: green
      - entity_id: sensor.refrigerator_energy
        type: entity
        name: Refrigerator
        color: green
      - entity_id: sensor.annoffice_wh
        type: entity
        name: Work Office 1
        color: green
      - entity_id: sensor.work_office_total_daily_energy
        type: entity
        name: Work Office 2
        color: green
      - entity_id: sensor.study_electronics_total_daily_energy
        type: entity
        name: Study
        color: green
      - entity_id: sensor.studioplugs_wh
        type: entity
        name: Studio
        color: green
      - entity_id: sensor.studio_musician_lights_energy_2
        type: entity
        name: Studio Lights
        color: green
        children: []
      - entity_id: sensor.front_porch_lights_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.back_porch_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.master_bath_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.studio_landing_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.side_porch_light_energy
        type: entity
        color: green
        children: []
      - entity_id: sensor.clothes_dryer_energy
        type: entity
        name: Clothes Dryer
        color: green
      - entity_id: sensor.family_room_tv_energy_2
        type: entity
        name: Family Room TV
        color: green
type: custom:sankey-chart
min_state: 0

I’ll be adding more sensors to chase down other yet-unmonitored consumption. And I will see if I can add another layer for Home for a clean classification to provide the Home and Transportation categories

The monthly view checks out well;

I very much appreciate the efforts that @MindFreeze has undertaken to provide this capability!

1 Like

I’ve updated the chart to cleanly delineate what is Transportation and what is Home energy consumption, to see how close I am to residential net-zero (or beyond). Still have some circuits/outlets to meter/monitor and may still find some phantom loads (or ones requiring better oversight). This is a very helpful tool to keep track of electrical energy consumption, can’t say enough nice things about what @MindFreeze has done with this specialty chart!

We had been painted indoors that day, so the Heat Recovery Ventilator was on high for about 48 hours, otherwise just comes on low about an hour every day.

2 Likes

Card works ok when using energy, no matter if 3 of 5 sections.
But when using power the connections get lost quite often.
I’m not yet sure if that’s a result that the card isn’t catching up state changes in time or something like that. I doubt this being the case since the machine idles more or less means it’s surely not related to an extensice load. Any chance one could force the card checking values? Sort of an update_interval as known from ESPhome sensors?

Values are always updated but the client browser can get overloaded with frequent updates and stutter. Try using the throttle option to limit updates.

1 Like

ups … that was an easy one, it solved the issue straight.
May I ask another thing.Would you mind updating the readme on github? I recently stumbled across a “remaining:” which I wasn’t aware of simply because not being documented. The one to be placed right below the chidrens.
I do fear I likely missed all the 99 dead cool options which are undocumented aswell :grinning_face_with_smiling_eyes:

Remaining is deprecated and will be removed in a future version. Only works for backwards compatibility. type: remaining_parent_state is the correct way of doing the same thing.

Love this card and this thread has been very helpful to getting this far. One frustrating issue I cannot seem to overcome is color blending and how to make sure the final entities carry the correct color from the parent. No matter what I do, I can’t seem to alter the final blue color and this results in some harsh lines which you can see most clearly in the ‘Second Floor Load’ branch. Anyone have this issue or know what might be causing it? Thank you in advance!

show_names: true
height: 600
unit_prefix: k
round: 2
wide: true
sections:
  - entities:
      - entity_id: sensor.totalpower
        name: Grid Consumption
        color: '#e45e65'
        remaining:
          name: Other
        children:
          - sensor.totalac
          - sensor.secondfl_load
          - sensor.firstfl_load
          - sensor.basement_load
          - sensor.apt_load
  - entities:
      - entity_id: sensor.totalac
        name: Air Conditioner Load
        color: '#e4a15e'
        children:
          - sensor.ac_1
          - sensor.air_handler_1
          - sensor.ac_2
          - sensor.air_handler_2
  - entities:
      - entity_id: sensor.secondfl_load
        name: Second Floor Load
        color: '#e4a15e'
        remaining:
          name: Other
        children:
          - sensor.second_floor
          - sensor.sub_pool_floorheat
  - entities:
      - entity_id: sensor.firstfl_load
        name: First Floor Load
        color: '#ff2bf8'
        children:
          - sensor.laundry_primary
          - sensor.kitchen_w_livingroom
          - sensor.kitchen_apps_dining
          - sensor.kitchendw_dinette
  - entities:
      - entity_id: sensor.kitchen_w_livingroom
        name: First Floor West
        color: '#ff2bf8'
        remaining:
          name: Fridge
        children:
          - sensor.living_room_media_plug_power
  - entities:
      - entity_id: sensor.basement_load
        name: Basement Load
        color: '#a6bfbb'
        children:
          - sensor.navien
  - entities:
      - entity_id: sensor.apt_load
        name: Apartment Load
        color: '#54b1f7'
        children:
          - sensor.apartment
  - entities:
      - sensor.apartment
      - sensor.ac_1
      - sensor.air_handler_1
      - sensor.ac_2
      - sensor.air_handler_2
      - sensor.second_floor
      - sensor.sub_pool_floorheat
      - sensor.laundry_primary
      - sensor.living_room_media_plug_power
      - sensor.kitchen_apps_dining
      - sensor.kitchendw_dinette
      - sensor.navien

You just have to specify color for all relevant entities. So use the long form with entity_id: and color: instead of just listing the entity id.
Also everyone please stop using remaning:. It is deprecated. Use type: remaining_parent_state instead. There are examples in the README.

2 Likes

Since you re-newed the information about remaining: (I removed it straight after your recently given explanation) 2 times within 1 week :slight_smile: , may I suggest you mention this on your github, best bet using RED BOLD text saying deprecated or something like that?
Poeple like me tend to a) read the options but also b) look in here for example YAML to get started.

Thank you, appreciate the reply! Incredible work on this. I grabbed ‘remaining’ from earlier messages in this thread without checking the docs on it so thanks for that too.

Updated chart looks much better.

type: custom:sankey-chart
show_names: true
height: 600
unit_prefix: k
round: 2
wide: true
sections:
  - entities:
      - entity_id: sensor.totalpower
        name: Grid Consumption
        color: '#e45e65'
        children:
          - sensor.totalac
          - sensor.secondfl_load
          - sensor.firstfl_load
          - sensor.basement_load
          - sensor.apt_load
          - sensor.balance
  - entities:
      - entity_id: sensor.totalac
        name: Air Conditioner Load
        color: '#e4a15e'
        children:
          - sensor.ac_1
          - sensor.air_handler_1
          - sensor.ac_2
          - sensor.air_handler_2
      - entity_id: sensor.secondfl_load
        name: Second Floor Load
        color: '#e4a15e'
        children:
          - sensor.second_floor
          - sensor.sub_pool_floorheat
      - entity_id: sensor.firstfl_load
        name: First Floor Load
        color: '#ff2bf8'
        children:
          - sensor.laundry_primary
          - sensor.kitchen_w_livingroom
          - sensor.kitchen_apps_dining
          - sensor.kitchendw_dinette
      - entity_id: sensor.basement_load
        name: Basement Load
        color: '#a6bfbb'
        children:
          - sensor.navien
      - entity_id: sensor.apt_load
        name: Apartment Load
        color: '#54b1f7'
        children:
          - sensor.apartment
  - entities:
      - entity_id: sensor.kitchen_w_livingroom
        name: First Floor West
        color: '#ff2bf8'
        children:
          - sensor.living_room_media_plug_power
  - entities:
      - entity_id: sensor.apartment
        color: '#54b1f7'
      - entity_id: sensor.ac_1
        color: '#e4a15e'
      - entity_id: sensor.air_handler_1
        color: '#e4a15e'
      - entity_id: sensor.ac_2
        color: '#e4a15e'
      - entity_id: sensor.air_handler_2
        color: '#e4a15e'
      - entity_id: sensor.second_floor
        color: '#e4a15e'
      - entity_id: sensor.sub_pool_floorheat
        color: '#e4a15e'
      - entity_id: sensor.laundry_primary
        color: '#ff2bf8'
      - entity_id: sensor.living_room_media_plug_power
        color: '#ff2bf8'
      - entity_id: sensor.kitchen_apps_dining
        color: '#ff2bf8'
      - entity_id: sensor.kitchendw_dinette
        color: '#ff2bf8'
      - entity_id: sensor.navien
        color: '#a6bfbb'
      - entity_id: sensor.balance
        color: '#e45e65'
        name: Unaccounted

Hi all,

Managed to get a basic energy flow Sankey chart working, however I cannot get the Energy Date Selection aspect to work. It works fine in HA’s energy dashboard, but the Sankey chart will only show today’s figures, clicking back a day or two does nothing.

Any ideas appreciated.


enable the filtering in sankey with energy_date_selection: true

1 Like

@MindFreeze thank you. When I do that, for some reason I get error to say an entity is not found (but it works ok in the sankey without this set as true)?

Perhaps you have an entity without history. Either very new or somehow not setup for history. Try starting from an empty card and adding entities 1 by 1 to see which one it is. There was something peculiar with the state_class property but I don’t remember what it was exactly.

@Mindfreeze an chance we could have a multiline name for an entity? I do ask because I run out of smart plugs to measure every device but the great sankey card does allow me to see upon which of the 3 phases some items belong to. Means I would like to put these names to the final entity sort of:

- various
  name: dishwasher 
        kettle
        diningroom

eg collecting names representing the ‘various’ consumers.

Sounds cool. But please post a feature request in GitHub so I can see it when I find time to work on the card.

I’m trying to do the same but I’m missing sometihg.
I created an experimental panel like this:


I have a card with the energy-date-selection with this code:

type: energy-date-selection
view_layout: null

I have another with the sunkey chart with following code:

type: custom:sankey-chart
show_names: true
unit_prefix: k
energy_date_selection: true
sections:
  - entities:
      - entity_id: sensor.quadrorc_geral_energy

I tried to use energy_date_selection: true and energy-date-selection: true but none of them work.
I change the dates but the values don´t change.
Can you help?
Thanks

views:
  - theme: Backend-selected
    title: Home
    type: custom:grid-layout
    badges: []
    cards:
      - type: energy-date-selection
      - type: custom:sankey-chart
        show_names: true
        round: 1
        unit_prefix: k
        height: 520
        energy_date_selection: true

my config that works

does default energy dashboard work correctly for you?

Something weird happened to me today even in default energy card


Yes, my energy dashboard works fine. I can change the period and the graphs change accordingly.
It looks that I have the same config as you do but mine doesn’t work

  - theme: Backend-selected
    title: EXP
    type: sidebar
    badges: []
    cards:
      - type: energy-date-selection
      - type: custom:sankey-chart
        show_names: true
        unit_prefix: k
        energy_date_selection: true

With this configuration all I get is a message saying:
Error: Something went wrong. No energy data received.

Have to come back to you on that one.
Doesn’t work, well it does up to some % … I got a vertical stack with 2 sankey cards in.
First one is the energy consumption with repect to the time selector.
Below I tried the same entities but this time with actual power consumption.
As you might guess this is under heavy fluctuation depnding upon various consumers being switched on or off to waste the photovoltaics overproduction before selling it for next to nothing to the energy provider.

throttle does help partly but I still end up with sections being drawn unconnected.

I thought about using rieman sum with a 3-5 second time which is next to the same but current consumption but this won’t work since then I need to establish temp entities to cover all the ‘remaining_partent_state’ entities.

Any idea about how throttle does work at the moment? Does it delay the overall update or does it collect states in time but sort of act like an update_interval to the viuals only? Later would be ideal I’d say.