Skip to content

Commit

Permalink
Add additional operational status sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Dec 25, 2022
1 parent 8371d03 commit 41e2176
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/thermia/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
193 changes: 193 additions & 0 deletions custom_components/thermia/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from .const import (
DOMAIN,
MDI_INFORMATION_OUTLINE_ICON,
MDI_TEMPERATURE_ICON,
MDI_TIMER_COG_OUTLINE_ICON,
)
Expand Down Expand Up @@ -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
###########################################################################
Expand Down

0 comments on commit 41e2176

Please sign in to comment.