EV-05: car Solar mode (spare sun to the car, Batteries or Car first, cut first for the peak)
Solar charges the car from the signed spare sun (car + battery charge - grid import), less the batteries' room (Batteries first) and the sun kept back, whole amps rounded down, at most one change per 30 s and only on 1 A. It starts after ev_start_min of enough sun, holds 6 A for ev_pause_min, then 0 A. Auto phases through EV-04's safe sequence (4.5 kW / 3 min up, 4.0 kW / 5 min down, one switch per 10 min). What the peak guard would ask the batteries for is taken off the car first, at once. Every way out of Solar ends at 0 A, written once; at shutdown before the inverters go to 0 W. - app/carmode.py: SolarPlan (pure) and SolarWriter (ManualWriter's one write site, its sequence and watch); spare_w, car_target_w, amps_for. - app/ctl_car.py: Solar inputs, the cut, the solar kWh, EV-15's grace for Solar's own 0 A, no "set by the car" for Solar; main.py: shutdown order. - Home card, HA select.goodwe_car_sun_first, sensor car_today_solar_kwh, three options with defaults, strings EN/NL, DOCS, DECISIONS, CHANGELOG. - test_ev05.py, test_ev05_long.py, tools/ev05_sun.py; test_ev03/ev04 checks that pinned "Solar is refused" / "three entities" updated. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -160,8 +160,9 @@
|
||||
$("#car-why").textContent = c.why;
|
||||
renderCarControls(c);
|
||||
}
|
||||
// EV-04: Off and Manual. The mode and the phases send at once; the current
|
||||
// sends after two seconds of rest. A slider being dragged is left alone.
|
||||
// EV-04: Off and Manual; EV-05: Solar and where its spare sun goes first.
|
||||
// The mode, the phases and the choice send at once; the current sends after
|
||||
// two seconds of rest. A slider being dragged is left alone.
|
||||
let carTouch = 0, carTimer = null, carBusy = false;
|
||||
async function carAct(what, value) {
|
||||
if (carBusy) return;
|
||||
@@ -182,6 +183,13 @@
|
||||
type: "button", role: "radio", "aria-checked": String(c.mode === m),
|
||||
onclick: () => carAct("car_mode", m) }, t("car.mode_" + m))));
|
||||
$("#car-help").textContent = t("car.help_" + c.mode + ".description") || "";
|
||||
const sol = c.mode === "solar" && !!c.first;
|
||||
$("#car-solar").hidden = !sol;
|
||||
if (sol) {
|
||||
$("#car-first").replaceChildren(...c.first.choices.map((f) => h("button", {
|
||||
type: "button", role: "radio", "aria-checked": String(c.first.value === f),
|
||||
onclick: () => carAct("car_sun_first", f) }, t("car.first_" + f))));
|
||||
}
|
||||
const on = c.mode === "manual" && !!c.current;
|
||||
$("#car-manual").hidden = !on;
|
||||
if (!on) return;
|
||||
|
||||
@@ -52,6 +52,11 @@
|
||||
<div class="small car-lab" data-t="car.phases"></div>
|
||||
<div class="seg" role="radiogroup" id="car-phases" data-t-label="car.phases"></div>
|
||||
</div>
|
||||
<div id="car-solar" hidden>
|
||||
<div class="small car-lab" data-t="car.first"></div>
|
||||
<div class="seg" role="radiogroup" id="car-first" data-t-label="car.first"></div>
|
||||
<p class="tiny muted" style="margin:6px 0 0" data-t="car.first_help.description"></p>
|
||||
</div>
|
||||
<div class="car-why small"><span class="muted" data-t="car.why"></span><span id="car-why"></span></div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user