From 41e2176360fffc0ae92f711c6fc9f93ade50a659 Mon Sep 17 00:00:00 2001 From: Krisjanis Lejejs Date: Sun, 25 Dec 2022 19:50:25 +0200 Subject: [PATCH] Add additional operational status sensors --- custom_components/thermia/const.py | 1 + custom_components/thermia/sensor.py | 193 ++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+) diff --git a/custom_components/thermia/const.py b/custom_components/thermia/const.py index 3bfeb3f..13f58b8 100644 --- a/custom_components/thermia/const.py +++ b/custom_components/thermia/const.py @@ -9,5 +9,6 @@ API_TYPE = "api_type" API_TYPES = [API_TYPE_CLASSIC, API_TYPE_GENESIS] +MDI_INFORMATION_OUTLINE_ICON = "mdi:information-outline" MDI_TIMER_COG_OUTLINE_ICON = "mdi:timer-cog-outline" MDI_TEMPERATURE_ICON = "mdi:thermometer" diff --git a/custom_components/thermia/sensor.py b/custom_components/thermia/sensor.py index 6d414db..fe2a38e 100644 --- a/custom_components/thermia/sensor.py +++ b/custom_components/thermia/sensor.py @@ -13,6 +13,7 @@ from .const import ( DOMAIN, + MDI_INFORMATION_OUTLINE_ICON, MDI_TEMPERATURE_ICON, MDI_TIMER_COG_OUTLINE_ICON, ) @@ -239,6 +240,198 @@ async def async_setup_entry( ) ) + if heat_pump.operational_status_auxiliary_heater_3kw is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Auxiliary Heater 3KW", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_auxiliary_heater_3kw", + None, + ) + ) + + if heat_pump.operational_status_auxiliary_heater_6kw is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Auxiliary Heater 6KW", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_auxiliary_heater_6kw", + None, + ) + ) + + if heat_pump.operational_status_auxiliary_heater_9kw is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Auxiliary Heater 9KW", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_auxiliary_heater_9kw", + None, + ) + ) + + if heat_pump.operational_status_auxiliary_heater_12kw is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Auxiliary Heater 12KW", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_auxiliary_heater_12kw", + None, + ) + ) + + if heat_pump.operational_status_auxiliary_heater_15kw is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Auxiliary Heater 15KW", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_auxiliary_heater_15kw", + None, + ) + ) + + if heat_pump.operational_status_compressor_status is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Compressor Status", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_compressor_status", + None, + ) + ) + + if heat_pump.operational_status_brine_pump_status is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Brine Pump Status", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_brine_pump_status", + None, + ) + ) + + if heat_pump.operational_status_radiator_pump_status is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Radiator Pump Status", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_radiator_pump_status", + None, + ) + ) + + if heat_pump.operational_status_cooling_status is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Cooling Status", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_cooling_status", + None, + ) + ) + + if heat_pump.operational_status_hot_water_status is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Hot Water Status", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_hot_water_status", + None, + ) + ) + + if heat_pump.operational_status_heating_status is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Heating Status", + MDI_INFORMATION_OUTLINE_ICON, + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_heating_status", + None, + ) + ) + + if heat_pump.operational_status_integral is not None: + hass_thermia_sensors.append( + ThermiaGenericSensor( + coordinator, + idx, + "is_online", + "Integral", + "mdi:math-integral", + EntityCategory.DIAGNOSTIC, + None, + "measurement", + "operational_status_integral", + None, + ) + ) + ########################################################################### # Operational time data ###########################################################################