Smart Energy Arbitrage System (Octopus Energy + Enphase + Solcast)

Hey everyone! I wanted to share a comprehensive, fully automated energy management system I built for Home Assistant. I’m new to Home Assistant, so I’m learning as I go, I’ve been using Home assistant for about a month so far. This is my first project and I’ve used rather a lot of AI to help with maths, yaml etc, I know what I want and i have some programming experience, but not HA/YAML. As I’m new to this and there’s lots of AI gone into it, I have to say there is certainly a non 0 chance there’s errors, logic issues, missing dependencies in my list etc.

If you are based in the UK on an Octopus Energy dynamic tariff (like Agile, Intelligent, or Flux) and have an Enphase solar/battery ecosystem, this setup is designed to completely automate your battery to maximize arbitrage profits and minimize grid imports.

Rather than just sharing complex YAML templates, I’ve converted the entire automation engine into a suite of Blueprints so it is incredibly easy to import and set up with your specific sensors.

:sparkles: Key Features:

  • Smart Peak Export: Automatically dumps battery power to the grid during the most profitable slots (e.g., 16:30-19:00) while dynamically holding back enough reserve to power your house through the evening based on historical load.
  • Predictive Grid Charging: Calculates if it is mathematically profitable to charge the battery overnight from the grid, based on tomorrow’s Solcast predictions and your specific battery Round Trip Efficiency (RTE).
  • Winter / Summer Modes: Dynamically adjusts battery reserve floors and evening consumption estimates based on the season.
  • EV Charging Failsafe: Hard blocks exporting when your EV is charging on a cheap rate (Octopus Intelligent GO for example).
  • Daily ROI Audits: Sends a detailed daily email breaking down your solar generation, peak avoidance savings, and net profit/loss.

:package: Prerequisites: You will need the following custom integrations installed via HACS:

  1. Octopus Energy Integration (by BottlecapDave)
  2. Solcast PV Forecast (by BJReplay)
  3. Native Enphase Envoy Integration
  4. hacs_enphase_envoy_cloud (by chinedu40)

:gear: How to Install: I’ve put together a full GitHub repository containing the Blueprints, the required helper variables (system_settings.yaml), the profit calculation templates, and a custom Lovelace Dashboard code.

:link: Get the files and read the setup guide on GitHub here

I’d love to hear your feedback or if you have any suggestions for improving the arbitrage logic! (But be gentle, I’m a newb and still don’t really know what I’m doing!)