diff --git a/custom_components/ithodaalderop/binary_sensor.py b/custom_components/ithodaalderop/binary_sensor.py index 859ab63..7f7ad10 100644 --- a/custom_components/ithodaalderop/binary_sensor.py +++ b/custom_components/ithodaalderop/binary_sensor.py @@ -24,12 +24,11 @@ MQTT_STATETOPIC, NONCVE_DEVICES, ) -from .definitions import ( - AUTOTEMPBINARYSENSORS, - HRUECO350BINARYSENSORS, - HRUECOBINARYSENSORS, - IthoBinarySensorEntityDescription, -) +from .def_autotemp import AUTOTEMPBINARYSENSORS +from .def_cve import CVEBINARYSENSORS +from .def_hru350 import HRUECO350BINARYSENSORS +from .def_hrueco import HRUECOBINARYSENSORS +from .definitions import IthoBinarySensorEntityDescription async def async_setup_entry( @@ -51,6 +50,11 @@ async def async_setup_entry( ) sensors.append(IthoBinarySensor(description, config_entry)) + if config_entry.data[CONF_ADDON_TYPE] == "cve": + for description in CVEBINARYSENSORS: + description.key = f"{MQTT_BASETOPIC["cve"]}/{MQTT_STATETOPIC["cve"]}" + sensors.append(IthoBinarySensor(description, config_entry)) + if config_entry.data[CONF_ADDON_TYPE] == "noncve": if config_entry.data[CONF_NONCVE_MODEL] == "hru_eco": hru_sensors = HRUECOBINARYSENSORS diff --git a/custom_components/ithodaalderop/def_autotemp.py b/custom_components/ithodaalderop/def_autotemp.py new file mode 100644 index 0000000..1774e81 --- /dev/null +++ b/custom_components/ithodaalderop/def_autotemp.py @@ -0,0 +1,63 @@ +"""Definitions for Itho sensors added to MQTT.""" + +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass +from homeassistant.const import EntityCategory, UnitOfPower, UnitOfTemperature + +from .definitions import IthoBinarySensorEntityDescription, IthoSensorEntityDescription + +AUTOTEMPBINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( + IthoBinarySensorEntityDescription( + json_field="Empty battery ( 0=OK )", + translation_key="empty_battery", + device_class=BinarySensorDeviceClass.BATTERY, + entity_category=EntityCategory.DIAGNOSTIC, + ), +) + +AUTOTEMPSENSORS: tuple[IthoSensorEntityDescription, ...] = ( + IthoSensorEntityDescription( + json_field="Error", + translation_key="error", + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Mode", + translation_key="mode", + ), + IthoSensorEntityDescription( + json_field="State off", + translation_key="state", + ), +) + +AUTOTEMPROOMSENSORS: tuple[IthoSensorEntityDescription, ...] = ( + IthoSensorEntityDescription( + json_field="Room X power % (%)", + translation_key="power_perc", + device_class=SensorDeviceClass.POWER_FACTOR, + native_unit_of_measurement="%", + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Room X power kW (kW)", + translation_key="power_kw", + device_class=SensorDeviceClass.POWER, + native_unit_of_measurement=UnitOfPower.KILO_WATT, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Room X setp", + translation_key="setpoint_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Room X temp", + translation_key="actual_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), +) diff --git a/custom_components/ithodaalderop/def_cve.py b/custom_components/ithodaalderop/def_cve.py new file mode 100644 index 0000000..8348246 --- /dev/null +++ b/custom_components/ithodaalderop/def_cve.py @@ -0,0 +1,86 @@ +"""Definitions for Itho sensors added to MQTT.""" + +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass +from homeassistant.const import ( + CONCENTRATION_PARTS_PER_MILLION, + PERCENTAGE, + REVOLUTIONS_PER_MINUTE, + EntityCategory, + UnitOfTemperature, + UnitOfTime, +) + +from .definitions import IthoBinarySensorEntityDescription, IthoSensorEntityDescription + +CVEBINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( + IthoBinarySensorEntityDescription( + json_field="Filter dirty", + translation_key="filter_dirty", + device_class=BinarySensorDeviceClass.PROBLEM, + entity_category=EntityCategory.DIAGNOSTIC, + icon_off="mdi:air-filter", + icon_on="mdi:vacuum-outline", + ), +) + +CVESENSORS: tuple[IthoSensorEntityDescription, ...] = ( + IthoSensorEntityDescription( + json_field="Error", + translation_key="error", + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Fan setpoint (rpm)", + translation_key="fan_setpoint_rpm", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Fan speed (rpm)", + translation_key="fan_speed", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + ), + IthoSensorEntityDescription( + json_field="Highest CO2 concentration (ppm)", + translation_key="highest_received_co2_value", + native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + icon="mdi:molecule-co2", + ), + IthoSensorEntityDescription( + json_field="Highest RH concentration (%)", + translation_key="highest_received_rh_value", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + ), + IthoSensorEntityDescription( + json_field="hum", + translation_key="humidity", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="temp", + translation_key="temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Total operation (hours)", + translation_key="total_operation_time", + native_unit_of_measurement=UnitOfTime.HOURS, + state_class=SensorStateClass.TOTAL_INCREASING, + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Ventilation setpoint (%)", + translation_key="ventilation_setpoint_percentage", + native_unit_of_measurement=PERCENTAGE, + ), +) diff --git a/custom_components/ithodaalderop/def_hru200.py b/custom_components/ithodaalderop/def_hru200.py new file mode 100644 index 0000000..dfcce0b --- /dev/null +++ b/custom_components/ithodaalderop/def_hru200.py @@ -0,0 +1,98 @@ +"""Definitions for Itho sensors added to MQTT.""" + +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass +from homeassistant.const import ( + CONCENTRATION_PARTS_PER_MILLION, + PERCENTAGE, + REVOLUTIONS_PER_MINUTE, + EntityCategory, + UnitOfTemperature, + UnitOfTime, +) + +from .definitions import IthoBinarySensorEntityDescription, IthoSensorEntityDescription + +HRUECO200SENSORS: tuple[IthoSensorEntityDescription, ...] = ( + IthoSensorEntityDescription( + json_field="Actual speed (rpm)", + translation_key="actual_speed", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Air discharge temperature (°C)", + translation_key="air_discharge_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Average air outlet temperature (°C)", + translation_key="average_air_outlet_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Error", + translation_key="error", + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Filter use counter (hour)", + translation_key="filter_use_counter", + native_unit_of_measurement=UnitOfTime.HOURS, + state_class=SensorStateClass.TOTAL_INCREASING, + entity_category=EntityCategory.DIAGNOSTIC, + icon="mdi:counter", + ), + IthoSensorEntityDescription( + json_field="Max. CO2 level (ppm)", + translation_key="max_co2_level", + native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + icon="mdi:molecule-co2", + ), + IthoSensorEntityDescription( + json_field="Max. RH level (%)", + translation_key="max_rh_level", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + ), + IthoSensorEntityDescription( + json_field="Room temp setpoint (°C)", + translation_key="room_temp_setpoint", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Outside temperature (°C)", + translation_key="outside_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Speed setpoint (rpm)", + translation_key="speed_setpoint", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + ), + IthoSensorEntityDescription( + json_field="Total operation (hrs)", + translation_key="total_operation_time", + native_unit_of_measurement=UnitOfTime.HOURS, + state_class=SensorStateClass.TOTAL_INCREASING, + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Ventilation setpoint (%)", + translation_key="ventilation_setpoint_percentage", + native_unit_of_measurement=PERCENTAGE, + ), +) diff --git a/custom_components/ithodaalderop/def_hru250_300.py b/custom_components/ithodaalderop/def_hru250_300.py new file mode 100644 index 0000000..295afb6 --- /dev/null +++ b/custom_components/ithodaalderop/def_hru250_300.py @@ -0,0 +1,172 @@ +"""Definitions for Itho sensors added to MQTT.""" + +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass +from homeassistant.const import ( + CONCENTRATION_PARTS_PER_MILLION, + PERCENTAGE, + REVOLUTIONS_PER_MINUTE, + EntityCategory, + UnitOfElectricCurrent, + UnitOfTemperature, + UnitOfVolumeFlowRate, +) + +from .definitions import IthoSensorEntityDescription + +HRUECO250300SENSORS: tuple[IthoSensorEntityDescription, ...] = ( + IthoSensorEntityDescription( + json_field="Absolute speed of the fan (%)", + translation_key="absolute_fanspeed", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Current consumption of fan (mA)", + translation_key="current_consumption_fan", + device_class=SensorDeviceClass.CURRENT, + native_unit_of_measurement=UnitOfElectricCurrent.MILLIAMPERE, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Desired capacity (m3/h)", + translation_key="desired_capacity", + device_class=SensorDeviceClass.VOLUME_FLOW_RATE, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Desired current consumption of fan (mA)", + translation_key="desired_consumption_fan", + device_class=SensorDeviceClass.CURRENT, + native_unit_of_measurement=UnitOfElectricCurrent.MILLIAMPERE, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Error number", + translation_key="error_number", + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Highest measured CO2 (ppm)", + translation_key="highest_measured_co2_value", + native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + icon="mdi:molecule-co2", + ), + IthoSensorEntityDescription( + json_field="Highest measured RH (%)", + translation_key="highest_measured_rh_value", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + ), + IthoSensorEntityDescription( + json_field="Inlet temperature (°C)", + translation_key="inlet_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Measured blend temperature heated NTC (°C)", + translation_key="measured_blend_temp_heated", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Measured outside temperature (°C)", + translation_key="outside_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Measured temperature of mixed outside air (°C)", + translation_key="mixed_outside_air_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Measured waste temperature heated NTC (°C)", + translation_key="measured_waste_temp_heated", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Percentage that the bypass valve is open (%)", + translation_key="bypass_valve_open", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Relative fanspeed (%)", + translation_key="relative_fanspeed", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="RPM of the motor (rpm)", + translation_key="motor_speed", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Status", + translation_key="status", + ), + IthoSensorEntityDescription( + json_field="Temperature of the blown out air of the house (°C)", + translation_key="blown_out_air_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Temperature of the extracted air (°C)", + translation_key="extracted_air_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="The desired inlet temperature (°C)", + translation_key="desired_inlet_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="The flow of the blown air (m3/h)", + translation_key="flow_blown_air", + device_class=SensorDeviceClass.VOLUME_FLOW_RATE, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="The flow of the inflated air (M3/h)", + translation_key="flow_inflated_air", + device_class=SensorDeviceClass.VOLUME_FLOW_RATE, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, + state_class=SensorStateClass.MEASUREMENT, + ), + # No native_unit_of_measurement available for mass flow + IthoSensorEntityDescription( + json_field="The mass flow of the air entering the house (kg/h)", + translation_key="mass_flow_air_enter_house_kgh", + state_class=SensorStateClass.MEASUREMENT, + ), + # No native_unit_of_measurement available for mass flow + IthoSensorEntityDescription( + json_field="The mass flow of the air leaving the house (kg/h)", + translation_key="mass_flow_air_leaving_house_kgh", + state_class=SensorStateClass.MEASUREMENT, + ), +) diff --git a/custom_components/ithodaalderop/def_hru350.py b/custom_components/ithodaalderop/def_hru350.py new file mode 100644 index 0000000..2691789 --- /dev/null +++ b/custom_components/ithodaalderop/def_hru350.py @@ -0,0 +1,119 @@ +"""Definitions for Itho sensors added to MQTT.""" + +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass +from homeassistant.const import ( + CONCENTRATION_PARTS_PER_MILLION, + PERCENTAGE, + REVOLUTIONS_PER_MINUTE, + EntityCategory, + UnitOfTemperature, + UnitOfTime, +) + +from .definitions import IthoBinarySensorEntityDescription, IthoSensorEntityDescription + +HRUECO350BINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( + IthoBinarySensorEntityDescription( + json_field="Bypass position", + translation_key="bypass_position", + device_class=BinarySensorDeviceClass.OPENING, + entity_category=EntityCategory.DIAGNOSTIC, + icon_off="mdi:valve-closed", + icon_on="mdi:valve-open", + ), +) + +HRUECO350SENSORS: tuple[IthoSensorEntityDescription, ...] = ( + IthoSensorEntityDescription( + json_field="Actual Mode", + translation_key="actual_mode", + icon="mdi:knob", + ), + IthoSensorEntityDescription( + json_field="Airfilter counter", + translation_key="airfilter_counter", + native_unit_of_measurement=UnitOfTime.HOURS, + state_class=SensorStateClass.TOTAL_INCREASING, + entity_category=EntityCategory.DIAGNOSTIC, + icon="mdi:counter", + ), + IthoSensorEntityDescription( + json_field="Air Quality (%)", + translation_key="airquality", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Balance (%)", + translation_key="balance", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Exhaust fan (RPM)", + translation_key="actual_exhaust_fan", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Exhaust temp (°C)", + translation_key="actual_exhaust_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Global fault code", + translation_key="global_fault_code", + icon="mdi:alert-circle-outline", + entity_category=EntityCategory.DIAGNOSTIC, + ), + IthoSensorEntityDescription( + json_field="Highest received CO2 value (Ppm)", + translation_key="highest_received_co2_value", + native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + icon="mdi:molecule-co2", + ), + IthoSensorEntityDescription( + json_field="Highest received RH value (%RH)", + translation_key="highest_received_rh_value", + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, + ), + IthoSensorEntityDescription( + json_field="Remaining override timer (Sec)", + translation_key="remaining_override_timer", + native_unit_of_measurement=UnitOfTime.SECONDS, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + icon="mdi:timer-outline", + ), + IthoSensorEntityDescription( + json_field="Supply fan (RPM)", + translation_key="actual_supply_fan", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Supply temp (°C)", + translation_key="actual_supply_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), +) + +HRUECOBINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( + IthoBinarySensorEntityDescription( + json_field="Bypass position (pulse)", + translation_key="bypass_position", + device_class=BinarySensorDeviceClass.OPENING, + entity_category=EntityCategory.DIAGNOSTIC, + icon_off="mdi:valve-closed", + icon_on="mdi:valve-open", + ), +) diff --git a/custom_components/ithodaalderop/def_hrueco.py b/custom_components/ithodaalderop/def_hrueco.py new file mode 100644 index 0000000..35f5126 --- /dev/null +++ b/custom_components/ithodaalderop/def_hrueco.py @@ -0,0 +1,71 @@ +"""Definitions for Itho sensors added to MQTT.""" + +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass +from homeassistant.const import ( + REVOLUTIONS_PER_MINUTE, + EntityCategory, + UnitOfTemperature, + UnitOfTime, +) + +from .definitions import IthoBinarySensorEntityDescription, IthoSensorEntityDescription + +HRUECOBINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( + IthoBinarySensorEntityDescription( + json_field="Bypass position (pulse)", + translation_key="bypass_position", + device_class=BinarySensorDeviceClass.OPENING, + entity_category=EntityCategory.DIAGNOSTIC, + icon_off="mdi:valve-closed", + icon_on="mdi:valve-open", + ), +) + +HRUECOSENSORS: tuple[IthoSensorEntityDescription, ...] = ( + IthoSensorEntityDescription( + json_field="Air filter counter", + translation_key="airfilter_counter", + native_unit_of_measurement=UnitOfTime.HOURS, + state_class=SensorStateClass.TOTAL_INCREASING, + entity_category=EntityCategory.DIAGNOSTIC, + icon="mdi:counter", + ), + IthoSensorEntityDescription( + json_field="Drain fan speed (rpm)", + translation_key="drain_fan_speed", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Temp of exhaust air (°C)", + translation_key="actual_exhaust_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="room temp (°C)", + translation_key="room_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Status", + translation_key="status", + ), + IthoSensorEntityDescription( + json_field="Supply fan speed (rpm)", + translation_key="supply_fan_speed", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + ), + IthoSensorEntityDescription( + json_field="Temp of supply air (°C)", + translation_key="actual_supply_temp", + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + ), +) diff --git a/custom_components/ithodaalderop/def_wpu.py b/custom_components/ithodaalderop/def_wpu.py new file mode 100644 index 0000000..e69de29 diff --git a/custom_components/ithodaalderop/definitions.py b/custom_components/ithodaalderop/definitions.py index 9ffc98d..0780b23 100644 --- a/custom_components/ithodaalderop/definitions.py +++ b/custom_components/ithodaalderop/definitions.py @@ -10,27 +10,9 @@ from collections.abc import Callable from dataclasses import dataclass -from homeassistant.components.binary_sensor import ( - BinarySensorDeviceClass, - BinarySensorEntityDescription, -) -from homeassistant.components.sensor import ( - SensorDeviceClass, - SensorEntityDescription, - SensorStateClass, -) -from homeassistant.const import ( - CONCENTRATION_PARTS_PER_MILLION, - PERCENTAGE, - REVOLUTIONS_PER_MINUTE, - EntityCategory, - UnitOfElectricCurrent, - UnitOfPower, - UnitOfPressure, - UnitOfTemperature, - UnitOfTime, - UnitOfVolumeFlowRate, -) +from homeassistant.components.binary_sensor import BinarySensorEntityDescription +from homeassistant.components.sensor import SensorEntityDescription +from homeassistant.const import EntityCategory @dataclass(frozen=False) @@ -59,136 +41,6 @@ class IthoBinarySensorEntityDescription(BinarySensorEntityDescription): entity_category: EntityCategory | None = None -AUTOTEMPBINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( - IthoBinarySensorEntityDescription( - json_field="Empty battery ( 0=OK )", - translation_key="empty_battery", - device_class=BinarySensorDeviceClass.BATTERY, - entity_category=EntityCategory.DIAGNOSTIC, - # icon_off="mdi:battery", - # icon_on="mdi:battery-low", - ), -) - -AUTOTEMPSENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Error", - translation_key="error", - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Mode", - translation_key="mode", - ), - IthoSensorEntityDescription( - json_field="State off", - translation_key="state", - ), -) - -AUTOTEMPROOMSENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Room X power % (%)", - translation_key="power_perc", - device_class=SensorDeviceClass.POWER_FACTOR, - native_unit_of_measurement="%", - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Room X power kW (kW)", - translation_key="power_kw", - device_class=SensorDeviceClass.POWER, - native_unit_of_measurement=UnitOfPower.KILO_WATT, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Room X setp", - translation_key="setpoint_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Room X temp", - translation_key="actual_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), -) - -CVEBINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( - IthoBinarySensorEntityDescription( - json_field="Filter dirty", - translation_key="filter_dirty", - device_class=BinarySensorDeviceClass.PROBLEM, - entity_category=EntityCategory.DIAGNOSTIC, - icon_off="mdi:air-filter", - icon_on="mdi:vacuum-outline", - ), -) - -CVESENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Error", - translation_key="error", - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Fan setpoint (rpm)", - translation_key="fan_setpoint_rpm", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Fan speed (rpm)", - translation_key="fan_speed", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - ), - IthoSensorEntityDescription( - json_field="Highest CO2 concentration (ppm)", - translation_key="highest_received_co2_value", - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - icon="mdi:molecule-co2", - ), - IthoSensorEntityDescription( - json_field="Highest RH concentration (%)", - translation_key="highest_received_rh_value", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - ), - IthoSensorEntityDescription( - json_field="hum", - translation_key="humidity", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="temp", - translation_key="temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Total operation (hours)", - translation_key="total_operation_time", - native_unit_of_measurement=UnitOfTime.HOURS, - state_class=SensorStateClass.TOTAL_INCREASING, - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Ventilation setpoint (%)", - translation_key="ventilation_setpoint_percentage", - native_unit_of_measurement=PERCENTAGE, - ), -) - LASTCMDSENSORS: tuple[IthoSensorEntityDescription, ...] = ( IthoSensorEntityDescription( json_field="command", @@ -205,494 +57,3 @@ class IthoBinarySensorEntityDescription(BinarySensorEntityDescription): entity_registry_enabled_default=False, ), ) - -HRUECO200SENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Actual speed (rpm)", - translation_key="actual_speed", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Air discharge temperature (°C)", - translation_key="air_discharge_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Average air outlet temperature (°C)", - translation_key="average_air_outlet_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Error", - translation_key="error", - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Filter use counter (hour)", - translation_key="filter_use_counter", - native_unit_of_measurement=UnitOfTime.HOURS, - state_class=SensorStateClass.TOTAL_INCREASING, - entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:counter", - ), - IthoSensorEntityDescription( - json_field="Max. CO2 level (ppm)", - translation_key="max_co2_level", - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - icon="mdi:molecule-co2", - ), - IthoSensorEntityDescription( - json_field="Max. RH level (%)", - translation_key="max_rh_level", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - ), - IthoSensorEntityDescription( - json_field="Room temp setpoint (°C)", - translation_key="room_temp_setpoint", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Outside temperature (°C)", - translation_key="outside_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Speed setpoint (rpm)", - translation_key="speed_setpoint", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - ), - IthoSensorEntityDescription( - json_field="Total operation (hrs)", - translation_key="total_operation_time", - native_unit_of_measurement=UnitOfTime.HOURS, - state_class=SensorStateClass.TOTAL_INCREASING, - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Ventilation setpoint (%)", - translation_key="ventilation_setpoint_percentage", - native_unit_of_measurement=PERCENTAGE, - ), -) - -HRUECO250300SENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Absolute speed of the fan (%)", - translation_key="absolute_fanspeed", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Current consumption of fan (mA)", - translation_key="current_consumption_fan", - device_class=SensorDeviceClass.CURRENT, - native_unit_of_measurement=UnitOfElectricCurrent.MILLIAMPERE, - state_class=SensorStateClass.MEASUREMENT, - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Desired capacity (m3/h)", - translation_key="desired_capacity", - device_class=SensorDeviceClass.VOLUME_FLOW_RATE, - native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Desired current consumption of fan (mA)", - translation_key="desired_consumption_fan", - device_class=SensorDeviceClass.CURRENT, - native_unit_of_measurement=UnitOfElectricCurrent.MILLIAMPERE, - state_class=SensorStateClass.MEASUREMENT, - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Error number", - translation_key="error_number", - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Highest measured CO2 (ppm)", - translation_key="highest_measured_co2_value", - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - icon="mdi:molecule-co2", - ), - IthoSensorEntityDescription( - json_field="Highest measured RH (%)", - translation_key="highest_measured_rh_value", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - ), - IthoSensorEntityDescription( - json_field="Inlet temperature (°C)", - translation_key="inlet_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Measured blend temperature heated NTC (°C)", - translation_key="measured_blend_temp_heated", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Measured outside temperature (°C)", - translation_key="outside_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Measured temperature of mixed outside air (°C)", - translation_key="mixed_outside_air_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Measured waste temperature heated NTC (°C)", - translation_key="measured_waste_temp_heated", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Percentage that the bypass valve is open (%)", - translation_key="bypass_valve_open", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Relative fanspeed (%)", - translation_key="relative_fanspeed", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="RPM of the motor (rpm)", - translation_key="motor_speed", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Status", - translation_key="status", - ), - IthoSensorEntityDescription( - json_field="Temperature of the blown out air of the house (°C)", - translation_key="blown_out_air_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Temperature of the extracted air (°C)", - translation_key="extracted_air_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="The desired inlet temperature (°C)", - translation_key="desired_inlet_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="The flow of the blown air (m3/h)", - translation_key="flow_blown_air", - device_class=SensorDeviceClass.VOLUME_FLOW_RATE, - native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="The flow of the inflated air (M3/h)", - translation_key="flow_inflated_air", - device_class=SensorDeviceClass.VOLUME_FLOW_RATE, - native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, - state_class=SensorStateClass.MEASUREMENT, - ), - # No native_unit_of_measurement available for mass flow - IthoSensorEntityDescription( - json_field="The mass flow of the air entering the house (kg/h)", - translation_key="mass_flow_air_enter_house_kgh", - state_class=SensorStateClass.MEASUREMENT, - ), - # No native_unit_of_measurement available for mass flow - IthoSensorEntityDescription( - json_field="The mass flow of the air leaving the house (kg/h)", - translation_key="mass_flow_air_leaving_house_kgh", - state_class=SensorStateClass.MEASUREMENT, - ), -) - -HRUECO350BINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( - IthoBinarySensorEntityDescription( - json_field="Bypass position", - translation_key="bypass_position", - device_class=BinarySensorDeviceClass.OPENING, - entity_category=EntityCategory.DIAGNOSTIC, - icon_off="mdi:valve-closed", - icon_on="mdi:valve-open", - ), -) - -HRUECO350SENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Actual Mode", - translation_key="actual_mode", - icon="mdi:knob", - ), - IthoSensorEntityDescription( - json_field="Airfilter counter", - translation_key="airfilter_counter", - native_unit_of_measurement=UnitOfTime.HOURS, - state_class=SensorStateClass.TOTAL_INCREASING, - entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:counter", - ), - IthoSensorEntityDescription( - json_field="Air Quality (%)", - translation_key="airquality", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Balance (%)", - translation_key="balance", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Exhaust fan (RPM)", - translation_key="actual_exhaust_fan", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Exhaust temp (°C)", - translation_key="actual_exhaust_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Global fault code", - translation_key="global_fault_code", - icon="mdi:alert-circle-outline", - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Highest received CO2 value (Ppm)", - translation_key="highest_received_co2_value", - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - icon="mdi:molecule-co2", - ), - IthoSensorEntityDescription( - json_field="Highest received RH value (%RH)", - translation_key="highest_received_rh_value", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - entity_registry_enabled_default=False, - ), - IthoSensorEntityDescription( - json_field="Remaining override timer (Sec)", - translation_key="remaining_override_timer", - native_unit_of_measurement=UnitOfTime.SECONDS, - state_class=SensorStateClass.MEASUREMENT, - entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:timer-outline", - ), - IthoSensorEntityDescription( - json_field="Supply fan (RPM)", - translation_key="actual_supply_fan", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Supply temp (°C)", - translation_key="actual_supply_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), -) - -HRUECOBINARYSENSORS: tuple[IthoBinarySensorEntityDescription, ...] = ( - IthoBinarySensorEntityDescription( - json_field="Bypass position (pulse)", - translation_key="bypass_position", - device_class=BinarySensorDeviceClass.OPENING, - entity_category=EntityCategory.DIAGNOSTIC, - icon_off="mdi:valve-closed", - icon_on="mdi:valve-open", - ), -) - -HRUECOSENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Air filter counter", - translation_key="airfilter_counter", - native_unit_of_measurement=UnitOfTime.HOURS, - state_class=SensorStateClass.TOTAL_INCREASING, - entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:counter", - ), - IthoSensorEntityDescription( - json_field="Drain fan speed (rpm)", - translation_key="drain_fan_speed", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Temp of exhaust air (°C)", - translation_key="actual_exhaust_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="room temp (°C)", - translation_key="room_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Status", - translation_key="status", - ), - IthoSensorEntityDescription( - json_field="Supply fan speed (rpm)", - translation_key="supply_fan_speed", - native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Temp of supply air (°C)", - translation_key="actual_supply_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), -) - -WPUSENSORS: tuple[IthoSensorEntityDescription, ...] = ( - IthoSensorEntityDescription( - json_field="Boiler pump (%)", - translation_key="boiler_pump_percent", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Boiler temp up (°C)", - translation_key="boiler_temp_up", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="CV pressure (Bar)", - translation_key="cv_pressure", - device_class=SensorDeviceClass.PRESSURE, - native_unit_of_measurement=UnitOfPressure.BAR, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Cv pump (%)", - translation_key="cv_pump_percent", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="CV return temp (°C)", - translation_key="cv_return_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Error", - translation_key="error", - entity_category=EntityCategory.DIAGNOSTIC, - ), - IthoSensorEntityDescription( - json_field="Flow sensor (lt_hr)", - translation_key="flow_sensor", - state_class=SensorStateClass.MEASUREMENT, - entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:waves-arrow-right", - ), - IthoSensorEntityDescription( - json_field="Heat demand thermost. (%)", - translation_key="heat_demand", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Requested room temp (°C)", - translation_key="requested_room_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Room temp (°C)", - translation_key="room_temp", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Status", - translation_key="status", - ), - IthoSensorEntityDescription( - json_field="ECO selected on thermostat", - translation_key="thermostat", - ), - IthoSensorEntityDescription( - json_field="Temp to source (°C)", - translation_key="temp_to_source", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Temp from source (°C)", - translation_key="temp_from_source", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, - state_class=SensorStateClass.MEASUREMENT, - ), - IthoSensorEntityDescription( - json_field="Well pump (%)", - translation_key="well_pump_percent", - native_unit_of_measurement=PERCENTAGE, - state_class=SensorStateClass.MEASUREMENT, - ), -) diff --git a/custom_components/ithodaalderop/sensor.py b/custom_components/ithodaalderop/sensor.py index 765739b..f9e7837 100644 --- a/custom_components/ithodaalderop/sensor.py +++ b/custom_components/ithodaalderop/sensor.py @@ -35,18 +35,14 @@ UNITTYPE_ICONS, WPU_STATUS, ) -from .definitions import ( - AUTOTEMPROOMSENSORS, - AUTOTEMPSENSORS, - CVESENSORS, - HRUECO200SENSORS, - HRUECO350SENSORS, - HRUECO250300SENSORS, - HRUECOSENSORS, - LASTCMDSENSORS, - WPUSENSORS, - IthoSensorEntityDescription, -) +from .def_autotemp import AUTOTEMPROOMSENSORS, AUTOTEMPSENSORS +from .def_cve import CVESENSORS +from .def_hru200 import HRUECO200SENSORS +from .def_hru250_300 import HRUECO250300SENSORS +from .def_hru350 import HRUECO350SENSORS +from .def_hrueco import HRUECOSENSORS +from .def_wpu import WPUSENSORS +from .definitions import LASTCMDSENSORS, IthoSensorEntityDescription def _create_remotes(config_entry: ConfigEntry):