Energy & power flow with generation and battery monitoring - live sankey charts

Energy Sankey is a HACS frontend component, creating a visual sankey diagram showing the flow of electrical power & energy.

video3

  • Live updating
  • supports flow in/out of grid
  • supports generation
  • supports batteries (including multiple batteries)
  • width of lines indicates amount of electricity
  • Separate cards for instantaneous power and daily total energy
  • dynamic scaling
  • graphical editor
  • multiple languages supported
  • automatic configuration based on HA energy dashboard settings
  • works even if you have partial monitoring installed

Other sankey cards are available, but the aim here is an easy to understand consistent visual look, specifically for electrical energy, with the layout and colors mirroring the built-in HA energy distribution card. No fuss and no complicated setup or yaml.

Most users should be able to add both cards to immediately get a view of their energy/power flow.

Thanks for help from community members who’ve beta tested this! Enjoy!

https://github.com/davet2001/energy-sankey

–

Previous releases

Version 0.0.16

  • Fix occasional visual glitching of phantom generation source #53

Version 0.0.17

  • Allow battery power direction to be flipped in #57

Version 0.0.18

  • Fix unknown source when discharging to grid in #60
  • Fix unnecessary residual untracked consumer in #62
  • Optimise space usage at top and bottom of card in #63

Version 0.0.19

  • Hide upper tier consumers to fix double counting in #72
  • Treat NaN/undef as 0 when grouping low consumers in #73
  • Allow separate grid in/out to be specified on power card in #83
  • Provide option to show battery charge coming exclusively from generation in #86

Version 0.0.21

  • Fix uncaught TypeError: setting getter-only property “styles” in #108
  • Reduce power consumer grouping threshold from 100 to 20W in #90
  • Make non-real consumers unclickable in #93
  • Display consumers in order of size in power and energy graphs in #94
  • Tidy up types and add missing members to EnergyElecFlowCardConfig in #95
  • Include battery flows in max trunk width calculation in #97
  • Make consumer arrow heads fixed length in #101

Update 29/7/2025
Version 0.0.27 is now available!

  • Fix issue #157 where power card did not display if no solar was configured in 158
  • Issue149 fix consumer and battery selector in UI in 151
  • Add prompts in UI for language translation in #144
  • Fix problem where generation source would not show on power card in #147
  • Handle edge case where total flow=0 causes divide-by-0 error in 115
  • Add French translation by @zoic21 in #121
  • Fix sorting of consumer routes in #137
  • Fix missing icon/text for phantom grid in/out in #139
  • Add Czech translation by @HellixFix in #138
  • Make energy card work even if no grid in/out configured in HA energy dashboard in #140

New Contributors

  • @zoic21 made their first contribution in #121
  • @HellixFix made their first contribution in #138

Update 22/9/2025
Version 1.0.1 is now available!

What’s Changed

  • Create German Translation by @rschoell in #159
  • Correct readme translation file link by @davet2001 in #161
  • Add Italian translation by @perse998 in #166
  • Use the word home instead of untracked for 0 consumers by @davet2001 in #173, #173
  • Spanish translation + minor translation fixes by @cofade in #176
  • Add translation keys for ‘home’ by @davet2001 in #174
  • Fix #179 where phantom grid source would turn on and off by @davet2001 in #184

New Contributors

  • @rschoell made their first contribution
  • @perse998 made their first contribution
  • @cofade made their first contribution
5 Likes

Did you hard code those colours or use the frontend variables?

I’ve changed some of my energy colours using themes to make it clearer:

If you did hard code them you may want to use these variables instead:

  ### Energy Panel Colours ###
  energy-grid-consumption-color-0: '#e45e65'
  energy-grid-consumption-color-1: '#039bef'
  energy-grid-consumption-color-2: '#0da035'
# energy-grid-return-color-0
# energy-battery-in-color-0
# energy-battery-out-color-0
  energy-solar-color-0: '#e0b400'
# energy-gas-color-0
# energy-water-color-0

I used the frontend variables for the sources (grid, generation, discharging batteries). The flow out to consumers (grid, charging batteries, appliances) is a blended colour depending on where the energy came from.

