Chapter 17

Energy dashboard and ESG practices

Which uses the most energy: the air conditioner, dehumidifier, or hot-water dispenser? This chapter turns household or office electricity use into clear charts. You will choose suitable sensors, configure the Energy Dashboard, integrate watts into kilowatt-hours, track costs in your local currency, and produce a credible energy-saving report. By the end, you will know where each kilowatt-hour goes and be able to demonstrate savings with data.

Why learn this: replace “it feels expensive” with evidence

When a utility bill arrives, the usual reaction is “Why is it so high again?”—and the discussion ends there. The bill provides a total, but it does not tell you which appliance contributed to it.

The Energy Dashboard addresses that problem. This built-in Home Assistant dashboard charts how many kilowatt-hours you used today, daily consumption across the month, and which devices used the most energy. It can also apply a tariff to estimate cost.

Here are some practical examples:

  • At home: You suspect an old refrigerator uses too much energy but have no evidence. Monitor it with a suitable smart plug; after two weeks, its steady daily consumption will show whether replacement may be worthwhile.
  • In a room: A dehumidifier is left on all day. Its daily energy chart immediately reveals an unusual increase of perhaps 3 kWh.
  • In an office pantry: A hot-water dispenser keeps water warm 24 hours a day. It may draw only a few hundred watts, yet consume more over a month than a copier. Only cumulative data exposes this kind of continuous, moderate load.
  • In an ESG report: A small office can write, “We installed energy-monitoring plugs and limited pantry water heating to business hours, reducing monthly consumption by X kWh.” That carries far more weight than “We reminded staff to switch off the lights.”
Concept: You do not need programming skills for this chapter, but you do need patience. An automation responds immediately; energy data takes time. Allow at least several days to see a trend, and a complete cycle—such as a month—before making meaningful comparisons.

This chapter makes extensive use of the helpers introduced in Appendix B and the entity IDs and naming practices covered in Chapter 4. For adding devices to Home Assistant, see Chapter 11. If you are not yet sure what a sensor is, first review Chapter 12, specifically the sensor section.

First distinguish power (W) from energy (kWh)

This is the chapter’s most important—and most commonly confused—concept. Remember it this way: power is like speed; energy is like distance.

QuantityUnitWhat it answersAnalogy
PowerW, kWHow quickly is energy being used right now?60 kilometres per hour
EnergyWh, kWhHow much energy was used over a period?Driving 120 kilometres today

Your electricity provider bills for kilowatt-hours (1 kWh), not watts. For example:

  • A 1000 W electric heater running for 1 hour uses 1 kWh.
  • A 100 W hot-water dispenser running for 24 hours uses 2.4 kWh—more than the heater in the example above.

Many inexpensive smart plugs report only current power in watts, not cumulative energy in kilowatt-hours. The Energy Dashboard primarily needs energy data: its daily consumption, monthly cost, and similar charts all derive from kWh totals. This is why a plug can provide power monitoring but still be absent from the dashboard’s selectors.

Concept: A power sensor is still useful. With the correct attributes, it can feed the Now view so you can see current demand. Daily and monthly statistics and costs, however, require energy data. Home Assistant therefore recommends using a Riemann sum integral to convert watts into kilowatt-hours for individual devices. See Convert W to kWh later in this chapter.
Tip: Before buying a smart plug, check its specifications and reviews for “energy,” “kWh,” or “cumulative energy.” A model that reports energy directly can save considerable setup work.

What makes a sensor eligible for the Energy Dashboard?

The Energy Dashboard does not accept every sensor. It filters the list and shows only entities with compatible attributes. Check all three of the following:

AttributeRequired valuePlain-language meaning
device_classenergy / power / gas / water / monetaryTells Home Assistant what the number represents
state_classtotal_increasing or total for cumulative values; measurement for instantaneous powerTells Home Assistant how to calculate statistics for the value
unit_of_measurementA supported unit such as kWh, Wh, W, or kWSpelling and capitalisation must be exact

How the three state classes differ

