Guide

Non-Intrusive Load Monitoring for Home Assistant

Estimate appliance usage from a single mains power sensor.

Use NILM to train appliance models from Home Assistant history, preview historical disaggregation, and publish live estimated entities for dashboards and automations without installing a dedicated meter on every device.

Best for

Users who already have a mains power sensor and want appliance-level visibility with less hardware.

Keep in mind

NILM provides useful estimation, not direct appliance measurement.

Requirements

Before you begin

Check these items before you install or train anything.

What you need

  • A working Home Assistant OS installation.
  • A mains power sensor already available in Home Assistant.
  • Recorder history for the time range you want to use for training.
  • Both NILM apps installed: NILM and NILM Training Server.
  • At least 4 GB of RAM for Home Assistant and the NILM apps.
Memory usage

RAM usage depends strongly on the interval you use for training. Shorter intervals are lighter and are the best choice for a first training run.

Sensor frequency

For better NILM performance, the mains sensor should update at intervals in the order of seconds. Update intervals such as 1 s, 3 s, 5 s, or 10 s usually work well.

What to expect

NILM is estimation

NILM estimates appliance behavior from one aggregate mains power signal. It does not directly measure each appliance.

Some appliances are easier

Appliances with clearer and more distinctive power signatures are usually easier to model well.

Training data matters

Results depend strongly on signal quality and on how representative your training interval is.

Important

Use NILM when you want useful appliance-level visibility with limited hardware. Do not treat it as legal-grade or meter-grade measurement.

Concepts

How NILM works

This section explains the basic idea of NILM and the algorithm reference used in this project.

Direct metering and NILM

Direct metering

Direct metering uses hardware such as smart plugs, clamp meters, or submeters to measure appliances individually. It is easier to trust, but hardware cost and installation effort increase with every additional appliance.

NILM

NILM reuses one aggregate mains signal and a trained appliance model to estimate appliance power and ON/OFF state. It is cheaper and easier to scale, but the result is an inference rather than a direct reading.

Why this matters

For many Home Assistant users, full submetering is too expensive or too invasive. NILM can provide useful appliance-level visibility without requiring a dedicated meter for every device.

Implemented algorithm reference

The implemented algorithm is based on RefQuery from the paper "Lightweight and Scalable Transfer Learning Framework for Load Disaggregation" (arXiv:2603.04998): https://arxiv.org/abs/2603.04998

Keep this in mind

NILM is best understood as useful estimation. It is often good enough for visibility, experimentation, and automation, but it is not the same thing as direct hardware measurement.

Step 1

Installation and first setup

Install both apps, start them, then configure Energy Dashboard and the Training Interface.

Install the apps

  1. Open Home Assistant.
  2. Go to Settings, then Apps, then Install App.
  3. Add this repository: https://github.com/lgarciamarrero92/ha-nilm
  4. Install the NILM app.
  5. Install the NILM Training Server app.

Start the apps

  1. Start NILM Training Server first.
  2. Then start NILM.
  3. Open the NILM interface from Home Assistant.

Configure Energy Dashboard

  1. Open Energy Dashboard.
  2. Select and save your mains power sensor.
  3. Confirm that the mains chart loads correctly.
Next

Once setup is complete, train your first appliance model.

Step 2

Train your first appliance model

Open the Training Interface, confirm the training server is ready, then follow the steps.

Choose an annotation method and the appliance name

Manual interval annotation

Use this when you do not have a dedicated appliance sensor. You manually mark ON intervals for the appliance in the selected mains range.

Sensor annotation

Use this when a real appliance power sensor already exists in Home Assistant. The sensor history should cover the full selected mains range.

Choose the mains interval

  1. Load the mains history range that will be used for training.
  2. Select a range you can annotate completely, not partially.
  3. The training range is limited to the previous 7 days to avoid very large training datasets.
Interval quality drives accuracy

Pick a mains interval you can label completely. For manual annotation, mark all ON intervals in that range. For sensor annotation, you need an appliance sensor data for the full range.

Define labels

  1. Manual interval annotation: draw ON intervals for the appliance in the selected mains range.
  2. Sensor annotation: select the appliance power sensor used as ground truth.

Prepare and send

  1. First review the Training Overview section and confirm appliance name, supervision mode, labels, and mains range.
  2. Click the button: Prepare and Send to Training Server.
  3. NILM validates the configuration, prepares the package, creates the local job, and sends it to the training server.
  4. Follow progress in the Training Jobs table until the model is done.
What success looks like

After training completes, the model is stored inside NILM and becomes available as a model card in Energy Dashboard.

Next

Preview and validate the model in Energy Dashboard.

Step 3

Validate your model in Energy Dashboard

Energy Dashboard is where you inspect historical mains data and preview models output.

Main dashboard elements

Mains chart

This is the main reference chart for the selected range. Predictions are drawn on top of it so you can compare the estimate against the aggregate mains signal.

Model cards

Each trained appliance appears as a model card with its name, publishing state, and a Disaggregate action.

Prediction layer

Predictions are added directly to the mains chart. You can display more than one prediction at the same time and remove them individually.

What the dashboard is good for

  • Saving the mains power sensor used by NILM.
  • Inspecting the historical mains signal.
  • Running offline disaggregation for one appliance or for all available models.
  • Debugging predicted power, ON/OFF state.

Appliance share diagram

  • NILM also plots an appliance share diagram to help you understand how energy is distributed across the currently plotted predictions.
  • The diagram uses only the predictions that are currently visible on the chart.
  • A dedicated Base Load share is also shown; it represents the estimated background portion of mains consumption.
  • Other is the remaining mains portion not explained by the visible appliance predictions plus Base Load.
  • The diagram updates automatically whenever predictions are added or removed.
Best first validation

Preview the disaggregation result on an interval you already understand well. That makes it much easier to judge whether the prediction is useful.

Step 4

Publish live entities in Home Assistant

When live publishing is enabled, NILM creates Home Assistant entities based on the trained model. These are live model outputs derived from mains power, not direct measurements. The live entities are updated approximately every 8 seconds.

Live entities

  • sensor.nilm_<appliance>_power
  • binary_sensor.nilm_<appliance>_on

What they mean

  • The power sensor is the estimated appliance power at runtime.
  • The binary sensor is the estimated appliance ON/OFF state at runtime.
When to enable live publishing

Enable live publishing for appliances you want to monitor in real time and use in dashboards or automations.

What success looks like

The NILM entities appear in Home Assistant and update as the model runs live against the mains signal.

Important

Limitations

NILM is useful, but it is not equally strong for all appliance types. Knowing the limits helps you choose better targets and interpret results correctly.

Appliance types that are usually harder

  • Very low-power appliances such as lighting, phone chargers, and small standby loads.
  • Appliances that stay ON for long periods with flat consumption, such as some TVs or computers.
  • Very short-cycle appliances or events that are brief and easy to hide inside aggregate mains noise.
  • Multiple similar appliances running at the same time, which can produce overlapping signatures.

Where this method is usually stronger

  • The current method was trained with representative, but not exhaustive, appliance types such as fridge, dishwasher, washing machine, kettle, and microwave.
  • Because of that training exposure, performance is often better for appliance signatures similar to those categories.
What this means in practice

The method can still work well for other appliances when their signatures are identifiable from mains. The more distinctive and repeatable the signature, the better the expected results.

Interpretation guidance

Use NILM as an estimation tool. For difficult appliance types, expect higher uncertainty and validate with known intervals before relying on live behavior for automations.