diff --git a/goodwe_controller/test_ev19.py b/goodwe_controller/test_ev19.py index 57ca96e..5aaa015 100644 --- a/goodwe_controller/test_ev19.py +++ b/goodwe_controller/test_ev19.py @@ -184,6 +184,35 @@ for d, want in ((STILL - 10.0, True), (STILL + 10.0, False)): f"cycle: {'still, the rise is not yet house (explained)' if want else 'moved, the rise counts as house (not explained, as base)'}", ud.get(1) is want and ud.get(0) is True) +# Review round 2: the blind band in absolute W (the owner's 50 W; change this +# check with the owner). An honest step at E+5 (house aim - 500 -> aim + 1 900 +# W, more than the car) with one burst that leaves the meter's house side +# moving d W: at |d| = 60 the alarm cycle is base's (E+5); inside the band +# (d = 0) the car explains at most the step's own cycle, never from E+6. +for dd in (60.0, -60.0, 0.0): + hb = (lambda t: AIM - 500.0 if t < 5 else AIM + 1900.0) + bd = (lambda t, B=2400.0 - dd: B if t == 5 else 0.0) + ubd = urun(range(0, 15), lambda t, hb=hb, bd=bd: hb(t) + CAR - bd(t), bd) + print(f" band d={dd:+.0f} W E+4..E+8: {run_of(ubd, 4, 8)}") + t0 = 5 if dd else 6 + check(f"band: an honest step whose burst moves the meter's house side " + f"{dd:+.0f} W: not explained from E+{t0}", + ubd.get(4) is True and not any(run_of(ubd, t0, 14)) + and len(run_of(ubd, t0, 14)) == 15 - t0) + +# Review round 2: the stillness test uses the house side (held - car). The car +# steps 1 380 -> 2 760 W, the house aim - 500 -> aim + 3 000 W (more than the +# car) and b gives one reading of 4 880 W, all at E+5, meter in step: the +# meter's total stays, its house side drops 1 380 W, so nothing is discounted. +hc = (lambda t: AIM - 500.0 if t < 5 else AIM + 3000.0) +wc = (lambda t: CAR if t < 5 else 2 * CAR) +bc5 = (lambda t: 4880.0 if t == 5 else 0.0) +ucw = urun(range(0, 15), lambda t: hc(t) + wc(t) - bc5(t), bc5, w=wc) +check("car term: the car steps up with the house and a burst, the meter's " + "total still: not explained from E+5 (as base)", + ucw.get(4) is True and not any(run_of(ucw, 5, 14)) + and len(run_of(ucw, 5, 14)) == 10) + # Review round 1 (mC): EV-18's `_car_over_now` keeps the reading as it is. b # gives 2 000 W, the house alone with it lands under the aim and the period # with the car too, so nothing explains; b rises to 4 000 W at E+5 one cycle