state_classMeaningTypical example
measurementA current measurement, not a cumulative totalCurrent power of 850 W or a room temperature of 26°C
totalA cumulative value that can increase or decreaseNet consumption from a bidirectional meter, which decreases when power is exported
total_increasingA cumulative value that only increases, apart from occasional resetsA smart plug’s cumulative energy total, which restarts at 0 after losing power
Concept: For total_increasing, Home Assistant interprets a decrease as the start of a new metering cycle or replacement of the meter. A plug resetting to zero after losing power should therefore not corrupt the chart. A built-in tolerance also prevents a decrease of less than 10% between readings from being mistaken for a reset, reducing false detections caused by rounding noise.
Warning: Never combine device_class: power (watts) with state_class: total_increasing. Power is instantaneous, not cumulative, so it must use measurement. Home Assistant will report this invalid combination under Repairs.

How to inspect a sensor’s attributes

Open Settings → Tools → States, search for your sensor, and inspect the attributes shown alongside it. The same area includes a Statistics tab listing entities with long-term statistics. If an entity’s statistics are invalid, a “Fix issue” link appears there.

Warning: This area has recently changed its name and location twice. It was formerly called Developer tools and appeared near the bottom of the sidebar. It later moved under Settings, and Home Assistant 2026.8 shortened its name to Tools so that non-developers would feel comfortable using it. Older tutorials referring to Developer tools mean the same area. Its seven tabs are YAML, States, Actions, Templates, Events, Statistics, and Assist.

Where energy data comes from: five sources

Without hardware, there is no measurement. The following options progress from simple to more involved.

SourceWhat it measuresDifficultyBest suited to
Smart plug / smart switchPower for one appliance; some models also report cumulative energyLowFirst-time users investigating a single large load
Clamp-on CT sensorPower for a circuit or the whole propertyMediumWhole-property monitoring
Solar inverterEnergy generated and exportedMediumProperties with solar panels
Battery storage systemEnergy charged and dischargedMediumProperties with battery storage
Gas / water meterConsumption (m³, L)HighComprehensive ESG inventories

Smart plugs

EcosystemHome Assistant integrationImportant considerations
ShellyOfficial Shelly integration; local push; top-tier Platinum quality ratingAll four device generations are supported, but minimum firmware requirements apply: generation 1 requires 1.9 or later (1.11 or later for a few models), generation 2 requires 1.0 or later, and generation 3 requires 1.2.0 or later. Update the firmware first if you buy old stock. The first-generation Shelly 4Pro and Shelly Sense are not supported.
Tasmota (devices with replacement firmware)Official Tasmota integrationRequires an MQTT broker and the MQTT integration. Device firmware must be 9.2 or later, with native discovery enabled. tasmota-lite.bin is not supported.
Custom ESPHome deviceOfficial ESPHome integrationOffers the most flexibility and can connect directly to CT clamps. It requires firmware installation and is best suited to patient, technically confident users.
Xiaomi / AqaraXiaomi Home (xiaomi_miio) or Zigbee through ZHA or Zigbee2MQTTNot every plug provides power monitoring, and different versions of the same model may vary considerably. Check the exact model before buying.
Warning: Cloud-dependent plugs cannot report readings when the internet connection or vendor service is unavailable, leaving gaps in charts. For ESG inventories and other auditable reporting, prefer local push or local polling where available.

Whole-property metering

To measure the whole property rather than one appliance, you need monitoring at the distribution board. A clamp-on CT sensor fits around a main conductor and connects to a module that reports to Home Assistant, such as a compatible Shelly device or a custom ESPHome system.

Danger: Work inside an electrical panel presents risks of electric shock and fire. Although a CT clamp is non-invasive—it fits around a conductor without disconnecting it—a qualified electrician must open the panel and route or secure any wiring in accordance with local regulations. Renters must also obtain the property owner’s permission before touching the main supply. This is not a suitable do-it-yourself experiment.

Solar generation and battery storage

Most solar inverter brands provide an API or local interface, and Home Assistant has integrations that can read current generation power and cumulative energy generated. Battery systems generally provide separate cumulative figures for charging and discharging. In the Energy Dashboard settings, solar and batteries are separate sections that require different sensors.

Tip: Recent Energy Dashboard settings accept more sensor arrangements. A single signed sensor can represent bidirectional grid or battery flow, while two sensors that remain positive can separately represent import/export or charge/discharge. You no longer need a Template sensor solely to invert a sign. You can also give each source a custom name, such as “Main meter” or “Rooftop solar,” which makes multiple sources much easier to identify.
Tip: If you have two or more home batteries, recent versions let you enter each battery’s capacity. The combined state of charge is then weighted by capacity. Without weighting, a full small battery and an empty large battery could produce a misleading average of 50%.

