diff --git a/goodwe_controller/app/main.py b/goodwe_controller/app/main.py index c35c1b5..0d25862 100644 --- a/goodwe_controller/app/main.py +++ b/goodwe_controller/app/main.py @@ -1040,14 +1040,15 @@ class Controller(InputsMixin, WritesMixin, TradeMixin, CycleMixin, AlarmsMixin, self.stopping = True _LOG.info(handback.log_shutdown(handback.current()) or "shutting down - commanding 0 W on every inverter") - if self.car_solar_engaged(): - # EV-05: Solar's fail state is 0 A, and it goes out BEFORE the - # inverters go to 0 W (bounded by `ctl_car.RELEASE_WAIT_S`). + # EV-05: Solar's fail state is 0 A, and it goes out BEFORE the + # inverters go to 0 W (bounded by `ctl_car.RELEASE_WAIT_S`). Manual + # keeps EV-04's order: the inverters first, then undo a phase change. + solar = self.car_solar_engaged() + if solar: + await self.car_shutdown() + await self.command_site_release() + if not solar: await self.car_shutdown() - await self.command_site_release() - else: - await self.command_site_release() - await self.car_shutdown() # EV-04: undo a phase change half way self.mqtt.close()