Skip to content

Style Sankey

tempus2016 edited this page Nov 11, 2026 · 3 revisions

Sankey (v2.0.0+)

A Sankey chart of power flowing from solar and the grid into the house, then on to the heat pump and everything else, each band as wide as its flow

Power or energy flowing between named sources and loads, each band as wide as its flow: solar and the grid into the house, the house into the heat pump, the car and everything else. Each entity is one flow, from one node to another; the nodes are just names you give them.

Good for

Where power or energy goes right now: a home's sources and loads, a battery charging from solar, water from the mains to each tap.

Example

type: custom:chartdeck-card
style: sankey
title: Power flow
entities:
  - entity: sensor.solar_power
    from: Solar
    to: House
  - entity: sensor.grid_import_power
    from: Grid
    to: House
  - entity: sensor.heat_pump_power
    from: House
    to: Heat pump
  - entity: sensor.other_power
    from: House
    to: Other

To use this style, set style: sankey (or pick Sankey (flow) under Parts of a total in the editor's Style section). Each entity's Flows from and Flows to are in its own options; the chart option is in the editor's Chart section.

How it is laid out

  • It draws the current values, so it moves as the power does. No history is loaded.
  • Columns come from the flows: a node nothing flows into starts on the left, and each node sits one column after the furthest node that feeds it. A node that only receives stays in the column after its source, rather than being pushed to the far right.
  • Node heights share one scale, set by the fullest column, and each column is centred. Bands leave and arrive in the order of the nodes at their other ends, so they cross as little as they can.
  • Labels go outside the outer columns (at most 30 % of the width each, longer names cut short) and above middle nodes, moved apart where small nodes sit close together. Each node shows its total.
  • Nothing flowing counts as nothing: an unavailable, negative or non-number reading is a flow of 0. A node keeps its column while its flows are at 0, but isn't drawn; when nothing at all flows, the card says "Nothing is flowing right now."

Options

link_color: auto       # auto (default), source or target
entities:
  - entity: sensor.solar_power
    from: Solar        # the node this flow leaves
    to: House          # the node it arrives at
    color: amber       # this flow's colour, and its node's
  • Nodes take the series colours in order of first appearance.
  • link_color: auto colours a band by where it comes from, or by where it goes when it leaves a middle node ("House → Heat pump" takes the heat pump's colour). source and target always colour by one end.
  • A flow's own color paints its band and the node it is coloured by (the first such flow wins for a node).
  • Flows need both a from and a different to. Entities without both are left out; with none at all the card says "Give each entity a "Flows from" and a "Flows to" in its options."
  • Flows can't go round in a loop (A → B → A): the card refuses the config with a message naming the loop.

Hovering or touching a band highlights it and shows "Solar → House" with its value. Tapping a band runs that entity's tap action (more-info by default).

In the editor: Colour flows by in the Chart section. Each entity has Flows from, Flows to and Flow colour.

Energy dashboard (v2.2.0+)

A Sankey of today's energy from the Energy dashboard: grid import and solar flow into Home, and Home flows on to grid export, battery in, a kettle and untracked use

type: custom:chartdeck-card
style: sankey
title: Energy today
source: energy
period:
  calendar: day

source: energy builds the flows from Home Assistant's Energy dashboard, with no entities to list. Each flow is its total over the card's period, read from long-term statistics.

  • The flows: grid import, solar and battery out flow into Home; Home flows on to grid export, battery in and each individual device set up in the Energy dashboard. What comes in and isn't accounted for by those becomes a grey Untracked use flow (or Used at home when no devices are drawn), with no tap action.
  • energy_flows picks which to draw, from grid_import, grid_export, solar, battery_out, battery_in and devices (all of them by default). Gas and water don't run through the house's electricity, so a Sankey refuses them.
  • period is any span the line chart takes: the last 24 hours, today, this week, yesterday with offset: 1. There are no previous and next buttons, and the chart doesn't name the span, so the title should. With no period set the editor fills in today.
  • Any entities you list are drawn after the energy flows, totalled over the same period.
  • When nothing flowed in the period the card says "Nothing flowed in this period."

In the editor: Readings from (Current values or Energy dashboard) at the top of the Chart section; Energy dashboard shows the period fields and Energy flows. See source: energy.

Layout: one chart for the whole card. Every shared option is described on the Options page.

Previous: Climate · Next: Wind rose · All styles

Clone this wiki locally