11# Home Assistant blueprint — Priority to EV
22
3- ## 1 – What it does
3+ ## What it does
44
55When an EV is plugged into a smart charger (MyEnergi Zappi, OpenEVSE,
66Wallbox Quasar, …) that already does its own surplus-following logic,
@@ -10,18 +10,18 @@ Router's water heater. This blueprint arbitrates between the two:
1010- When the surplus is * large enough for long enough* , it turns the
1111 Solar Router ** off** so the surplus is released to the grid, where
1212 the EV charger picks it up.
13- - When the EV is unplugged, a cloud starts pulling from the grid, or
14- the EV stops taking the surplus (car full, paused, or tapering
15- finished), it turns the Solar Router back ** on ** so the water heater
16- catches whatever remains.
13+ - When the EV is unplugged, a cloud cuts PV production and the house
14+ starts importing from the grid, or the EV stops taking the surplus
15+ (car full, paused, or tapering finished), it turns the Solar Router
16+ back ** on ** so the water heater catches whatever remains.
1717
1818The router firmware itself does ** not** talk to the EV charger — the
1919blueprint only toggles the router's ` Activate Solar Routing ` switch.
2020Everything else stays in the charger's own hands.
2121
22- ## 2 – Signals
22+ ## Signals
2323
24- ### 2a – Handoff (router ON → OFF)
24+ ### Handoff (router ON → OFF)
2525
2626```
2727surplus = max(0, -grid_power) + max(0, diverted_power)
@@ -37,7 +37,7 @@ The router is turned OFF when `surplus > EV_Charging_Minimum_Surplus`
3737holds continuously for ` surplus_duration_trigger ` seconds, provided
3838the EV is plugged in and (if a SoC sensor is set) still below target.
3939
40- ### 2b – Restore (router OFF → ON)
40+ ### Restore (router OFF → ON)
4141
4242Once the router is OFF and the EV is drawing on solar, the surplus
4343formula collapses to ~ 0: ` diverted_power = 0 ` because the router is
@@ -61,9 +61,9 @@ turning the router back ON at that instant would fight the EV for the
6161tail-end energy. The blueprint waits for `-grid_power >
6262release_export_threshold` — i.e. the car has actually stopped drawing
6363— to restore the router. The SoC target still gates new handoffs
64- (see [ 3 – Behavior] ( #3-- behavior ) ).
64+ (see [ Behavior] ( #behavior ) ).
6565
66- ## 3 – Behavior
66+ ## Behavior
6767
6868``` text
6969HANDOFF (router ON → OFF), when this stays true for surplus_duration_trigger s:
@@ -84,7 +84,7 @@ Crossing `ev_soc_target` freezes the handoff (no fresh router-OFF) but
8484does not by itself restore the router — the export threshold handles
8585that once the car actually stops drawing.
8686
87- ## 4 – Inputs
87+ ## Inputs
8888
8989| Input | Purpose | Default |
9090| --- | --- | ---: |
@@ -99,7 +99,7 @@ that once the car actually stops drawing.
9999| ` release_export_threshold ` | Export threshold for "EV done" detection in W | 200 |
100100| ` surplus_duration_trigger ` | Debounce for all three level triggers in s | 60 |
101101
102- ## 5 – Requirement: keep ` Real Power ` alive while the router is OFF
102+ ## Requirement: keep ` Real Power ` alive while the router is OFF
103103
104104Before this version, turning the ` Activate Solar Routing ` switch OFF
105105also stopped the meter polling and forced ` Real Power ` to ` NaN ` . The
@@ -110,11 +110,19 @@ keeps the native power meters polling continuously and no longer
110110publishes ` NaN ` on shutdown. No user action is required if you flash
111111the matching firmware version.
112112
113- ## 6 – A day in the life
113+ ## A day in the life
114114
115115Handoff threshold 1400 W, cloud & release thresholds 200 W each,
116116debounce 60 s.
117117
118+ ![ EV priority — typical day] ( images/priority_to_ev_day_en.png )
119+
120+ * Top strip: numbered events (see caption below the figure). Middle
121+ panel: PV production (yellow), household baseline + water heater + EV
122+ stacked; the blue outline is the total consumption. Bottom panel:
123+ signed grid exchange (import above zero, export below) and the
124+ dashed blueprint surplus curve plotted on the export side.*
125+
118126| Time | Situation | grid_power | diverted | Router | Action |
119127| :--- | :--- | ---: | ---: | :--- | :--- |
120128| 06:00 | Night ending, no PV | +300 (import) | 0 | ON idle | — |
@@ -127,7 +135,7 @@ debounce 60 s.
127135| 15:30 | EV self-stops on full, export stable > 60 s | ** −1500** | 0 | ** ON** | export release — router restored |
128136| 20:00 | EV unplugged | −200 | 100 | ON | — |
129137
130- ## 7 – Wiring an EV plug sensor (MyEnergi Zappi example)
138+ ## Wiring an EV plug sensor (MyEnergi Zappi example)
131139
132140If your charger only exposes a text status, wrap it in a template
133141binary sensor:
@@ -142,7 +150,7 @@ template:
142150 in ['EV Connected', 'Waiting for EV', 'Charging', 'Boosting', 'Complete'] }}
143151` ` `
144152
145- ## 8 – Installation
153+ ## Installation
146154
147155Import the blueprint into Home Assistant:
148156
@@ -153,7 +161,7 @@ Import the blueprint into Home Assistant:
153161Create an automation from the imported blueprint and fill in the
154162inputs.
155163
156- # # 9 – Edge cases
164+ # # Edge cases
157165
158166- **Brief cloud (< `surplus_duration_trigger` s)** — the router stays
159167 off; the debounce absorbs it.
0 commit comments