Hands on: enable the Energy Dashboard

Assume that you already have a plug reporting cumulative energy—for example, the plug monitoring a living-room air conditioner. Follow these steps to turn its readings into charts.

  1. Confirm that the sensor is eligible

    Open Settings → Tools → States and search for the plug’s sensors. Select the one measured in kWh whose value only increases, not the one measured in W. Confirm that it has device_class: energy, state_class: total_increasing, and unit_of_measurement: kWh. If all three are correct, continue.

  2. Open the Energy settings

    Go to Settings → Dashboards → Energy → Edit dashboard. You can configure six source types: Electricity grid, Solar, Battery storage, Gas, Water, and Individual devices.

    Version note: Beginning in March 2026, this settings page is divided into Electricity, Gas, and Water tabs, with the six source types distributed among them instead of appearing on one long page. Older versions show everything together. Do not worry if your layout differs; the settings themselves are unchanged.

  3. Add grid consumption first

    Under Electricity grid, select “Add consumption,” then choose your sensor from the drop-down list. If your sensor does not appear, an incorrect attribute is the cause about 80% of the time. Review the three fields under Eligible sensors.

  4. Configure the tariff, or skip it for now

    After you add a sensor, the same dialog asks how to calculate cost. If you initially want only kWh totals, select no cost tracking; you can return and configure it at any time. See Tariffs and costs for the full procedure.

  5. Add an appliance under Individual devices

    To see what proportion of total use comes from an air conditioner, retain the whole-property meter under Electricity grid and add the air conditioner’s energy sensor under Individual devices. The dashboard will then compare consumption across devices.

  6. Save, then let statistics accumulate

    After setup, an Energy item appears in the sidebar. An empty dashboard immediately after setup is normal. Statistics accumulate hourly, so wait at least one or two hours for the first bar and a full day for a useful daily chart.

  7. Return the next day to adjust the layout

    Once data is available, select “Customize cards” from the Energy Dashboard toolbar. Expand the Overview, Electricity, Gas, Water, and Now sections, then use the switches to control which cards appear. Disable sections you do not use to keep the display clear.

    The Energy Dashboard’s second tab was also renamed from “Energy” to “Electricity” in March 2026. Because the dashboard covers electricity, gas, and water, the previous label was easy to misinterpret.

Warning: If Energy is completely absent from the sidebar, confirm that configuration.yaml still contains default_config:. Some older tutorials tell users to remove it, which disables many built-in features.

Only have watts? Use a Riemann sum to calculate kWh

This is a common situation: a plug provides only sensor.xxx_power, measured in W, and no cumulative kWh sensor. The Energy Dashboard cannot use that sensor as cumulative energy.

The solution is Home Assistant’s built-in Integral (Riemann sum integral) helper. It repeatedly reads the power sensor and adds “watts × elapsed time” for each interval, producing a new cumulative energy sensor.

Concept: Why is it called a Riemann sum? Home Assistant receives discrete samples rather than a continuous curve. It approximates the true integral by dividing the curve into small sections, calculating each section’s area, and adding the results. More frequent sampling generally improves the estimate.

Create it in the interface (recommended)

  1. Open the Helpers page

    Go to Settings → Devices & services → Helpers tab → Create helper.

  2. Select Integral

    The list is long, so typing integ in the search box is quickest. A localised interface may use a translated label such as “Integral sensor.”

  3. Select the input sensor

    For Input sensor, select the power sensor measured in W. Give the helper a clear name, such as “Living-room AC energy.”

  4. Set the metric prefix and integration time

    These two settings are critical. Set Metric prefix to k and Integration time to h (hours). W × h ÷ 1000 = kWh, so these settings produce kWh. If the prefix is none, the result is Wh and its numeric value is 1000 times the kWh value.

  5. Keep the default integration method

    Method offers Trapezoidal, Left, and Right. Trapezoidal is the default and, according to the official guidance, currently gives the best result when the source updates frequently. Do not change it unless you understand how the source reports its values.

  6. Set Max sub-interval

    Max sub-interval is intended for devices that do not report again when their value remains unchanged. If you set a value such as 60 seconds, integration continues as time passes even without a new source update. A value of 0 disables this behaviour. Consider setting an interval for loads such as air conditioners and dehumidifiers that may hold a steady power level for long periods.

