☀️ PV Excess Control: Solar Excess Optimizer as a HACS Integration (successor of the pyscript blueprint)

Hi everybody,

Some of you may know my old PV Solar Excess Optimizer blueprint - a pyscript + blueprint combo that automatically switches your appliances on and off based on excess solar power.

After a long break I finally picked development back up and rebuilt the whole thing from the ground up as a proper HACS integration.

GitHub: GitHub - InventoCasa/PV-Excess-Control: Solar excess power appliance control for Home Assistant · GitHub

No more pyscript, no more copying files into config/, no more YAML wrangling. Everything is configured through a real config flow UI.


What it does

PV Excess Control is a comprehensive Home Assistant integration for intelligent solar excess power optimization and cheap grid tariff management. It looks at your live PV / battery / grid sensors, your solar forecast and your electricity tariff, and decides - every 30 seconds - which of your appliances should be on, off, or running at what current.

Think of it as the brain that sits between your inverter and your wallbox / heatpump / dishwasher / heat rod / pool pump / … and makes sure as much sun as possible goes into your devices instead of being exported for cents.


Highlights

  • :electric_plug: Priority-based appliance control - prioritize multiple appliances (1–1000), the optimizer allocates excess top-down

  • :zap: Dynamic current control for EV chargers / wallboxes (6–32 A, 1- and 3-phase)

  • :battery: Battery-aware optimization with three strategies: Battery First, Appliance First, Balanced

  • :moneybag: Tariff integration - Tibber, Awattar, Nordpool, Octopus Energy and generic price sensors

  • :sun_behind_small_cloud: Solar forecast integration - Solcast, Forecast.Solar and generic forecast sensors

  • :brain: 24-hour forward-looking planner - weather-aware pre-planning with configurable plan influence (reactive, forecast-biased, or schedule-driven)

  • :no_entry_sign: Export limit management - absorbs would-be-curtailed power when feed-in caps apply

  • :red_car: EV SoC-aware charging - considers EV battery level, connection status and “must be charged by” deadlines

  • :shield: Battery discharge protection - limits battery discharge when big consumers are running

  • :chart_with_upwards_trend: Self-consumption analytics - savings, self-consumption ratio, daily / monthly statistics

  • :bell: Configurable notifications - per-event toggles for appliance changes, summaries, warnings

  • :desktop_computer: Extensive dashboard examples - ready-to-use YAML for Mushroom, ApexCharts, power-flow-card-plus and more

  • :raised_hand: Manual override, min/max runtime constraints, time windows, grid supplementation, appliance dependencies, per-appliance averaging window, minimum battery SoC protection … and more

Full feature list and docs in the README.


Requirements

  • Home Assistant 2025.8 or newer

  • A solar inverter with power sensors exposed to Home Assistant (standard or hybrid)

  • HACS for the recommended installation method


Installation

  1. Open HACS → three-dot menu → Custom repositories

  2. Add https://github.com/InventoCasa/PV-Excess-Control as an Integration

  3. Search for PV Excess Control and click Download

  4. Restart Home Assistant

  5. Settings → Devices & Services → Add Integration → PV Excess Control

That’s it. The config flow walks you through inverter type (standard / hybrid), sensor mapping, tariff provider, forecast provider, and then you start adding your appliances one by one.


Architecture (for the curious)

Under the hood, the integration uses a hybrid real-time + planning approach:

  • Real-time controller (every 30 s): reads live sensor data and applies optimizer decisions

  • Forward-looking planner (every 15 min): builds optimal 24-hour schedules from forecast + tariff data

  • Pure-logic optimizer: decision engine

The optimizer is structured around four phases: ASSESS (average excess from history buffer), ALLOCATE (assign excess to appliances by priority), SHED (turn off lowest-priority when excess is negative), and BATTERY DISCHARGE PROTECTION.


Feedback welcome

<<< Currently the integration is in beta state, so expect some bugs! >>>

If you find any bugs (or have some feature ideas), please create an issue on GitHub.

1 Like

Good! Thank you! I use the previous version and made one modification, because when the battery is full and there is no consumption the solar production is low even when the sun is shining. So my modification is to monitor the voltage of the strings - this can indicate that there is not consumed production. In this way the Excess automation can power up the device even when the reported solar production is low due the lack of consumption. It will be nice to have this in the new PC Excess Control. Here is my fork

What you could do is configure the optimizer to schedule your appliances strictly according to plan (meaning that they will be switched on/off according to the solar forecast

At the moment it is configurable in the initial config flow of the integration. If I expose a select entity so you can switch the optimizer modes during runtime, I guess this would cover your use case?