Automations
Continue with your first automation.
Home Assistant’s Energy Dashboard brings consumption and production together over time. A polished dashboard is only useful when its sensors measure the right thing. Begin with one verified grid meter; add solar, battery, gas, water, appliances, EV charging and prices only after the baseline agrees.
| Quantity | Typical unit | Meaning |
|---|---|---|
| Power | W or kW | Rate of consumption or production right now |
| Energy | Wh or kWh | Accumulated quantity over time |
| Price | currency/kWh | Price per unit of energy |
| Cost | currency | Energy multiplied by the relevant price/tariff |
A 2,000 W sensor is an instant reading. A 12,345 kWh sensor is normally a
running total. Energy Dashboard expects energy sensors with correct units,
device_class and state_class so Home Assistant can create long-term
statistics.
Do not use a power sensor directly as energy. If a source provides compatible instantaneous power only, Home Assistant’s Integral/Riemann sum integration can derive energy over time. Validate method, time unit and sign against official documentation; integrating noisy or missing samples can create drift.
Before adding a sensor, inspect Developer tools → States and Settings → Devices & services → Statistics:
device_class is power, energy, gas or water as appropriate;state_class matches a measurement or accumulating total;unknown or unavailable states;Home Assistant can repair some statistics metadata, but understand the warning before changing units or sums.
Find a cumulative import sensor
Select the meter representing energy purchased from the grid. Do not use the sum of smart plugs as a substitute for the main meter.
Check units and statistics
Compare its change over an hour or day with the physical meter. Confirm a restart does not reset it unexpectedly.
Add it to Energy configuration
Open Settings → Dashboards → Energy and choose grid consumption.
Wait for statistics
Energy data is not always immediate. Wait for the next statistics period and inspect the graph.
Validate for at least one day
Compare dashboard daily consumption with an independent meter source.
If you have separate export, add it as grid return. A negative net sensor is not always a safe replacement for separate import and export totals; follow the integration’s documented semantics.
Add the inverter’s cumulative production energy. Determine whether it represents
the whole array, one inverter, one phase or one string. Give multiple sources
clear names such as East roof and West roof.
Avoid duplicate counting:
A battery normally needs separate energy sensors for:
State of charge in percent is useful operationally but does not replace charge and discharge energy. Check sign and direction: some inverters report discharge as negative power while the dashboard expects separate positive totals.
Gas and water are optional layers. Use cumulative volume in a supported unit and the correct device class. A pulse meter must retain its total through reboot and must not count one pulse twice.
Validate:
Individual devices explain where energy went. Add an energy sensor from a smart plug or submeter, not only its current watt reading.
For an EV, use a dedicated charger or submeter energy total. Name it so it is not confused with vehicle battery percentage. When charging already passes through the main meter, it is a sub-consumer and must not be added to grid import.
Energy Dashboard can use a fixed price, price entity or cost data supplied by an integration. Regional price integrations are optional and vary with country, market, currency, network operator and contract.
Choose a local integration that documents:
Do not label spot price as total cost when delivery and taxes are absent. The main workflow requires no national provider or tariff model.
Home Assistant supports multiple grid, solar, battery, water and gas sources. Name them by function and location:
Grid import – houseGrid export – houseSolar production – garageWater – gardenEV charger – carportHome Assistant 2026.6 improved naming for multi-source dashboards. Good names make cards, graphs and statistics warnings easier to understand.
Use a repeatable control:
Small differences can come from rounding and update intervals. Large or growing differences point to units, sign, source choice or duplicate counting.
After validation, data can drive actions such as:
Use thresholds, minimum duration, hysteresis and an unavailable fallback. One
bad price or sensor sample must not start expensive or harmful equipment.
Energy Dashboard runs in Home Assistant, but a source can be cloud-backed. A meter, inverter or vehicle integration may send consumption to its vendor. Review integration IoT class and privacy terms. Prefer stable supported local APIs where available, but never describe cloud data as local.
Check unit, device class, state class and long-term statistics. Read the exact statistics issue rather than changing metadata randomly to make it appear.
Check whether the same energy appears as two grid sources or whether both a total and its components were added. Individual devices are breakdowns, not extra grid import.
Determine whether the sign means export/discharge or a sensor error. The Energy Dashboard is easiest to reason about with documented separate directions.
Inspect integration, network and recorder/statistics health. Do not fill missing samples with zero automatically: zero means measured no use, not missing data.
Use a sensor and state class that supports documented resets, or a Utility Meter that preserves the period total correctly. Check long-term statistics before editing historical data.
Compare currency, unit, timezone, tax, delivery charges, fees and export price. Dashboard and bill may use different settlement periods.
Automations
Continue with your first automation.
Troubleshooting