From acba186dc7ecdd15e92de47ffb992935dbc6f6ec Mon Sep 17 00:00:00 2001 From: CSchlipp Date: Mon, 1 Apr 2024 21:25:11 +0200 Subject: [PATCH] Split Total/Total_Increasing sensors Split sensors again, as only total is allowed to have last_reset --- .../stiebel_eltron_isg/sensor.py | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/custom_components/stiebel_eltron_isg/sensor.py b/custom_components/stiebel_eltron_isg/sensor.py index 7382ae6..ae11479 100644 --- a/custom_components/stiebel_eltron_isg/sensor.py +++ b/custom_components/stiebel_eltron_isg/sensor.py @@ -319,10 +319,6 @@ def create_volume_stream_entity_description(name, key): ENERGY_SENSOR_TYPES = [ - create_daily_energy_entity_description( - "Produced Heating Today", - PRODUCED_HEATING_TODAY, - ), create_energy_entity_description( "Produced Heating Total", PRODUCED_HEATING_TOTAL, @@ -331,10 +327,6 @@ def create_volume_stream_entity_description(name, key): "Produced Heating", PRODUCED_HEATING, ), - create_daily_energy_entity_description( - "Produced Water Heating Today", - PRODUCED_WATER_HEATING_TODAY, - ), create_energy_entity_description( "Produced Water Heating Total", PRODUCED_WATER_HEATING_TOTAL, @@ -343,10 +335,6 @@ def create_volume_stream_entity_description(name, key): "Produced Water Heating", PRODUCED_WATER_HEATING ), - create_daily_energy_entity_description( - "Consumed Heating Today", - CONSUMED_HEATING_TODAY, - ), create_energy_entity_description( "Consumed Heating Total", CONSUMED_HEATING_TOTAL, @@ -355,10 +343,6 @@ def create_volume_stream_entity_description(name, key): "Consumed Heating", CONSUMED_HEATING, ), - create_daily_energy_entity_description( - "Consumed Water Heating Today", - CONSUMED_WATER_HEATING_TODAY, - ), create_energy_entity_description( "Consumed Water Heating Total", CONSUMED_WATER_HEATING_TOTAL, @@ -369,6 +353,25 @@ def create_volume_stream_entity_description(name, key): ), ] +ENERGY_DAILY_SENSOR_TYPES = [ + create_daily_energy_entity_description( + "Produced Heating Today", + PRODUCED_HEATING_TODAY, + ), + create_daily_energy_entity_description( + "Produced Water Heating Today", + PRODUCED_WATER_HEATING_TODAY, + ), + create_daily_energy_entity_description( + "Consumed Heating Today", + CONSUMED_HEATING_TODAY, + ), + create_daily_energy_entity_description( + "Consumed Water Heating Today", + CONSUMED_WATER_HEATING_TODAY, + ), +] + COMPRESSOR_SENSOR_TYPES = [ SensorEntityDescription( @@ -472,6 +475,14 @@ async def async_setup_entry(hass, entry, async_add_devices): entities.append(sensor) for description in ENERGY_SENSOR_TYPES: + sensor = StiebelEltronISGSensor( + coordinator, + entry, + description, + ) + entities.append(sensor) + + for description in ENERGY_DAILY_SENSOR_TYPES: sensor = StiebelEltronISGEnergySensor( coordinator, entry,