Create it in YAML

If you prefer configuration files, the equivalent YAML is:

sensor:
  - platform: integration
    source: sensor.living_room_ac_power
    name: Living-room AC energy
    unit_prefix: k
    unit_time: h
    method: trapezoidal
    max_sub_interval: "00:01:00"
    round: 3

source is the required source entity; unit_prefix is the metric prefix; unit_time is the time unit; method selects the integration method; round sets the number of decimal places; and max_sub_interval is the forced update interval described above.

Warning: An Integral sensor begins at 0 and does not know how much energy you used before it was created. It can show trends and comparisons from that point onwards, but it cannot match a bill for an earlier period. For bill reconciliation, use hardware with an authoritative cumulative reading.
Tip: An Integral sensor’s state_class is always total, not total_increasing. Both total and total_increasing are valid in the Energy Dashboard, as the official FAQ confirms, so do not be concerned when it is not total_increasing. The helper also converts the source’s device_class from power to energy automatically; you do not need to set it yourself.

Utility Meter: divide cumulative totals into daily, monthly, or quarterly cycles

After integration, you have a total that continually increases from the installation date. What you usually want to know, however, is how many kilowatt-hours you used today or whether this month is higher or lower than last month. The Utility Meter helper solves this problem by acting like a counter that resets automatically.

Create it in the interface

  1. Open the Helpers page again

    Go to Settings → Devices & services → Helpers tab → Create helper → Utility Meter.

  2. Select the input sensor

    Select the kWh sensor created by the Integral helper, or a cumulative energy sensor provided directly by your hardware.

  3. Select a reset cycle

    Meter reset cycle can be every 15 minutes, hourly, daily, weekly, monthly, bimonthly, quarterly, or yearly. Consider creating three separate meters—daily, monthly, and yearly—and name each one clearly.

  4. Enable Periodically resetting when appropriate

    If the source sensor can reset—for example, when a smart plug loses power—ensure that Periodically resetting is enabled so Utility Meter handles the decrease correctly. This option is enabled by default.

  5. Set an offset if needed

    Meter reset offset moves the beginning of the cycle later. For example, if your electricity bill closes on the 5th of each month, set the monthly cycle’s offset to 4 days so the Home Assistant period aligns with the bill.

YAML configuration

utility_meter:
  ac_daily:
    source: sensor.living_room_ac_energy
    name: Living-room AC energy today
    cycle: daily
  ac_monthly:
    source: sensor.living_room_ac_energy
    name: Living-room AC energy this month
    cycle: monthly
  ac_yearly:
    source: sensor.living_room_ac_energy
    name: Living-room AC energy this year
    cycle: yearly

Available configuration keys include source, name, unique_id, cycle, offset, cron, delta_values, net_consumption, tariffs, periodically_resetting, and always_available. delta_values defaults to false, meaning the source reports an absolute reading rather than increments. net_consumption defaults to false, meaning only forward consumption is counted. periodically_resetting defaults to true.

Warning: The official documentation states that every sensor’s first cycle is incomplete. If you create a weekly meter at noon on Wednesday, that week’s figure is not meaningful. Begin with the next complete week, and exclude the first partial cycle from reports.

Utility Meter also provides actions

It provides two actions (formerly called services):

ActionPurpose
utility_meter.calibrateCalibrate the meter to a specified value
utility_meter.resetReset the meter to zero

These sensors are restored across restarts. Restarting Home Assistant will not erase a monthly total.

Tariffs and cost tracking

Once you have kWh totals, applying a tariff turns them into money. Cost can be more persuasive than energy alone: telling a manager that standby loads incur an annual cost of approximately 8000 in your local currency may be more effective than saying they use 200 kWh, provided you document the tariff and calculation period.

Three ways to calculate cost

After you add a consumption source in the Energy settings, Home Assistant asks how you want to track cost. The options broadly fall into three categories:

MethodHow it worksBest suited to
Fixed unit priceEnter one local-currency amount per kWh; Home Assistant applies it throughoutMost users who need a quick estimate
Entity with current priceSelect a sensor whose value is the current local-currency amount per kWh; costs follow price changesTime-of-use and other variable tariffs
Entity with total costCalculate cumulative cost yourself and let Home Assistant use that total directlyAdvanced users who already have a cost sensor
Concept: Once cost tracking is enabled, Home Assistant automatically creates a corresponding cost statistic for that energy source. You do not need to create one yourself. The dashboard can then show both energy and monetary values.

