From d13c4e51c51c029d22cb0b59d69547c5b8b1096f Mon Sep 17 00:00:00 2001 From: Thomas Ziegler Date: Sun, 13 Feb 2022 10:02:20 +0100 Subject: [PATCH] Fix Power sensor --- custom_components/mypv/sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/mypv/sensor.py b/custom_components/mypv/sensor.py index 9b5abd3..039b777 100644 --- a/custom_components/mypv/sensor.py +++ b/custom_components/mypv/sensor.py @@ -57,9 +57,9 @@ def state(self): try: state = self.coordinator.data[self._data_source][self.type] if self.type == "power_act": - relOut = self.coordinator.data[self._data_source]["rel1_out"] - loadNom = self.coordinator.data[self._data_source]["load_nom"] - state = (relOut * loadNom) + state + relOut = int(self.coordinator.data[self._data_source]["rel1_out"]) + loadNom = int(self.coordinator.data[self._data_source]["load_nom"]) + state = (relOut * loadNom) + int(state) self._last_value = state except Exception as ex: _LOGGER.error(ex)