This blueprint is the decision brain for a dynamic-tariff battery setup: it charges your home battery when electricity is cheap and runs the house off it when it’s expensive.
Every 5 minutes and on each price update it decides:
- charge when the current price is at/below your cheap threshold
- discharge when it’s at/above your expensive threshold
- idle in between (the gap is a hysteresis band, so it doesn’t flap)
- optional SoC guards: won’t charge past a ceiling, keeps a reserve floor
It’s battery-neutral: plug your own charge / discharge / idle actions into three inputs, so it works with Anker Solix, Marstek, Victron, Sonnen — the brain decides, your actions execute. Works with any price sensor (Nord Pool, Tibber, aWATTar, EPEX, …).
This is the accessible core. I run a smarter version at home (cheapest-hours planning that covers learned demand, solar forecast, a 48h replan and self-healing for flaky cloud hardware) — documented as a beginner-friendly field report, linked in my project thread. Feedback very welcome!