It falls back to hardcoded colours if it can’t find the official ones for any reason.

1 Like

Updated version 0.0.16 is now available :slight_smile:

Updated version 0.0.18 is now available!

The energy sankey card repo is now on HACS, so installation is even easier!

Search for ‘Energy Sankey’ in HACS.

Thank you HACS team!

I just installed the card and i have this result about the energy distribution today.

Can you explain me why i have Untracked instead the name of the energy get?

And more, why the interrrogative point in the power flow card:

I have all my home consumes monitored by only one meter, and many smart plugs…

Hi,

Do you have energy sources configured in the energy dashboard for home assistant?

This is found in Menu > Settings > Dashboards > Energy.

You need to have the devices listed under ‘Individual Devices’

I assume you mean the question mark ‘?’ at the top…

This is showing that your consumption power ~1500W is well in excess of the power coming from the grid 251W. So either one of your sensors is giving a wrong reading, or you have another source of power in your system e.g. generation.

Yes, i have only one source that comes from my home meter

I have all the individual devices listed there, but i have NO sensor for untracked energy as you can see from the screenshots i posted.

In the sources i have only this:

And actually, after an HA reset i have this in the flow card.

As you see the untracked now is zero, but the previous value of this is now in the question mark.

Your data is showing more consumption than input power.

The graph can’t resolve this so it creates the ‘phantom’ generation source. That either means you have some sensors with incorrect values, or you have some extra power going into your system.

Do you have power monitoring on individual breakers? If so, there is a known double counting issue which will be fixed in 0.0,19+, see issue 70.

Hmm… no, it’s possible i have some incorrect values… i’ll doble check it.
About untracked value i cannot delete it as i don’t have an entity_id linked to it.

Maybe a wrong entity_id inside the .storage folder?

Untracked is the item created by the card to balance the flow. It represents the consumption that is not accounted for by the other sensors.

Hope this helps!

Trying to use this card with tibber doesn’t seem to work properly.

Having the grid consumption entity set as the recommended “tibber:energy_consumption_f5926e11f75b4713a173f62f8f043d5f”
doesn’t work because the entity doesn’t have a unique identifier.

@doffen Please could you try creating a template sensor as a proxy for the tibber one?

I am not familiar with tibber or how the sensors are different to standard ones.

Version 0.0.19 is now available!

Hi, this looks like a nice card which I will try for a bit to see if I can integrate into my main dashboard. Thanks!

A few notes so far:

When I search for a card to add, the power flow card takes a long time to show:

After a while I can select it and had to manually enter the power sensors, but I think this is expected, since only energy is configured on the energy dashboard:

End result is neat, will check again tomorrow when the sun is out:

Hi @rekenaar, at that stage, the power card is trying to auto configure based on the energy config. But generating this config is not trivial, as the energy config stores no power sensors.

Effectively it has to work out which power sensors are likely to be associated with the energy sensors in the config. It then uses this as the start point for the settings you can change in the GUI.

If nothing is displaying, the auto configuration might be failing.

Please could you provide the browser console output (F12) when you try to add the card again? This won’t affect your existing cards. I recommend going to a new blank dashboard, enter edit mode, clear the log, ctrl-F5 the page then try to add the power card. Please paste the log here.

Hi, see below. But the wait time was much better today, so not sure if you need to waste too much time only for me.

energy-sankey.js?hacstag=8757988630021:2640 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'stat_energy_to')
    at HuiEnergyElecFlowCard._getStatistics (energy-sankey.js?hacstag=8757988630021:2640:52)
    at Array.<anonymous> (energy-sankey.js?hacstag=8757988630021:2576:41)
    at Object.setState (energy-sankey.js?hacstag=8757988630021:923:32)
    at energy-sankey.js?hacstag=8757988630021:1009:60
_getStatistics @ energy-sankey.js?hacstag=8757988630021:2640
(anonymous) @ energy-sankey.js?hacstag=8757988630021:2576
setState @ energy-sankey.js?hacstag=8757988630021:923
(anonymous) @ energy-sankey.js?hacstag=8757988630021:1009

The flow is looking good today:

Version 0.0.21 is now available!