From 96bcc6c35a5c31fd90d08516b747f71479cd1a87 Mon Sep 17 00:00:00 2001 From: fb22 <4872297+fb22@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:18:37 +0100 Subject: [PATCH] Add Vicare volumetric flow and compressor phase sensors (#103875) Co-authored-by: Joost Lekkerkerker Co-authored-by: Robert Resch --- homeassistant/components/vicare/sensor.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/homeassistant/components/vicare/sensor.py b/homeassistant/components/vicare/sensor.py index 325f3bf2d07..99f1eef80b9 100644 --- a/homeassistant/components/vicare/sensor.py +++ b/homeassistant/components/vicare/sensor.py @@ -24,11 +24,13 @@ from homeassistant.components.sensor import ( from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( PERCENTAGE, + EntityCategory, UnitOfEnergy, UnitOfPower, UnitOfTemperature, UnitOfTime, UnitOfVolume, + UnitOfVolumeFlowRate, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -477,6 +479,15 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = ( device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, ), + ViCareSensorEntityDescription( + key="volumetric_flow", + name="Volumetric flow", + icon="mdi:gauge", + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, + value_getter=lambda api: api.getVolumetricFlowReturn() / 1000, + entity_category=EntityCategory.DIAGNOSTIC, + state_class=SensorStateClass.MEASUREMENT, + ), ) CIRCUIT_SENSORS: tuple[ViCareSensorEntityDescription, ...] = ( @@ -572,6 +583,13 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = ( value_getter=lambda api: api.getHoursLoadClass5(), state_class=SensorStateClass.TOTAL_INCREASING, ), + ViCareSensorEntityDescription( + key="compressor_phase", + name="Compressor Phase", + icon="mdi:information", + value_getter=lambda api: api.getPhase(), + entity_category=EntityCategory.DIAGNOSTIC, + ), )