NILM is estimation
NILM estimates appliance behavior from one aggregate mains power signal. It does not directly measure each appliance.
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.
Users who already have a mains power sensor and want appliance-level visibility with less hardware.
NILM provides useful estimation, not direct appliance measurement.
Check these items before you install or train anything.
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.
If Home Assistant OS runs in a Proxmox VM and NILM Training Server immediately switches to Error with blank add-on logs, shut down the VM, set Proxmox VM > Hardware > Processor > Type to host, reboot the VM, and start the training server again. The default kvm64 CPU type can hide CPU instructions required by TensorFlow. If the host CPU does not support the required instructions, run the Training Server on another compatible machine and configure NILM with a custom external training server URL.
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.
NILM estimates appliance behavior from one aggregate mains power signal. It does not directly measure each appliance.
Appliances with clearer and more distinctive power signatures are usually easier to model well.
Results depend strongly on signal quality and on how representative your training interval is.
Use NILM when you want useful appliance-level visibility with limited hardware. Do not treat it as legal-grade or meter-grade measurement.
This section explains the basic idea of NILM and the algorithm reference used in this project.
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 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.
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.
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
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.
Choose the setup that matches your Home Assistant installation, then configure NILM Dashboard and the Training Interface.
HA_TOKEN=replace_with_your_home_assistant_long_lived_access_token
HA_REST_API_URL=http://YOUR_HOME_ASSISTANT_HOST_IP:8123/api
HA_WS_URL=ws://YOUR_HOME_ASSISTANT_HOST_IP:8123/api/websocketservices:
nilm-trainer:
image: ghcr.io/lgarciamarrero92/ha-nilm-trainer:latest
container_name: nilm-trainer
restart: unless-stopped
ports:
- "8024:8080"
networks:
- nilm
nilm-edge:
image: ghcr.io/lgarciamarrero92/ha-nilm-edge:latest
container_name: nilm-edge
restart: unless-stopped
ports:
- "8099:8099"
volumes:
- nilm_data:/data
environment:
SUPERVISOR_TOKEN: "${HA_TOKEN}"
HA_REST_API_URL: "${HA_REST_API_URL}"
HA_WS_URL: "${HA_WS_URL}"
networks:
- nilm
volumes:
nilm_data:
networks:
nilm:
driver: bridgeSUPERVISOR_TOKEN is set from HA_TOKEN because the NILM container uses that environment variable name for Home Assistant API authentication.
NILM is split into a live inference service and a training service so daily operation stays lightweight.
Monitors one mains power sensor, runs live inference, publishes estimated entities, and provides the setup, preview, and training preparation UI.
Receives prepared training jobs, runs model training in the background, then returns trained embeddings and learned thresholds to NILM.
Once models are trained and enabled in NILM, the training service is only needed again when you want to train or retrain models.
When the training server runs as a Docker container, NILM connects to it through the training URL you save in the Training page.
NILM requests the Supervisor manager role so it can query installed add-ons, detect whether NILM Training Server is installed and started, read its internal hostname, and build the internal training server URL automatically.
Open the Training Interface, choose the training server, then prepare a labeled job for the Training Server.
Use this when you do not have a dedicated appliance sensor. You manually mark ON intervals for the appliance in the selected mains range.
Use this when a real appliance power sensor already exists in Home Assistant. The sensor history should cover the full selected mains range.
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.
After training completes, the model is stored inside NILM and becomes available as a model card in NILM Dashboard.
NILM Dashboard is where you inspect historical mains data and preview models output.
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.
Each trained appliance appears as a model card with its name, publishing state, and a Disaggregate action.
Predictions are added directly to the mains chart. You can display more than one prediction at the same time and remove them individually.
Preview the disaggregation result on an interval you already understand well. That makes it much easier to judge whether the prediction is useful.
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.
Enable live publishing for appliances you want to monitor in real time and use in dashboards or automations.
The NILM entities appear in Home Assistant and update as the model runs live against the mains signal.
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.
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.
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.