diff --git a/custom_components/sinapsi_alfa/api.py b/custom_components/sinapsi_alfa/api.py index 7042409..5e8783e 100644 --- a/custom_components/sinapsi_alfa/api.py +++ b/custom_components/sinapsi_alfa/api.py @@ -249,7 +249,7 @@ def read_modbus_alfa(self): _LOGGER.debug( f"(read_modbus_alfa) Key: {reg_key} Addr: {reg_addr} Type: {reg_type} DevClass: {reg_dev_class}" ) - if reg_type == "calculated": + if reg_type == "calcolato": self.data["potenza_auto_consumata"] = ( self.data["potenza_prodotta"] - self.data["potenza_immessa"] ) diff --git a/custom_components/sinapsi_alfa/const.py b/custom_components/sinapsi_alfa/const.py index 9db578f..2effb62 100644 --- a/custom_components/sinapsi_alfa/const.py +++ b/custom_components/sinapsi_alfa/const.py @@ -280,7 +280,7 @@ "device_class": SensorDeviceClass.POWER, "state_class": SensorStateClass.MEASUREMENT, "unit": UnitOfPower.KILO_WATT, - "modbus_type": "calculated", + "modbus_type": "calcolato", "modbus_addr": None, }, { @@ -290,7 +290,7 @@ "device_class": SensorDeviceClass.POWER, "state_class": SensorStateClass.MEASUREMENT, "unit": UnitOfPower.KILO_WATT, - "modbus_type": "calculated", + "modbus_type": "calcolato", "modbus_addr": None, }, { @@ -300,7 +300,7 @@ "device_class": SensorDeviceClass.ENERGY, "state_class": SensorStateClass.TOTAL_INCREASING, "unit": UnitOfEnergy.KILO_WATT_HOUR, - "modbus_type": "calculated", + "modbus_type": "calcolato", "modbus_addr": None, }, { @@ -310,7 +310,7 @@ "device_class": SensorDeviceClass.ENERGY, "state_class": SensorStateClass.TOTAL_INCREASING, "unit": UnitOfEnergy.KILO_WATT_HOUR, - "modbus_type": "calculated", + "modbus_type": "calcolato", "modbus_addr": None, }, ]