Home Assistant energy dashboard cards you can put on any dashboard
Home Assistant's Energy dashboard is excellent, but it is its own page. You can also put the same information on your normal dashboards, next to your lights and weather, using the built-in energy cards. Here is how, and how to add live power gauges next to them.
Disclosure: Written by the maker of this site. The YAML below parses as valid YAML and uses only built-in Home Assistant cards and options from the official documentation. This exact example has not been run on every Home Assistant version or setup.
Set up the Energy dashboard first
The energy cards read from the configuration you create under Settings, Dashboards, Energy (or Settings, Energy in older versions). Add your grid consumption sensor, optional return-to-grid sensor, and solar production if you have it. These must be sensors with a total energy state class, measured in kWh. If a card says there is no data, this setup step is the usual cause. Statistics are calculated hourly, so a brand new setup can take a while to show anything.
The built-in energy cards
energy-date-selection: the date picker that every other energy card on the same view follows. Put it at the top.energy-usage-graph: a bar graph of consumption over the selected period.energy-distribution: the animated flow diagram between grid, solar and home. Itslink_dashboardoption adds a link to the full Energy page.energy-sources-table: a table of each source and its cost or total.
These are built into Home Assistant, so there is nothing to install. Their options are small. Most of the work is in the Energy configuration, not in the card YAML.
Add live power gauges
The energy cards show totals over time. For what is happening right now, a gauge is better: how many watts is the house drawing, and how much is the solar array producing. The built-in gauge card draws a colored dial. Its min and max set the scale, and severity sets where the color changes. For power draw we make the dial green at normal use and red near the top of the scale.
The YAML
Complete example. Paste it into the raw configuration editor of a dashboard, then replace the placeholder entity ids with yours.
title: Energy
views:
- title: Energy
path: energy-view
icon: mdi:lightning-bolt
type: sections
max_columns: 2
sections:
- type: grid
cards:
- type: heading
heading: History
- type: energy-date-selection
- type: energy-distribution
link_dashboard: true
- type: energy-usage-graph
- type: grid
cards:
- type: heading
heading: Right now
- type: grid
columns: 2
square: false
cards:
- type: gauge
entity: sensor.power_now
name: Power now (W)
min: 0
max: 6000
severity:
green: 0
yellow: 1500
red: 3500
- type: gauge
entity: sensor.solar_power
name: Solar (W)
min: 0
max: 8000
severity:
green: 0
yellow: 2000
red: 8000
- type: entities
title: Totals
entities:
- sensor.power_now
- sensor.solar_power
- sensor.energy_today
- type: energy-sources-table
Reading it
The first section is the history: date selection, the distribution diagram, and the usage graph. The second is the now: two gauges, one for power and one for solar, and an entities card for the exact numbers. Replace the sensor ids with your own power sensor in watts, solar sensor in watts, and daily energy sensor. If you have no solar, delete that gauge and the solar entity row.
Choose max values just above the highest number you realistically see. If your main breaker is 100 amps at 240 volts, the physical ceiling is much higher than your real peak, and a gauge scaled to the ceiling will sit near zero all day. Look at a week of history and set the maximum to roughly your busiest day.
Limits and honesty
The cards in this example follow the Home Assistant documentation, but we have not run this exact view on every installation, and energy cards need your Energy configuration to show anything. If a card is blank, check the Energy page itself first.
Quick answers
Why is my energy graph empty?
Usually because the Energy configuration is incomplete or the sensors have not yet produced hourly statistics. Open the main Energy page and see whether it has data first.
Can I show cost as well as kWh?
The Energy configuration lets you set a price per kWh or a price entity, and the sources table can then show costs. Set that on the Energy configuration page, not in the card YAML.
What if I have no solar?
Remove the solar gauge and the solar entity row. The distribution card simply shows grid and home when there is no solar source configured.