Home Automation and IoTSensor and Camera AutomationIntermediate2-4 hoursLab

Build a Home Assistant Power and Energy Monitoring Lab

Use one known-compatible metering device to distinguish instantaneous power (W) from accumulated energy (kWh), validate Home Assistant statistics, and prove a threshold automation safely.

Last reviewed4/30/2026
energy dashboardspresence and door automation
Home AssistantRaspberry PiSmart Energy Monitoring DevicesYAML Configuration

Expected Outcome

Home Assistant receives a power entity and a valid energy entity from one test device, the Energy dashboard records consumption, and a controlled load/threshold test triggers and clears one notification.

Assumptions

  • Current Home Assistant deployment

  • One supported metering device/integration that exposes power and cumulative energy with appropriate device/state classes

  • A safe controllable load within the meter/device rating

  • No mains wiring unless performed with appropriately rated hardware and qualified practices

Bill of Materials

  • Raspberry Pi 4 or higher

  • MicroSD card (16GB or more)

  • Power supply for Raspberry Pi

  • Smart energy monitoring devices (e.g., TP-Link Kasa Smart Plug)

  • Home Assistant installation (can be done via Hass.io)

  • Laptop or computer for configuration

  • Internet connection

Build Steps

  1. Verify entity semantics before building dashboards

    Identify which entity reports instantaneous watts and which reports accumulated energy in Wh/kWh. Confirm Home Assistant shows the expected unit, device class, state class, and increasing energy history.

  2. Compare against a known load

    Use a safe appliance/load with an approximate known draw or a trusted reference meter. Observe baseline, turn on the load, and confirm the power reading changes plausibly rather than treating any nonzero value as calibrated.

  3. Add the cumulative energy entity to the Energy dashboard

    Configure the supported Energy dashboard source and allow enough statistics time to populate. Do not feed a raw instantaneous watt entity directly where cumulative energy is required unless an appropriate integration/sensor conversion is deliberately configured.

  4. Create one threshold automation

    Use a bounded threshold plus duration/hysteresis so a one-sample spike does not cause noise. Trigger a harmless notification and include current value/unit in the message.

  5. Run controlled high/low tests

    Use the safe test load or temporarily adjust the lab threshold to enter the alert condition, confirm notification, then return below the clear threshold and confirm recovery.

Validation

  • Power and energy entities have correct units/classes

  • Known load changes power reading plausibly

  • Energy statistics accumulate over time

  • Threshold requires the configured duration/hysteresis

  • Notification fires and clears during controlled test

  • The lab distinguishes measurement confidence from billing-grade accuracy

Troubleshooting

  • Entity missing from Energy dashboard: inspect unit/device_class/state_class/statistics eligibility

  • Power works but energy does not: verify cumulative energy source rather than inventing a dashboard workaround

  • Implausible readings: validate device calibration/CT orientation/config before changing automations

Cleanup or Rollback

  • Remove temporary threshold overrides/test automation if not retained

  • Return test load to normal use and document device calibration limitations

Next Improvements

  • Explore additional integrations for other smart home devices.

  • Consider adding energy-saving automations based on consumption data.

  • Join the Home Assistant community for support and advanced configurations.

Keep Moving

Build on what you just completed

Continue with a related Lab or return to this build path for a different implementation.