Home Assistant Solar: Track, Automate, and Optimize Your Solar Energy

You spent thousands on solar panels. Now make them work harder. Home Assistant connects to your inverter, tracks every watt you produce, and automates your home to use solar energy when it is most abundant. Run the dishwasher when the sun peaks. Charge your EV from your own roof. Store excess in a battery for the evening. This guide covers every major inverter brand, the best automations, and how to maximize the return on your solar investment.

Check Your Setup Energy Monitoring Guide

Why Home Assistant Is the Best Solar Monitoring Tool

Your inverter manufacturer gives you an app. It shows production numbers. That is about it. Home Assistant takes that data and does something useful with it. It correlates production with consumption, automates devices around solar availability, and gives you a single dashboard that shows everything: panels, battery, grid, and every device in your home.

โ˜€๏ธ

Real-Time Production Tracking

See exactly how many watts your panels produce right now. Track daily, weekly, and monthly totals. Compare against forecast predictions.

๐Ÿ”‹

Self-Consumption Optimization

Automatically shift heavy loads to peak solar hours. Run the washing machine, heat pump, or EV charger when production exceeds demand.

๐Ÿ“Š

Energy Dashboard Built In

HA's native Energy Dashboard visualizes production vs consumption, grid import vs export, battery charge cycles, and cost savings. All in one place.

๐Ÿ”ฎ

Solar Forecasting

Forecast.Solar predicts tomorrow's production based on your panel setup and weather. Plan energy use ahead of time instead of reacting.

Connecting Your Solar Inverter to Home Assistant

Almost every major inverter brand works with Home Assistant. Some have official integrations that take two minutes to set up. Others need a HACS custom component or Modbus connection. Here is how the most popular brands connect.

SolarEdge

Search volume: "solaredge home assistant" gets 810+ monthly searches. This is the most popular inverter brand in the HA community.

SolarEdge has an official Home Assistant integration that pulls data from the SolarEdge monitoring API. You need your site ID and API key from the SolarEdge monitoring portal. Setup takes about five minutes.

What you get: Current power output, daily/monthly/yearly energy production, lifetime energy, peak power today. The integration polls the cloud API, so there is a slight delay (updates every 15 minutes on the free tier).

Going local: For real-time data without cloud dependency, you can use SolarEdge Modbus TCP. Enable Modbus on your inverter's web interface (connect via Ethernet), then use the HA Modbus integration or the HACS "SolarEdge Modbus" custom component. This gives you second-by-second updates.

Pro tip: If you have a SolarEdge battery (StorEdge), the Modbus method also exposes battery state of charge and power flow, which the cloud API does not always provide reliably.

Enphase

Enphase microinverters use the Envoy gateway as their local hub. Home Assistant has an official Enphase Envoy integration that communicates locally with your Envoy over your network. No cloud needed.

What you get: System production, consumption (if you have CTs installed), per-panel production (IQ7/IQ8), grid import/export, battery state (Enphase IQ Battery).

Setup: Go to Settings, Devices and Services, Add Integration, search "Enphase Envoy." Enter your Envoy's IP address. For newer firmware, you will need your Enphase account credentials for the initial token. After that, all communication is local.

Pro tip: Enphase Envoy updates every 5 seconds locally. This makes it one of the best inverter integrations for real-time automations like "start the EV charger when solar surplus exceeds 2 kW."

๐Ÿ‡ฆ๐Ÿ‡น Fronius

Fronius inverters have an official Home Assistant integration that connects via the local Solar API on your inverter. Completely local, very fast updates.

What you get: AC power, DC power, daily energy, total energy, voltage, current, frequency. If you have a Fronius Smart Meter, you also get grid import/export and consumption data.

Setup: Connect your Fronius inverter to your network via Ethernet. Find its IP, then add the Fronius integration in HA. The Fronius Solar API v1 is enabled by default on most models.

๐Ÿ‡จ๐Ÿ‡ณ Huawei FusionSolar

Search volume: "fusionsolar home assistant" pulls 350+ monthly searches and growing fast as Huawei gains market share.