How local tariffs affect cost tracking

Two common features of residential tariffs can make a single fixed price imprecise:

  • Tiered rates: The unit price may rise above specified consumption thresholds, so your average rate increases as usage grows.
  • Seasonal rates: Some utilities charge different rates during defined seasons.
Warning: Tariff tiers, seasonal definitions, taxes, and unit prices can change. This chapter deliberately provides no tariff amounts because published figures will become outdated. Consult your electricity provider’s current tariff or your latest bill, and enter values in the Home Assistant currency configured for your location.
Tip: A practical estimate is to divide the total charge on a recent bill by its billed kWh and enter the result as an average local-currency price per kWh. This is not exact—fixed charges and taxes may be included—but it reflects your actual billing structure and is adequate for comparing approximate cost from one period to another. Update it whenever rates or usage patterns change.

Configure a time-of-use tariff

If your plan charges different peak and off-peak prices, use Utility Meter’s Tariffs feature:

utility_meter:
  home_daily:
    source: sensor.home_energy
    name: Household energy today
    cycle: daily
    tariffs:
      - peak
      - offpeak
  home_monthly:
    source: sensor.home_energy
    name: Household energy this month
    cycle: monthly
    tariffs:
      - peak
      - offpeak

This creates four sensors—sensor.home_daily_peak, sensor.home_daily_offpeak, sensor.home_monthly_peak, and sensor.home_monthly_offpeak—plus two Select entities, select.home_daily and select.home_monthly, for choosing the active tariff period.

Warning: The home_daily top-level key determines the entity ID; name affects only the displayed name. Use ASCII letters, digits, and underscores for keys, such as home_daily, so their entity IDs remain easy to type in automations. This follows the principle from Chapter 4: display names can be localised, but entity IDs should use ASCII.

Next, create an automation that changes the Select entity at the tariff transition:

alias: Switch to the peak tariff
triggers:
  - trigger: time
    at: "16:00:00"
conditions:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
actions:
  - action: select.select_option
    target:
      entity_id: select.home_daily
    data:
      option: peak
mode: single

Create a corresponding automation to switch back to off-peak. Use the exact transition times, weekday and holiday rules, and seasonal conditions specified by your tariff.

Warning: If several Utility Meters use tariffs, remember to switch every Select entity. Missing one will make that meter’s tariff totals incorrect. You can list several entities under entity_id in the same automation.

Gas and water: the other parts of an ESG inventory

If your only aim is to reduce the electricity bill, you may already have enough. A comprehensive ESG or sustainability inventory, however, should also account for gas and water.

The Energy Dashboard has separate Gas and Water sections. Their setup follows the same principle as electricity: provide a cumulative sensor with device_class set to gas or water, state_class set to total_increasing or total, and a supported volume unit. You can also apply a local-currency unit price after adding it.

The difficult part is hardware. Many residential gas and water meters do not provide a ready-made smart interface. The official documentation describes several common approaches:

MethodPrincipleDifficulty
Image-recognition moduleA small camera photographs the meter face, and on-device recognition reads the digitsMedium; the camera and light source must be secured
Magnetic sensorA magnetometer detects rotations of the internal magnet in a diaphragm gas meterMedium to high; the correct position must be found
Reed switchThe switch detects the meter magnet once per rotation, which is converted into consumptionMedium; not every meter provides a detectable magnetic point
Radio reception (RTL-SDR)Some electricity, gas, and water meters periodically broadcast readings over radio protocols that an inexpensive USB receiver can captureHigh; it depends on whether local meters broadcast a compatible signal
Smart-meter communications port (P1)Some countries use a standardised meter data port that can provide electricity readings and sometimes associated gas consumptionLow, but P1 is primarily used in the Netherlands, Belgium, and Luxembourg; availability elsewhere depends on local meter standards
Danger: Never open or dismantle a gas meter, touch its internal components, or create sparks nearby. All viable methods observe the meter externally without touching the pipework. Follow your utility’s rules and local regulations. If in doubt, do not proceed; record the reading manually each month instead.
Tip: If automatic meter reading is impractical, create a Number helper and enter the bill or meter reading yourself each month. Twelve readings over a year are enough to show a trend and support a basic report. Manual data is valid when dates, units, and methods are consistent; having no data is the greater limitation.

