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

Hello Henrik,
Is it possible to start a automation instead of switching on a power plug switch for a given appliance? My dishwasher and boiler have a HA integration and can be controlled within HA.

Thanks and sorry for the late reply.
I configured my 2 EV’s and a heatpump

I will do some testing and let you know.

Hello. I’m totally new to Home Assistant and trying to figure things out. Would your automation work with Powerwall 3? I have Teslemetry installed.

Woah, this is awesome, thank you!

Quick question: Does this support the enphase encharge battery? I don’t believe there is an API endpoint to control charging / discharging. I only have the ability to change the battery mode between “Full Backup,” “Self Consumption,” and “Savings,” as well as the reserve battery level.

Currently I have this integration configured for solar only.

Hi Henrik, I am struggling to switch of a large consumer based on power drawn from the battery. I set the battery discharge limit to 1000 W but even if the battery discharge is above 2000 W for a long time the appliance is only shed, when the battery SOC limit is reached.

2nd question, my plan always shows the same 5 entries (just updates the date) and a confidence of 88%. The first appliance has a minimum run time defined, but that is reached every day before midnight.
Looking at the debug log it shows the value of solcast tomorrow = 0. Solcast tomorrow in developer tools has meaningful data.

Any indications?

state_class: measurement
plan_entries: 
- appliance_id: 01KPE5PR8NZJ73T5HVHJMGVGMA
  action: 'on'
  reason: deadline
  window_start: '2026-04-28T00:00:00+02:00'
  window_end: '2026-04-28T06:00:00+02:00'
- appliance_id: 01KPE5PR8NZJ73T5HVHJMGVGMA
  action: 'on'
  reason: deadline
  window_start: '2026-04-28T06:00:00+02:00'
  window_end: '2026-04-28T07:00:00+02:00'
- appliance_id: 01KPE5PR8NZJ73T5HVHJMGVGMA
  action: 'on'
  reason: deadline
  window_start: '2026-04-28T07:00:00+02:00'
  window_end: '2026-04-28T08:00:00+02:00'
- appliance_id: 01KPE5PR8NZJ73T5HVHJMGVGMA
  action: 'on'
  reason: deadline
  window_start: '2026-04-28T08:00:00+02:00'
  window_end: '2026-04-28T09:00:00+02:00'
- appliance_id: 01KPE5H1CQDD5V6E6A4NCZBSKD
  action: 'on'
  reason: excess_available
  window_start: '2026-04-28T12:00:00+02:00'
  window_end: '2026-04-28T13:00:00+02:00'

plan_entry_count: 5
unit_of_measurement: %
friendly_name: PV Excess Control Plan Confidence

I was using your blueprints for a while and ended adding the algorithm as an option to the solar_optimizer plugin, so it reuses the rest of the plugin, dashboards, config,…

I have a 10kW Inverter with 17kW Panels and a low export limit of 6,1kW. Is it possible to configure appliances to only run with excess power that would otherwise be curtailed? Just setting the activation buffer to 6100W doesn’t seem like a clean solution.
Thanks

wow, this looks awesome! i used your old pyscript version for a bit, but honestly the config was a pain. really like that it’s all UI no’ve got a similar setup (solar + battery, tracking everything with nuwatt), so this should make managing excess way easier. will give it a try soon—thanks for all the work!

Does your new optimizer handle curtailment? (is this what teri was asking.)
My retailer instructs my inverter to curtail export to 0kW when 5 minutely feed-in prices go negative (happens for part of most days other than during winter), so automations which aim to harvest excess solar fail if they are based on exports (i’m looking at you Wattpilot Eco mode).
PV 12kW, Inverter Fronius Primo Gen24 10.0, Battery BYD 5.1kWh, EV charger Wattpilot, EV Ioniq

Just a short way from giving up on Home Assistant (as I am not an IT person and am easily confused by technical jargon and a lack of clear instructions), I found your app, managed to install it and configure it to switch on/off smart plugs depending on PV power availability. Great!
However, I do have two PV systems, in separate buildings and with separate devices to switch. So far, your app works for one of them. In your documentation, you wrote “For completely separate systems (e.g. a main house and a guest house), add multiple PV Excess Control integration entries. Each instance manages its own set of appliances independently.”
How do I do this? When I click on “Add entry”, I get “PV Excess Control is already configured” and the “+” sign seems to only add a device to be controlled by the current instance.

Hi Henrik,

First off — huge thanks for picking development back up. I've been a heavy user of the original pyscript blueprint and built a fairly elaborate orchestration layer around it. Let me share my setup and the three concrete things that would push me to migrate, in case it's useful for your roadmap.

My setup

  • Charge Amps Luna wallbox (OCPP 1.6, firmware 2.0.1)
  • FoxESS H3-Pro hybrid inverter + battery
  • Kia EV9
  • Octopus Go night tariff (cheap window 00:00–05:00)
  • Predbat for night-slot scheduling and tariff optimization
  • Solcast for PV forecasting
  • Two parallel pv_excess_control instances (1-phase / 3-phase) gated by an input_boolean, coordinated by a central input_select state machine (idle / pv_1p / pv_3p / boost / phase_switch / cleanup) with a watchdog for deadlock recovery.

It works really well now — but it took a lot of iteration, and the integration would need to cover three things before I'd dismantle it:

1. Seamless phase switching via OCPP SetChargingProfile

The Charge Amps Luna (and other modern OCPP wallboxes) supports changing numberPhases mid-transaction via SetChargingProfile, with no Stop/Start cycle. This matters because Stop→Switch→Start triggers a spurious "charging interrupted" notification on the Kia (and probably others), and forces a re-handshake. A native path for OCPP-based phase switching — or at minimum a clean hook (event/service) where an external automation can perform the phase change while the optimizer just reports "phase change requested" — would be a game changer.

2. Coexistence with external planners (Predbat, EMHASS, etc.)

Your 24h forward-looking planner is a great feature, but for users who already run Predbat or similar, it's a "two captains on one ship" problem (@RienduPre touched on this above re: Tibber Grid Rewards). A clear reactive-only mode — or per-appliance opt-out from planning — would let us keep the existing planner for night-tariff boost charging and use the integration purely as the daytime PV-excess controller. Right now I'd have to either disable Predbat's car logic or disable your planner, and either way I lose value.

3. Exposed decision state per appliance

For coordination with external systems (dashboards, notifications, dependent automations), an input_select-style state or attribute per appliance reflecting the current decision — e.g. pv_1p, pv_3p, off_low_excess, off_battery_priority, external_override, planned_charge — would let users build coordination layers cleanly without scraping logs or inferring from current setpoints. My whole architecture revolves around exactly this kind of central state, and it's the part I'd hate to lose.

Thanks again for the work — really hope this is useful feedback rather than a wishlist. Happy to test or open issues on GitHub for any of the above if you'd like.

Cheers

Thanks for this - definitely prefer integration to pyscript so I've transferred over.

How long does the 'learning' period take?
Although set to 'balanced' it's not starting my pool until the battery is 100%. Still had 11kWh excess solar exported to grid, which was in line with the forecast, so not sure why the pool didn't start earlier?

Using Solcast if that matters.

Worked out the issue - I’ve submitted a pull request with the changes that should sort it out.

Thanks!