Huawei inverters connect via the HACS "Huawei Solar" integration, which uses Modbus TCP to communicate locally with the inverter. This is one of the best maintained community integrations in HACS.

What you get: Real-time production, daily yield, battery state of charge (Luna 2000), grid power, consumption. You can even control the battery charging mode: force charge from grid during cheap rates, or force discharge during expensive peaks.

Setup: Connect your Huawei inverter via Ethernet (the Wi-Fi dongle does not support Modbus). Install "Huawei Solar" from HACS, enter the inverter IP. If you have a DTSU-666 power meter, enable it in the integration config for full energy flow visibility.

Other Inverter Brands

BrandIntegrationConnectionNotes
SMAOfficial (SMA)Local (Speedwire)Excellent local support, fast updates
GoodWeHACS (GoodWe)Local (UDP)Works great, battery control supported
GrowattHACS (Growatt Server)Cloud APICloud only for most models. Modbus via ShineLink dongle for local.
SolisHACS (Solis Sensor)Cloud / ModbusCloud via Ginlong API. Local via RS485 Modbus adapter.
APsystemsHACS (APsystems)Local (ECU-R)Microinverters. Connect via ECU gateway.
VictronOfficial (via MQTT)Local (MQTT)GX device publishes via MQTT. Great for off-grid setups.
Alpha ESSHACS (Alpha ESS)Cloud / ModbusCloud API available. Local Modbus for advanced users.
Generic / DIYShelly 3EM / Emporia VueLocalCT clamp on the solar feed. Works with any inverter.

Setting Up the Energy Dashboard for Solar

Home Assistant's Energy Dashboard is purpose-built for solar owners. It visualizes the complete energy flow through your home: what your panels produce, what you consume, what goes to and from the grid, and what charges or discharges your battery. Setting it up takes about 10 minutes once your inverter integration is running.

Step-by-Step Energy Dashboard Setup

  1. Go to Settings > Dashboards > Energy (or navigate to the Energy panel in the sidebar)
  2. Under Electricity Grid, add your grid consumption sensor (the one that measures kWh imported from the grid) and your grid return sensor (kWh exported)
  3. Under Solar Panels, click "Add Solar Production" and select your inverter's total energy production sensor (it must be a cumulative kWh sensor, not instantaneous watts)
  4. If you have a battery, add it under Home Battery Storage with the battery charge and discharge energy sensors
  5. Optionally add Forecast.Solar to see predicted production overlaid on actual production
  6. Add individual devices if you have smart plugs tracking specific appliances (like your EV charger or heat pump)
  7. Set your electricity prices (fixed rate or dynamic via an integration like Tibber or Octopus Energy)

Important: The Energy Dashboard needs cumulative energy sensors (kWh that count up over time), not power sensors (watts). Most solar integrations provide both. Pick the one with "energy" or "kWh" in the name, not "power" or "W."

What the Dashboard Shows You

Production vs Consumption

See how much of your own solar energy you actually use. The green bar is solar, the gray bar is grid. Your goal: make green as big as possible.

Self-Consumption Rate

The percentage of solar production you use directly instead of exporting. Without a battery, typical rates are 30 to 40%. With a battery and smart automations, you can hit 70 to 90%.

Grid Import vs Export

Track exactly how much energy you buy from and sell to the grid. With dynamic pricing, this directly translates to money saved or earned.

Cost Savings

If you configure electricity prices, the dashboard calculates your actual savings. See exactly how much money your panels saved you today, this week, or this year.

Solar Forecasting with Forecast.Solar

Knowing what your panels produce right now is great. Knowing what they will produce tomorrow is even better. Forecast.Solar is a free service that predicts your solar output based on your panel configuration and weather forecasts. Home Assistant has a native integration for it.

Setting Up Forecast.Solar

  1. Go to Settings > Devices and Services > Add Integration
  2. Search for "Forecast.Solar" and add it
  3. Enter your latitude and longitude (auto-filled from your HA config)
  4. Set your panel azimuth (0 = south, 90 = west, -90 = east, 180 = north)
  5. Set the tilt angle of your panels in degrees (flat roof = 0, typical pitched roof = 30 to 40)
  6. Enter your total panel capacity in kWp (kilowatt peak)
  7. Optionally set a damping factor to account for shading, dirt, or inverter losses (start with 0.9)

