Home Assistant Energy Monitoring Setup — Solar, Battery & Grid

📅 April 2026⏱️ 6 min read🏷️ Home Assistant · Solar · Energy

Home Assistant's built-in Energy dashboard is one of its most powerful features — but it only works as well as the data you feed it. Setting it up correctly for a solar + battery system takes a little thought. This guide shows you exactly which sensors to use, how to configure them, and how to get the most out of long-term energy data.

What good energy monitoring gives you

With properly configured energy monitoring you can see exactly: how much solar you produced, how much went to the battery vs direct consumption vs grid export, your real self-consumption percentage, and which appliances are consuming the most power. This data is the foundation for every useful solar automation.

The HA Energy Dashboard — What It Needs

Settings → Energy → Add sources. The dashboard needs specific types of sensors:

The critical point: these must be energy sensors (kWh), not power sensors (W or kW). HA can convert a power sensor to a Riemann sum energy sensor using a helper — but it's easier to use inverter integrations that already provide daily kWh totals.

SolaX Integration — What You Get

The SolaX HA integration (via HACS) provides these sensors automatically from a real SolaX X1-Hybrid system:

Map the daily kWh sensors directly to the Energy dashboard. The real-time power sensors are what you use in automations.

Shelly EM — When You Don't Have Inverter Integration

If your inverter doesn't have a HA integration, or you want independent monitoring, a Shelly EM with two clamp sensors at the distribution board gives you:

Two clamps: one on the main feed in, one on the solar feed. HA can calculate consumption, import, and export from these two values. Configure Shelly local MQTT in the Shelly app, then add the MQTT integration in HA.

Creating Energy Sensors from Power Sensors

If you have a real-time power sensor (W) but no cumulative energy sensor (kWh), create one using HA's Riemann Sum integration helper:

  1. Settings → Helpers → Create Helper → Riemann Sum
  2. Input: your power sensor
  3. Unit: kWh
  4. Integration method: Left Riemann sum
  5. Precision: 2

This creates a cumulative energy sensor that the Energy dashboard accepts.

Long-Term Statistics and CSV Logging

HA stores long-term statistics automatically for energy sensors. But for detailed analysis, logging to CSV via a Node-RED flow gives you much richer data with custom columns and timestamps.

A production Node-RED flow for solar logging captures 78 columns every 60 seconds including: battery SOC, charge rate, PV power per string, grid power, AC state, inverter mode, outdoor temperature, time of day — everything needed to diagnose issues and tune automations.

The CSV is stored at /homeassistant/www/solar_log.csv and accessible via the HA media browser for download and analysis in Excel.

Individual Appliance Monitoring

For the highest-value appliances, add individual power monitoring:

The HA Recorder — What to Exclude

With 869 entities, the HA database grows fast. Exclude high-frequency entities that you don't need long-term history for to keep the DB manageable:

# configuration.yaml
recorder:
  purge_keep_days: 30
  exclude:
    entity_globs:
      - sensor.solax_battery_1_power_*  # keep charge only
      - sensor.*_rssi
      - sensor.*_lqi
      - sensor.*_linkquality
    entities:
      - sensor.time
      - sensor.date

Ready to plan your HA solar automations?

Once your energy monitoring is in place, the Solar Automation Planner generates the automations that actually use this data — with working YAML for your specific setup.

🏠 Open the HA Planner