# HESC: a Node-RED flow that charges your EV the cheapest way, with sun and grid

**URL:** <https://discourse.nodered.org/t/hesc-a-node-red-flow-that-charges-your-ev-the-cheapest-way-with-sun-and-grid/101873>\
**Category:** Share Your Projects\
**Tags:** home-assistant\
**Created:** [8 October 2026 13:34 UTC](https://discourse.nodered.org/t/hesc-a-node-red-flow-that-charges-your-ev-the-cheapest-way-with-sun-and-grid/101873 "2026-10-08T13:34:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SatScan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/satscan/32/108542_2.png) [@SatScan](https://discourse.nodered.org/u/SatScan)\
**Post date:** [8 October 2026 13:34 UTC](https://discourse.nodered.org/t/hesc-a-node-red-flow-that-charges-your-ev-the-cheapest-way-with-sun-and-grid/101873/1 "2026-10-08T13:34:02Z")

</div>

Hi all,

I would like to share a flow I have been running at home for a few weeks: **Home EV Solar Control (HESC)**. It makes sure your EV has the charge you want at the time you want, charged the cheapest way, with sun and grid. It runs as a Node-RED flow next to a Home Assistant package (helpers and a dashboard), and is free and open source (GPL-3.0): [github.com/satscan1/home-ev-solar-control](https://github.com/satscan1/home-ev-solar-control)

**Why**  
At home two batteries are controlled by Home Battery Control (HBC) and the panels by Home PV Control (HPVC), both Node-RED projects as well. HPVC turns the panels down when exporting costs money, and that meant the wallbox in solar mode never saw a surplus. HESC started as the fix for that and has grown into a standalone flow that also works without HPVC, and even without solar panels.

**How the flow is built**  
The flow has four tabs:

- **Inputs:** a 30-second trigger and a startup safety check.
- **Engine:** the decisions: the solar release (with HPVC), the charge plan in the cheapest quarters, a price forecast for the hours without known prices, and, new in v1.4.0, a kickstart that lets the home battery and the car share the morning sun.
- **Outputs:** the only place that writes to Home Assistant, plus the history file.
- **Reports:** an HTML report and plain-language advice, built on demand, outside the evaluation cycle.

A few choices that may interest people here:

- HESC reads a fixed set of entities from the Home Assistant state cache in Node-RED. No API calls, and no copy of the full state table.
- It writes only when a value really changes, so the battery control running next to it is not disturbed.
- The history is kept as JSON lines in a file. No InfluxDB needed.
- **Shadow mode:** a new install evaluates and logs every decision, but writes nothing. You can see what it would do before you let it act.

**What you need**  
Node-RED with node-red-contrib-home-assistant-websocket (the Node-RED add-on already has it), Home Assistant with packages enabled, and an EV charger in Home Assistant with a solar or eco mode. For charging on sun: solar panels and a forecast in watts. For the charge plan: day-ahead prices.

**Chargers**  
HESC does not control the charger itself: it uses the solar mode the charger already has. Mappings are ready for Wallbox, Alfen, Peblar, Zappi, go-e, Wattpilot, SMA, Ohme and Easee, but **only the Wallbox Pulsar Plus has been tested in practice.** If you try another brand, please start in shadow mode and let me know how it goes.

Feedback on the flow itself is very welcome too. This is my first public Node-RED project, so I am sure there are things that could be done more neatly.

Also shared on the [Home Assistant Community](https://community.home-assistant.io/t/hesc-home-ev-solar-control-charge-your-ev-the-cheapest-way-with-sun-and-grid/1027740).

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [8 October 2026 14:53 UTC](https://discourse.nodered.org/t/hesc-a-node-red-flow-that-charges-your-ev-the-cheapest-way-with-sun-and-grid/101873/2 "2026-10-08T14:53:26Z")

</div>

In future, I'd just post Home Assistant projects in their community.

People here don't generally run HA

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 October 2026 00:16 UTC](https://discourse.nodered.org/t/hesc-a-node-red-flow-that-charges-your-ev-the-cheapest-way-with-sun-and-grid/101873/3 "2026-10-09T00:16:35Z")

</div>

> [@SatScan](#):
>
> Feedback on the flow itself is very welcome too. This is my first public Node-RED project, so I am sure there are things that could be done more neatly.

Probably would be helpful to let people know if this has regional/country limitations. Is it US only? EU? I think that many countries would have quite different requirements or interfaces?

---

<div class="post-metadata">

**Author:** ![SatScan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/satscan/32/108542_2.png) [@SatScan](https://discourse.nodered.org/u/SatScan)\
**Post date:** [9 October 2026 12:51 UTC](https://discourse.nodered.org/t/hesc-a-node-red-flow-that-charges-your-ev-the-cheapest-way-with-sun-and-grid/101873/4 "2026-10-09T12:51:11Z")

</div>

A bit more on the Node-RED side, since that’s probably the most interesting part for this forum.

The flow is deliberately light. It has no per-entity state nodes: it reads the entities it needs straight from the Home Assistant state cache that the websocket nodes already keep, runs on a single 30-second tick, and only writes back to Home Assistant when a value actually changes. Reports and advice are built on demand, outside that cycle. The whole thing is 12 function nodes over 4 tabs.

It was designed to run next to a battery controller without getting in its way. Happy to hear if there are neater ways to do any of this.

---

<div class="post-metadata">

**Author:** ![SatScan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/satscan/32/108542_2.png) [@SatScan](https://discourse.nodered.org/u/SatScan)\
**Post date:** [9 October 2026 12:52 UTC](https://discourse.nodered.org/t/hesc-a-node-red-flow-that-charges-your-ev-the-cheapest-way-with-sun-and-grid/101873/5 "2026-10-09T12:52:24Z")

</div>

Thanks both!

@cymplecy fair point. I posted here because most of the logic lives in the flow, but it’s also shared on the HA Community, so that’s where the HA side of the discussion will happen.

@TotallyInformation good question, I’ll add it to the README. In short:

- **Charging on sun** works anywhere: it only needs a solar forecast in watts (Solcast works worldwide) and a charger with a solar/eco mode in Home Assistant.
- **The charge plan** needs day-ahead prices per hour or quarter, in the format of the Nord Pool integration (`raw_today` / `raw_tomorrow`). That is common in Europe; fixed or time-of-use tariffs (typical in the US) are not supported yet.
- **The price forecast** starts with a default tuned to the Dutch market and then learns from your own price history after about two weeks.
- So far it has only been tested in the Netherlands, with one charger (Wallbox Pulsar Plus).