What You Get

The integration creates several sensors:

  • Estimated Energy Production Today (kWh total for the day)
  • Estimated Energy Production Tomorrow
  • Estimated Energy Remaining Today (how much more to expect)
  • Estimated Power Now (predicted wattage at this moment)
  • Hourly forecast data (available as attributes for advanced automations)

Multiple roof faces? If your panels face different directions (e.g., east/west split), add the integration twice with different azimuth values. Then create a template sensor that adds them together.

Forecast.Solar: Free vs Paid

The free tier updates every 60 minutes and gives basic forecast data. That is plenty for most automations. The paid plans ($3 to $8/month) offer 15-minute updates, longer forecast horizons, and historical accuracy data. Start free. If your automations need tighter timing, upgrade later.

Home Batteries and Home Assistant

A home battery changes the solar game entirely. Without one, excess solar goes back to the grid (often at a low feed-in rate). With a battery, you store that energy and use it in the evening when electricity is most expensive. Home Assistant can monitor your battery state and, in many cases, control charging and discharging strategies.

Tesla Powerwall

Official integration via the Tesla Gateway's local API. Shows state of charge, power flow, and grid status. Tesla has been locking down the local API in newer firmware versions, so the HACS "Tesla Powerwall" integration is often more reliable than the official one.

Huawei Luna 2000

Fully supported via the HACS Huawei Solar integration. Shows charge level, charge/discharge power, and allows you to set charging modes. You can force charge from grid during cheap rates and force discharge during peaks.

BYD Battery-Box

Typically monitored through the inverter it connects to (Fronius, SMA, Kostal, etc.). The inverter integration exposes battery sensors. Direct BYD integration is limited but not usually needed.

Alpha ESS

HACS integration available with cloud API access. Shows battery percentage, charge/discharge, solar production. Some models support local Modbus for cloud-free monitoring.

Victron Energy

The gold standard for off-grid and advanced setups. The GX device publishes everything via MQTT: battery voltage, current, SOC, PV yield, AC loads. Full local control, incredibly detailed data.

Enphase IQ Battery

Monitored through the Enphase Envoy integration. Shows charge percentage, power flow, and reserve level. Enphase controls charging strategy through their own algorithms, but you can see the data in HA.

5 Solar Automations That Save Real Money

Monitoring is nice. Automating is where the savings happen. These automations shift your energy consumption to align with solar production, maximizing self-consumption and minimizing grid costs.

1. Start the Washing Machine When Solar Surplus Hits 1.5 kW

Instead of guessing when to run appliances, let HA watch your solar surplus and notify you (or trigger a smart plug) when there is enough free energy. A typical washing cycle uses 1 to 2 kWh. Running it on solar saves about $0.30 to $0.60 per load.

alias: "Solar: Run Washing Machine on Surplus"
trigger:
  - platform: numeric_state
    entity_id: sensor.solar_surplus_power
    above: 1500
    for: "00:10:00"
condition:
  - condition: time
    after: "09:00:00"
    before: "16:00:00"
  - condition: state
    entity_id: input_boolean.washing_machine_queued
    state: "on"
action:
  - service: switch.turn_on
    target:
      entity_id: switch.washing_machine_plug
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.washing_machine_queued
  - service: notify.mobile_app
    data:
      message: "Washing machine started. Solar surplus: {{ states('sensor.solar_surplus_power')}}W"

Tip: Create a template sensor for solar surplus: solar_production - home_consumption. If you do not have separate sensors, your inverter integration or a CT clamp can provide these values.

2. Charge the EV Only from Solar

EV charging is the single biggest energy consumer in most homes. Charging at 7 kW for 4 hours uses 28 kWh, which can cost $7 to $10 from the grid. Shifting to solar hours slashes that cost to nearly zero.

