diff --git a/custom_components/ocpp/api.py b/custom_components/ocpp/api.py index 1e5aa482..a9f5b124 100644 --- a/custom_components/ocpp/api.py +++ b/custom_components/ocpp/api.py @@ -966,6 +966,12 @@ def on_status_notification(self, connector_id, error_code, status, **kwargs): self._metrics[Measurand.power_active_import.value].value = 0 if Measurand.power_reactive_import.value in self._metrics: self._metrics[Measurand.power_reactive_import.value].value = 0 + if Measurand.current_export.value in self._metrics: + self._metrics[Measurand.current_export.value].value = 0 + if Measurand.power_active_export.value in self._metrics: + self._metrics[Measurand.power_active_export.value].value = 0 + if Measurand.power_reactive_export.value in self._metrics: + self._metrics[Measurand.power_reactive_export.value].value = 0 self._metrics[cstat.error_code.value].value = error_code self.hass.async_create_task(self.central.update(self.central.cpid)) return call_result.StatusNotificationPayload() @@ -1020,6 +1026,12 @@ def on_stop_transaction(self, meter_stop, timestamp, transaction_id, **kwargs): self._metrics[Measurand.power_active_import.value].value = 0 if Measurand.power_reactive_import.value in self._metrics: self._metrics[Measurand.power_reactive_import.value].value = 0 + if Measurand.current_export.value in self._metrics: + self._metrics[Measurand.current_export.value].value = 0 + if Measurand.power_active_export.value in self._metrics: + self._metrics[Measurand.power_active_export.value].value = 0 + if Measurand.power_reactive_export.value in self._metrics: + self._metrics[Measurand.power_reactive_export.value].value = 0 self.hass.async_create_task(self.central.update(self.central.cpid)) return call_result.StopTransactionPayload( id_tag_info={om.status.value: AuthorizationStatus.accepted.value}