ESG reporting: turn data into a defensible account

Data alone does not persuade people; comparison does. This section explains how to turn dashboard charts into a coherent report with a beginning, an intervention, and a result.

Step 1: Establish a baseline

Change nothing at first. Let the system collect a complete period—at least two weeks, and preferably one month. These figures form your baseline for every later comparison.

Warning: Do not introduce energy-saving measures during the baseline period. Many people begin switching things off as soon as monitoring starts, leaving no clean comparison and no reliable way to quantify the saving. Wait.

Step 2: Identify the largest loads

You do not need advanced analysis. Start with three views:

Where to lookWhat to identifyCommon causes
Individual-device rankingWhich device has the highest total kWh?Air conditioners, dehumidifiers, electric water heaters
Overnight demandWhat is still running while everyone sleeps?Water heating, set-top boxes, NAS devices, old refrigerators
Shape of the daily curveIs there a plateau that should have fallen?A dehumidifier left on or equipment with high standby demand
Concept: Overnight demand is especially useful. Consumption at 3:00 a.m. is often a good estimate of your property’s standby base load. Multiply a stable demand in kW by 24 hours and 30 days to estimate its monthly kWh impact. The result can be surprising: it is energy you pay for before doing anything else. Reducing persistent loads often offers the best return.

Step 3: Apply common office improvements

  • Schedule pantry water heating: Use the automations from Chapter 8 so water heating operates only during business hours. This eliminates two to three full days of keep-warm energy over weekends and public-holiday periods.
  • Switch equipment off after work: Connect copiers, monitors, and desktop equipment to suitable smart plugs and switch them off together at 10 p.m.
  • Assess air-conditioner setpoints: Measure before changing anything. Compare air-conditioning energy with outdoor temperature to estimate how much raising the setpoint by one degree saves.
  • Notify on abnormal demand: Create an automation that sends a notification when total power exceeds a chosen threshold outside business hours; see Chapter 7. This often catches equipment that somebody forgot to switch off.

Step 4: Write the report

A useful energy-saving report needs only the following sections; it does not need to read like an academic paper:

  1. Measurement method

    State which circuits or devices you measured, what equipment you used, and the start and end dates. Be candid about anything not measured—for example, “Lighting circuit not included.” This increases credibility.

  2. Baseline data

    Give pre-improvement monthly consumption, the daily average, and standby base load. Include figures from the Energy Dashboard’s monthly view.

  3. Measures taken

    List each measure separately and state what changed and when it began. If an automation is involved, include its trigger conditions as evidence of implementation.

  4. Post-improvement data and comparison

    Compare energy use over periods of equal length. Report both the absolute change in kWh and the percentage change, then add a local-currency estimate using the documented tariff.

  5. Confounding factors

    Be honest about external influences: “This period was outside the cooling season and temperatures were lower, so seasonal conditions explain part of the reduction.” A report that includes this caveat is far more credible than one that appears perfect.

Tip: To extract the underlying figures, switch the Energy Dashboard chart through the required time ranges and record each value, or query the corresponding Utility Meter sensor on the History page. Community integrations can export larger quantities of statistics, but that is beyond this chapter’s scope.

Advanced: device rankings and solar self-consumption

Rank consumption by device

Add each smart plug’s kWh sensor to Individual devices in the Energy settings. The dashboard will automatically rank the devices by energy use.

If a circuit’s main meter and its downstream devices are all listed, consumption can be double-counted because the main meter already includes the devices below it. Home Assistant provides an “upstream device” setting to represent this hierarchy.

Warning: To configure a hierarchy, first add every relevant entity to the Individual devices list. Only devices already on the list appear in the Upstream device drop-down. If you reverse the order, the required option will not be available.

Current power distribution

The newer Distribution card shows the proportional distribution among several entities as a horizontal bar, with an interactive legend. Select or clear legend entries and the percentages recalculate immediately. Add a set of power sensors to see which circuit or appliance is drawing power right now. This is particularly useful for identifying the cause of a sudden load increase.

Warning: This card checks whether its entities have compatible types and units. It will not accept W and kWh on the same card. Compare either power or energy, never both together.