alias: "Solar: EV Charge on Surplus"
trigger:
  - platform: numeric_state
    entity_id: sensor.solar_surplus_power
    above: 2000
    for: "00:05:00"
condition:
  - condition: numeric_state
    entity_id: sensor.ev_battery_level
    below: 80
action:
  - service: switch.turn_on
    target:
      entity_id: switch.ev_charger
  - service: notify.mobile_app
    data:
      message: "EV charging started on solar surplus ({{ states('sensor.solar_surplus_power')}}W available)"

Advanced: Use the HACS "OpenEVSE" or "go-e Charger" integration to dynamically adjust charging amps based on available solar surplus. This way the car charges faster when the sun is strong and slower when clouds roll in, but never pulls from the grid.

3. Pre-Heat or Pre-Cool Based on Tomorrow's Forecast

If Forecast.Solar predicts a cloudy day tomorrow, pre-heat your home tonight using off-peak electricity. If tomorrow is sunny, skip the pre-heating because your heat pump will run on free solar. This one automation can save $50+ per month in winter.

alias: "Solar: Pre-Heat on Cloudy Forecast"
trigger:
  - platform: time
    at: "22:00:00"
condition:
  - condition: numeric_state
    entity_id: sensor.energy_production_tomorrow
    below: 5
action:
  - service: climate.set_temperature
    target:
      entity_id: climate.heat_pump
    data:
      temperature: 22
      hvac_mode: heat
  - service: notify.mobile_app
    data:
      message: "Low solar forecast tomorrow ({{ states('sensor.energy_production_tomorrow')}} kWh). Pre-heating the house tonight."

4. Battery: Charge from Grid During Cheap Hours

If your electricity provider offers time-of-use rates (or dynamic rates like Tibber or Octopus), charge your battery during the cheapest hours and discharge during peaks. Some users report saving 30 to 50% on their electricity bill with this strategy alone.

alias: "Battery: Force Charge During Off-Peak"
trigger:
  - platform: time
    at: "02:00:00"
condition:
  - condition: numeric_state
    entity_id: sensor.battery_soc
    below: 30
  - condition: numeric_state
    entity_id: sensor.energy_production_tomorrow
    below: 8
action:
  - service: number.set_value
    target:
      entity_id: number.battery_max_charge_power
    data:
      value: 5000
  - service: select.select_option
    target:
      entity_id: select.battery_charging_mode
    data:
      option: "Force Charge"

Note: Battery control entities vary by brand. The example above uses Huawei Solar entities. SolarEdge, Victron, and others have similar but differently named services.

5. Daily Solar Production Report

Get a notification every evening with your solar performance summary. Know how much you produced, consumed, exported, and saved. Satisfying and useful for spotting issues (a sudden drop in production could mean a faulty panel or inverter problem).

alias: "Solar: Daily Production Report"
trigger:
  - platform: time
    at: "21:00:00"
action:
  - service: notify.mobile_app
    data:
      title: "Solar Report"
      message: >
        Today's solar: {{ states('sensor.solar_energy_today')}} kWh
        Self-consumed: {{ states('sensor.self_consumed_today')}} kWh
        Exported: {{ states('sensor.grid_export_today')}} kWh
        Grid imported: {{ states('sensor.grid_import_today')}} kWh
        Forecast was: {{ states('sensor.energy_production_today')}} kWh
        Tomorrow forecast: {{ states('sensor.energy_production_tomorrow')}} kWh

Pro Tips for Solar + Home Assistant

Create a Solar Surplus Sensor

Add a template sensor that calculates solar_production - home_consumption. Positive means surplus (free energy available), negative means you are pulling from the grid. This one sensor powers most solar automations.

Use the Riemann Sum Helper

If your inverter only gives instantaneous power (watts) but the Energy Dashboard needs cumulative energy (kWh), use HA's Riemann Sum integral helper to convert. Settings > Helpers > Create > Integration (Riemann Sum).

Go Local When Possible

Cloud APIs have rate limits and latency. If your inverter supports Modbus TCP or a local API, always prefer that. Your automations will respond in seconds instead of minutes.

