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:
@@ -253,6 +253,7 @@ class CycleMixin:
|
||||
|
||||
stale_after = float(self.o.get("stale_input_s", 15))
|
||||
late_s = self._readings_late(site_standing) # SAFETY-128
|
||||
self._car_late_s = late_s # EV-05: Solar holds, then the stale rule
|
||||
self._late_zero = late_s is not None and late_s >= stale_after
|
||||
# ⚠️ `any`, NOT the sole unit's. The hold exists so a single missed
|
||||
# poll does not become a fault; a LATCHED inverter must still reach the
|
||||
@@ -272,6 +273,7 @@ class CycleMixin:
|
||||
# this cycle's. (DECISIONS/MAIN-orchestration-archive.md)
|
||||
self.why_words = messages.why_waiting(bad_for)
|
||||
self._why_waiting_since = now - timedelta(seconds=bad_for)
|
||||
self._car_hold_kick() # EV-05: Solar counts from now
|
||||
return
|
||||
if late_s is not None and late_s < stale_after and self.inputs_ok \
|
||||
and (self.auto or self.shadow) \
|
||||
@@ -279,6 +281,7 @@ class CycleMixin:
|
||||
and not (n_units > 1 and self.site_sign_wd.tripped):
|
||||
self.reason = f"readings late {late_s:.0f}s" # SAFETY-128: hold
|
||||
self.why_words = messages.why_late()
|
||||
self._car_hold_kick() # EV-05: Solar holds its current
|
||||
return
|
||||
|
||||
claims = []
|
||||
@@ -1065,7 +1068,8 @@ class CycleMixin:
|
||||
await self.check_price_gap()
|
||||
await self.check_charger()
|
||||
await self.check_car_over()
|
||||
self.car_kick() # EV-04: Manual, in the background
|
||||
await self.check_car_error() # EV-05: Solar's charger error
|
||||
self.car_kick() # EV-04/05: in the background
|
||||
await self.check_fixed_note()
|
||||
|
||||
# SAFETY-31's alarm, and its boundary is the LATCH, not a number: it
|
||||
|
||||
Reference in New Issue
Block a user