The Energy Dashboard’s Now view also continues to expand. Badges at the top show current electric power, gas flow, and water flow. Water has its own Sankey chart, similar to the electricity chart, showing where water is going. For a quick picture of what is running now, this view is faster than assembling custom cards.

Solar self-consumption rate

With solar, one useful indicator is how much generated energy you consume on site and how much you export to the grid.

Once solar sources are configured, the Energy Dashboard shows generation in relation to grid import and export. For a specific percentage, create a Template sensor based on “(total generation − grid export) ÷ total generation”:

template:
  - sensor:
      - name: "Solar self-consumption ratio"
        unique_id: solar_self_consumption_ratio
        unit_of_measurement: "%"
        state_class: measurement
        availability: >
          {{ is_number(states('sensor.solar_production_monthly'))
             and is_number(states('sensor.grid_export_monthly'))
             and states('sensor.solar_production_monthly') | float(0) > 0 }}
        state: >
          {% set gen = states('sensor.solar_production_monthly') | float(0) %}
          {% set exp = states('sensor.grid_export_monthly') | float(0) %}
          {{ ((gen - exp) / gen * 100) | round(1) }}

Replace sensor.solar_production_monthly and sensor.grid_export_monthly with your own monthly Utility Meter sensors. The availability block prevents an invalid result while either source is unavailable or generation is zero.

Tip: Do not assign a device_class to this percentage. A percentage is neither energy nor power, and forcing an unrelated device class will cause Home Assistant to complain. Use only unit_of_measurement: "%" and state_class: measurement.

How long is data retained?

Many users worry about database growth. First distinguish these two kinds of data:

TypeWhat it storesRetention
Recorder historyFull detail for every state changeControlled by purge_keep_days; 10 days by default
Long-term statisticsAggregated statistics used by the Energy DashboardNot removed with ordinary history, so much older monthly reports remain available
Concept: It is normal for the History page to retain only 10 days while the Energy Dashboard can still show the same month last year. They use different data. Adjust Recorder retention if you need more detailed history, but do not increase it solely for energy reports; that only enlarges the database.

Troubleshooting

  1. My sensor is missing from the Energy settings selector

    In most cases, its attributes are incompatible. Open Settings → Tools → States (Developer tools in older versions) and check that device_class is energy (or gas / water), state_class is total_increasing or total, and unit_of_measurement is supported. Capitalisation must be exact: kWh is valid, but KWH and kwh are not. You may also have selected the power sensor in W rather than the energy sensor in kWh; their names often differ by only one word.

  2. One day shows several thousand kilowatt-hours

    A common cause is a source sensor that resets to zero but is treated as continuously cumulative, or a device that resets while using state_class total. Home Assistant may then count the jump from 0 back to a large reading as one enormous increase.
    Fix the cause: Change the sensor’s state_class to total_increasing. If it feeds Utility Meter, ensure that Periodically resetting is enabled.
    Repair the existing statistic: Open Settings → Tools → Statistics, find the entity, locate the bad data point by date and time, and correct it to a reasonable value. This is Home Assistant’s official interface for repairing statistics; a “Fix issue” link also appears beside an entity when Home Assistant detects a problem.

  3. The dashboard remains empty after setup

    First, make sure you have waited long enough. Statistics are written hourly, so a newly configured dashboard will be empty; allow at least one or two hours. Next, confirm that Energy appears in the sidebar. If not, check configuration.yaml to see whether default_config: was removed. Finally, check whether the source sensor is changing. If it remains unavailable or unknown, the problem is the device connection, not the dashboard.

  4. Repairs reports “state class is incompatible with device class”

    The most common invalid combination is device_class: power with total_increasing. Power is instantaneous and must use measurement. If an integration provides the sensor, report the problem to its developer or the device firmware vendor. If it is your own Template sensor, correct the YAML directly.

  5. The integrated value is 1000 times too large or 1000 times too small

    The metric prefix (unit_prefix) and time unit (unit_time) are not paired correctly. To integrate W into kWh, use prefix k and time h. Leaving the prefix empty produces Wh. If the settings are wrong, delete and recreate the helper; correcting them does not retroactively repair previously accumulated data.

  6. The appliance is running, but the Integral sensor is not changing

    The source power sensor may not report again while its value remains unchanged. Integration advances only when it receives a new sample. Open the Integral helper’s settings and give Max sub-interval a value such as 60 seconds, forcing the calculation to advance with time.

  7. Utility Meter’s first month looks wrong

    This is expected: the official documentation states that the first cycle is necessarily incomplete. Wait for the next complete cycle before evaluating the result, and exclude the entire first cycle from reports.

  8. Cost always shows 0

    Check that you actually selected a cost-tracking method in the Energy settings; the default is no cost tracking. If you selected an entity for the current unit price, confirm that its value is valid. A value of unknown cannot produce a cost. Cost statistics, like energy statistics, also take up to an hour to produce their first entry.

