-
-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Add heat pump sensors to ViCare integration #161422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,6 +168,16 @@ class ViCareSensorEntityDescription(SensorEntityDescription, ViCareRequiredKeysM | |
| device_class=SensorDeviceClass.TEMPERATURE, | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="primary_circuit_pump_rotation", | ||
| translation_key="primary_circuit_pump_rotation", | ||
| native_unit_of_measurement=PERCENTAGE, | ||
| value_getter=lambda api: api.getPrimaryCircuitPumpRotation(), | ||
| unit_getter=lambda api: api.getPrimaryCircuitPumpRotationUnit(), | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| entity_registry_enabled_default=False, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="secondary_circuit_supply_temperature", | ||
| translation_key="secondary_circuit_supply_temperature", | ||
|
|
@@ -184,6 +194,36 @@ class ViCareSensorEntityDescription(SensorEntityDescription, ViCareRequiredKeysM | |
| device_class=SensorDeviceClass.TEMPERATURE, | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="hot_gas_temperature", | ||
| translation_key="hot_gas_temperature", | ||
| native_unit_of_measurement=UnitOfTemperature.CELSIUS, | ||
| value_getter=lambda api: api.getHotGasTemperature(), | ||
| device_class=SensorDeviceClass.TEMPERATURE, | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| entity_registry_enabled_default=False, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="liquid_gas_temperature", | ||
| translation_key="liquid_gas_temperature", | ||
| native_unit_of_measurement=UnitOfTemperature.CELSIUS, | ||
| value_getter=lambda api: api.getLiquidGasTemperature(), | ||
| device_class=SensorDeviceClass.TEMPERATURE, | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| entity_registry_enabled_default=False, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="suction_gas_temperature", | ||
| translation_key="suction_gas_temperature", | ||
| native_unit_of_measurement=UnitOfTemperature.CELSIUS, | ||
| value_getter=lambda api: api.getSuctionGasTemperature(), | ||
| device_class=SensorDeviceClass.TEMPERATURE, | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| entity_registry_enabled_default=False, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="hotwater_out_temperature", | ||
| translation_key="hotwater_out_temperature", | ||
|
|
@@ -971,6 +1011,28 @@ class ViCareSensorEntityDescription(SensorEntityDescription, ViCareRequiredKeysM | |
| value_getter=lambda api: api.getSupplyPressure(), | ||
| unit_getter=lambda api: api.getSupplyPressureUnit(), | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="hot_gas_pressure", | ||
| translation_key="hot_gas_pressure", | ||
| device_class=SensorDeviceClass.PRESSURE, | ||
| native_unit_of_measurement=UnitOfPressure.BAR, | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| value_getter=lambda api: api.getHotGasPressure(), | ||
| unit_getter=lambda api: api.getHotGasPressureUnit(), | ||
| entity_registry_enabled_default=False, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="suction_gas_pressure", | ||
| translation_key="suction_gas_pressure", | ||
| device_class=SensorDeviceClass.PRESSURE, | ||
| native_unit_of_measurement=UnitOfPressure.BAR, | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| value_getter=lambda api: api.getSuctionGasPressure(), | ||
| unit_getter=lambda api: api.getSuctionGasPressureUnit(), | ||
| entity_registry_enabled_default=False, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="heating_rod_starts", | ||
| translation_key="heating_rod_starts", | ||
|
|
@@ -1007,6 +1069,35 @@ class ViCareSensorEntityDescription(SensorEntityDescription, ViCareRequiredKeysM | |
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| value_getter=lambda api: api.getSeasonalPerformanceFactorHeating(), | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="cop_heating", | ||
| translation_key="cop_heating", | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| value_getter=lambda api: api.getCoefficientOfPerformanceHeating(), | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="cop_dhw", | ||
| translation_key="cop_dhw", | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| value_getter=lambda api: api.getCoefficientOfPerformanceDHW(), | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="cop_total", | ||
| translation_key="cop_total", | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| value_getter=lambda api: api.getCoefficientOfPerformanceTotal(), | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="cop_cooling", | ||
| translation_key="cop_cooling", | ||
| state_class=SensorStateClass.MEASUREMENT, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| value_getter=lambda api: api.getCoefficientOfPerformanceCooling(), | ||
| entity_registry_enabled_default=False, | ||
| ), | ||
|
Comment on lines
+1072
to
+1100
|
||
| ViCareSensorEntityDescription( | ||
| key="battery_level", | ||
| native_unit_of_measurement=PERCENTAGE, | ||
|
|
@@ -1187,6 +1278,23 @@ class ViCareSensorEntityDescription(SensorEntityDescription, ViCareRequiredKeysM | |
| ) | ||
|
|
||
| COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = ( | ||
| ViCareSensorEntityDescription( | ||
| key="compressor_power", | ||
| translation_key="compressor_power", | ||
| native_unit_of_measurement=UnitOfPower.KILO_WATT, | ||
| value_getter=lambda api: api.getPower(), | ||
| unit_getter=lambda api: api.getPowerUnit(), | ||
| device_class=SensorDeviceClass.POWER, | ||
| entity_category=EntityCategory.DIAGNOSTIC, | ||
| ), | ||
| ViCareSensorEntityDescription( | ||
| key="compressor_modulation", | ||
| translation_key="compressor_modulation", | ||
| native_unit_of_measurement=PERCENTAGE, | ||
| value_getter=lambda api: api.getModulation(), | ||
| unit_getter=lambda api: api.getModulationUnit(), | ||
|
Comment on lines
+1293
to
+1295
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just out of curiosity, not saying that it is wrong, but why is there both
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| state_class=SensorStateClass.MEASUREMENT, | ||
| ), | ||
|
Comment on lines
+1290
to
+1297
|
||
| ViCareSensorEntityDescription( | ||
| key="compressor_starts", | ||
| translation_key="compressor_starts", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new sensors call
api.getCoefficientOfPerformanceHeating()(and the other COP getters added here), buthomeassistant/components/vicare/manifest.jsonstill pinsPyViCare==2.55.1. The commit message notes these APIs come from a newer PyViCare PR, so with the currently pinned version this call will raiseAttributeErrorduringViCareSensor.update, breaking the new entities on a standard install. Please update the PyViCare requirement (and regeneraterequirements_all.txt) to a version that includes these methods.Useful? React with 👍 / 👎.