Home Assistant's Energy dashboard turns meter readings, solar production and individual devices into one view of what you import, export, produce and store. You can start with a single grid sensor and add solar, battery, gas, water and per-device tracking later. This guide focuses on getting entities into the right shape, wiring them into Settings > Dashboards > Energy, and fixing the usual reasons a sensor never appears in the dropdown.

It is about the dashboard and statistics, not about building a pulse reader or a CT clamp. If you still need hardware that exposes kWh to Home Assistant, use a meter integration first, then come back here.

Energy is not power

Power (W or kW) is how fast energy is moving. Energy (usually kWh) is how much has moved. The dashboard is built around cumulative energy entities. Instantaneous power is useful for live "now" cards and as an optional companion on a grid connection, but a watt sensor alone will not fill the daily graphs.

If a device only reports watts, create an energy sensor with the Integral helper (Riemann sum) before you add it to the dashboard. In the UI: Settings > Devices & services > Helpers > Create helper > Integral. Or in YAML:

sensor:
  - platform: integration
    source: sensor.desk_power
    name: Desk energy
    unit_prefix: k
    round: 2
    max_sub_interval:
      minutes: 5

With a source in W, unit_prefix: k and time in hours, the result is kWh with device_class: energy. Sampling every few seconds keeps the estimate honest; sparse updates understate or overstate usage depending on the method.

What the dashboard expects from a sensor

Entities that refuse to show up in the Energy UI almost always fail one of these checks. Inspect them under Settings > Tools > States:

Use device_class state_class
Energy (grid, solar, device kWh) energy total or total_increasing
Power (optional live reading) power measurement
Battery state of charge battery measurement (unit %)
Gas gas total or total_increasing
Water water total or total_increasing

The entity must be a sensor, use a unit the Energy UI accepts (help text on each field lists them), and have clean statistics under Settings > Tools > Statistics. Template or MQTT sensors you write yourself need those attributes set explicitly. If an integration ships the wrong classes, fix it upstream or wrap the value in a template sensor with the correct ones.

Long-term statistics also need the Recorder to keep the entity. If you excluded it from recording, it will not appear in the dropdown even when the attributes look right.

Get a grid reading into Home Assistant

Home Assistant's electricity-grid docs prefer reading the utility meter itself when you can:

  • P1 port (common in the Netherlands, Belgium and Luxembourg), for example with an ESPHome-based P1 reader such as SlimmeLezer+.
  • Pulse LED on many meters (each flash is a fixed fraction of a kWh). Home Assistant Glow is the project they point at for that path.
  • IEC 62056-21, SML (common in Germany), AMR/ERT over RTL-SDR in parts of North America, or an ESP32-CAM based digitizer such as AI-on-the-edge-device.
  • CT clamps (for example Shelly EM, or a DIY ESPHome CT clamp) when you cannot talk to the meter. Opening a panel is electrical work; use someone qualified where the rules require it.
  • Utility or inverter cloud/local APIs when your supplier already publishes usage into Home Assistant.

Manual MQTT or template sensors are fine if device_class, state_class and unit_of_measurement are set. Prefer a lifetime or continuously increasing kWh counter over a sensor that resets every day unless you understand how total_increasing treats resets.

Add the grid connection

  1. Go to Settings > Dashboards > Energy.
  2. Under Electricity grid, choose Add grid connection.
  3. Pick the statistic for energy imported from the grid.
  4. If you export (solar or battery), also pick the returned-to-grid statistic.
  5. Save.

Only compatible statistics appear in the lists. You can attach a power sensor on the same connection when you have one with device_class: power and state_class: measurement.

Peak/off-peak tariffs are handled with the utility_meter integration when your hardware does not already split registers. Configure as many tariffs as the contract needs, then point the dashboard at those sensors.

Solar, battery, gas, water and devices

Each category has its own section on the same Energy settings page:

  • Solar panels - cumulative PV production energy (and optional production power). Inverter integrations or a CT on the PV feed both work. Pair with the Solar Forecast integration if you want expected production in automations.
  • Home batteries - energy in and out of the battery, plus state of charge when available.
  • Gas and water - same pattern as electricity: cumulative sensors with the right device_class.
  • Individual devices - smart plugs, smart relays or appliance energy sensors so you can see which loads matter. Devices that only expose watts need an Integral helper first.

When a breaker and the plugs on that circuit are both tracked, set an upstream device so Home Assistant does not count the same kWh twice. Add every related entity as an individual device first; only then can you pick one as the upstream of another. The same hierarchy works for water meters.

Avoid inflated totals

Do not sum several resetting counters into one template or group sensor and feed that sum into the dashboard. If the children reset a few seconds apart, the combined entity spikes, and that spike is written into long-term statistics. Add each cumulative sensor as its own source instead. Wrong history can be edited under Settings > Tools > Statistics.

Customize the cards

After at least one source exists, open Settings > Dashboards > Energy > Edit dashboard, choose Customize cards, and toggle cards under Overview, Electricity, Gas, Water or Now. The selection is system-wide. Cards stay unavailable until their matching source is configured; hiding every card in a tab hides that tab, but Home Assistant keeps at least one tab visible.

If the Energy item is missing from the sidebar entirely, check that you did not remove default_config: from configuration.yaml. That line loads the pieces the dashboard needs.

A sensible first setup

  1. One grid import (and export if you have it) entity with correct classes.
  2. Add it under Electricity grid.
  3. Wait until statistics populate, then confirm today's usage matches the meter roughly.
  4. Add solar or a few individual plugs only after the grid line looks sane.
  5. Use Integral helpers for watt-only devices; use upstream device links where circuits nest.

You do not need every category on day one. A single honest grid sensor already makes the daily and monthly views useful.