Track Individual Devices

Put smart plugs with energy monitoring on your biggest consumers (EV charger, heat pump, dryer, oven). The Energy Dashboard can show exactly where your energy goes and what runs on solar vs grid power.

Calibrate Forecast.Solar

After a few weeks, compare predicted vs actual production. Adjust the damping factor until forecasts are within 10 to 15% of reality. Trees, nearby buildings, and dirty panels all reduce real output compared to the theoretical model.

Use Dynamic Electricity Pricing

Integrations like Tibber, Octopus Energy, or Nordpool give you hourly electricity prices. Combine with solar forecast data to make smart charging decisions: charge the battery when prices dip, discharge when they spike.

Getting Started: Your Solar + HA Weekend Plan

Saturday Morning

Connect Your Inverter

Install the integration for your inverter brand. If it supports local (Modbus/API), connect via Ethernet first. Verify you see production data in HA entities.

Saturday Afternoon

Set Up Energy Dashboard

Configure the Energy Dashboard with your solar, grid, and (if applicable) battery sensors. Add Forecast.Solar. Set your electricity rate. Let it collect data overnight.

Sunday Morning

Build Your First Automation

Create the solar surplus template sensor. Set up the washing machine or EV charger automation. Test it during peak production hours.

Sunday Afternoon

Add Device Tracking

Put smart plugs on your biggest energy consumers. Add them to the Energy Dashboard. Set up the daily production report notification. Sit back and watch the data flow.

Frequently Asked Questions

Can Home Assistant track solar panel production?

Yes. Home Assistant has built-in solar energy tracking in the Energy Dashboard. Connect your inverter integration and HA shows real-time production, daily totals, and historical graphs. You can also add Forecast.Solar to predict tomorrow's production based on your panel setup and weather.

Which solar inverters work with Home Assistant?

Most major brands have integrations. SolarEdge, Enphase, Fronius, Huawei FusionSolar, SMA, GoodWe, Growatt, Solis, APsystems, and Victron all have official or HACS integrations. If your inverter is not directly supported, you can read data via Modbus TCP, MQTT, or a CT clamp energy monitor like the Shelly 3EM.

How do I maximize solar self-consumption with Home Assistant?

Use automations that shift heavy loads to peak solar hours. Run your washing machine, dishwasher, EV charger, or heat pump when production exceeds household consumption. Add a battery to store excess for evening use. The Energy Dashboard shows your self-consumption rate so you can track progress.

What is Forecast.Solar and does it cost money?

Forecast.Solar is a service that predicts your solar production for the next 24 to 48 hours based on your panel configuration and weather. The free tier works great for most people (updates every 60 minutes). Paid plans ($3 to $8/month) offer faster updates and longer forecast horizons.

Can I control a home battery with Home Assistant?

Many battery systems support control through Home Assistant. Huawei Luna 2000, Victron, and some SolarEdge setups allow you to set charging modes (force charge, self-consumption, time-of-use). Tesla Powerwall and Enphase batteries show state data but have more limited control options.

My inverter is not on the supported list. What can I do?

Three options. First, check HACS for community integrations since many niche brands are supported there. Second, if your inverter supports Modbus TCP or RS485, you can use the generic Modbus integration with the right register addresses (check your inverter manual or community forums). Third, put a CT clamp energy monitor (Shelly 3EM, Emporia Vue, or Iotawatt) on your solar feed and grid connection. This works with any inverter since it reads the actual wire, not the inverter software.

How much money can I save with solar automations?

That depends on your system size, electricity rates, and consumption patterns. A typical 5 kWp system in a moderate climate produces around 5,000 kWh per year. Without automations, self-consumption is typically 30 to 40%. With smart load shifting and a battery, you can push that to 70 to 90%. At $0.30/kWh, the difference between 35% and 75% self-consumption on 5,000 kWh production is roughly $600/year in extra savings.

Ready to Make Your Solar Panels Smarter?

Run our free scan to see which of your smart home devices work with Home Assistant, then start building automations that follow the sun.

Free Smart Home Scan Energy Monitoring Guide