FAQ

Must I buy hardware, or can I estimate consumption?
You can estimate consumption, but do not use estimates for external reporting. Using the method introduced in Chapter 12, create a Template sensor that outputs the appliance’s rated power while a switch is on and 0 while it is off, then integrate that value. This is adequate for asking roughly how much a light uses, but it assumes that the appliance always operates at its rated power. The resulting error can be very large for variable loads such as air conditioners and refrigerators. To support a claim with credible figures, measure actual consumption.
The Energy Dashboard does not match my utility bill. Is my setup wrong?
Usually not. There are several possible reasons: your sensors may cover only some circuits or appliances rather than the whole property; a Riemann sum is an approximation and depends on sampling frequency; and the billing periods may differ because the utility uses its own meter-reading date while Home Assistant defaults to calendar months. Use Utility Meter’s offset to align the periods.

Treat the Energy Dashboard as a trend tool rather than a bill-reconciliation tool unless you have an authoritative whole-property meter and matching billing boundaries. Its greatest value is showing that this month used 20% less than last month, not matching every line of a bill exactly. When reconciling, also account for tariff structure, taxes, and fixed charges.
Should I use Integral or Utility Meter? Do I need both?
They solve different problems, and you may need both.

Integral: Converts power in watts (W) into cumulative energy in kilowatt-hours (kWh). Use it only when the device has instantaneous power but no cumulative energy sensor.
Utility Meter: Divides a continuously increasing kWh total into today, this month, this year, or another cycle.

The flow is: power → Integral → cumulative energy → Utility Meter → cycle totals. If your plug already provides cumulative kWh, skip Integral and feed that sensor directly into Utility Meter.
If I rename a sensor or replace a smart plug, will I lose its history?
Statistics are associated with the entity ID (entity_id). Changing only the display name does not affect history. If you change the entity ID, Home Assistant will usually ask whether to move its statistics; select Yes to preserve them.

If you replace the physical device, however, it becomes a new entity with a new counter. The old data remains attached to the old entity, but the two series do not join automatically and the chart will contain a break. Plan names carefully from the start, as Chapter 4 emphasises. Before replacing a device, record its old monthly statistics as a backup.
Will many sensors wear out my SD card or fill the drive?
They have an impact, but usually less than expected. Power sensors change frequently and therefore create the most writes. Keep three points in mind: first, Recorder retains detailed history for only 10 days by default, which is already conservative, so do not increase it without a reason; second, long-term statistics are aggregated and much smaller; third, if necessary, use Recorder configuration to exclude high-frequency sensors whose detailed history you do not need—their statistics can still be retained.

If Home Assistant still runs from an SD card and you intend to record energy data over the long term, seriously consider moving to an SSD. Frequent writes are not kind to SD cards. See Chapter 9 for backup guidance.
I have no solar panels or battery—only a few smart plugs. Is this still useful?
Very useful; this is where most people begin. Three plugs can already provide valuable insight: one for an air conditioner, one for a dehumidifier, and one for an older appliance you suspect. After a month, the main load will be clear.

The Energy Dashboard’s Individual devices section is designed for this scenario. You do not need a whole-property meter. Once you understand the system and know it is valuable to you, you can consider whole-property monitoring.
How much data do I need before drawing conclusions?
It depends on the conclusion.

“Which appliance uses the most energy?”: One week gives a useful indication; two weeks is reasonably reliable.
“My energy-saving measure worked.”: Compare at least one month before with one month after, and account for seasonal effects. Comparing July with October may attribute a weather-driven reduction to your intervention. Ideally, compare the same month across two years, but that requires waiting a year.
“What is the annual total?”: This genuinely requires a full year. Collect sound data in the first year so that you can compare it in the second.