From 35affddaa3d4db53f210a358d9e40d884a108fa9 Mon Sep 17 00:00:00 2001 From: dennismdejong Date: Mon, 27 Jul 2026 21:44:36 +0200 Subject: [PATCH] fix: suggest Celsius display unit for temperature entities (Closes #441) --- README.md | 1 + custom_components/panasonic_cc/aquarea/sensor.py | 2 ++ custom_components/panasonic_cc/panasonic/sensor.py | 3 +++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 1ea88f0..701f71b 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,7 @@ data: - **Cached data** — If your device is offline, the integration will show cached data. Check the "Data Mode" diagnostic sensor to see if data is LIVE, CACHED, or OFFLINE. - **Stale readings** — Use the "Fetch latest data" button to manually refresh device data. - **No outside temperature** — Not all devices report outside temperature. Use the "Force outside sensor" option if you want the sensor entity to always appear. +- **Temperature display unit** — Temperature entities report in Celsius natively and follow HA's unit system for display. To show a specific unit, set the entity's display unit in HA or change the HA unit system. ### Energy Sensors - **Energy data not updating** — Ensure "Enable daily energy sensors" is checked in the integration options. Note that energy data resets daily. diff --git a/custom_components/panasonic_cc/aquarea/sensor.py b/custom_components/panasonic_cc/aquarea/sensor.py index dd2ba0f..89fe5da 100644 --- a/custom_components/panasonic_cc/aquarea/sensor.py +++ b/custom_components/panasonic_cc/aquarea/sensor.py @@ -43,6 +43,7 @@ class AquareaSensorEntityDescription(SensorEntityDescription): device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_unit_of_measurement=UnitOfTemperature.CELSIUS, get_state=lambda device: device.temperature_outdoor, is_available=lambda device: device.temperature_outdoor is not None, ) @@ -55,6 +56,7 @@ class AquareaSensorEntityDescription(SensorEntityDescription): device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_unit_of_measurement=UnitOfTemperature.CELSIUS, get_state=lambda device: device.tank.temperature if device.tank is not None else None, is_available=lambda device: device.tank is not None, ) diff --git a/custom_components/panasonic_cc/panasonic/sensor.py b/custom_components/panasonic_cc/panasonic/sensor.py index 4c19e6b..fc75b6c 100644 --- a/custom_components/panasonic_cc/panasonic/sensor.py +++ b/custom_components/panasonic_cc/panasonic/sensor.py @@ -44,6 +44,7 @@ class PanasonicEnergySensorEntityDescription(SensorEntityDescription): device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_unit_of_measurement=UnitOfTemperature.CELSIUS, get_state=lambda device: device.parameters.inside_temperature, is_available=lambda device: device.parameters.inside_temperature is not None, ) @@ -55,6 +56,7 @@ class PanasonicEnergySensorEntityDescription(SensorEntityDescription): device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_unit_of_measurement=UnitOfTemperature.CELSIUS, get_state=lambda device: device.parameters.outside_temperature, is_available=lambda device: device.parameters.outside_temperature is not None, ) @@ -186,6 +188,7 @@ def create_zone_temperature_description(zone: PanasonicDeviceZone): device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_unit_of_measurement=UnitOfTemperature.CELSIUS, get_state=lambda device: zone.temperature, is_available=lambda device: zone.has_temperature )