From 324f08d00f21d9605a64cd04347860f59679a77b Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sun, 21 Jun 2026 07:48:08 +0200 Subject: [PATCH] Add separate battery sensors for Overkiz smoke sensors (#174365) --- homeassistant/components/overkiz/sensor.py | 20 +++ homeassistant/components/overkiz/strings.json | 1 + .../overkiz/snapshots/test_sensor.ambr | 124 ++++++++++++++++++ 3 files changed, 145 insertions(+) diff --git a/homeassistant/components/overkiz/sensor.py b/homeassistant/components/overkiz/sensor.py index c5c16821f41e..33c7a77630aa 100644 --- a/homeassistant/components/overkiz/sensor.py +++ b/homeassistant/components/overkiz/sensor.py @@ -79,6 +79,26 @@ SENSOR_DESCRIPTIONS: list[OverkizSensorDescription] = [ options=["good", "medium", "low", "critical"], translation_key="battery", ), + # SmokeSensor with separate batteries for the radio and sensor parts, + # e.g. the Somfy smoke sensor (9V radio block + 3V CR123 sensor cell). + OverkizSensorDescription( + key=OverkizState.IO_MAINTENANCE_RADIO_PART_BATTERY, + name="Radio battery", + entity_category=EntityCategory.DIAGNOSTIC, + icon="mdi:battery", + device_class=SensorDeviceClass.ENUM, + options=["low", "normal"], + translation_key="battery", + ), + OverkizSensorDescription( + key=OverkizState.IO_MAINTENANCE_SENSOR_PART_BATTERY, + name="Sensor battery", + entity_category=EntityCategory.DIAGNOSTIC, + icon="mdi:battery", + device_class=SensorDeviceClass.ENUM, + options=["absence", "low", "normal"], + translation_key="battery", + ), OverkizSensorDescription( key=OverkizState.CORE_RSSI_LEVEL, name="RSSI level", diff --git a/homeassistant/components/overkiz/strings.json b/homeassistant/components/overkiz/strings.json index cd6a37c99ce5..2830c1ef311a 100644 --- a/homeassistant/components/overkiz/strings.json +++ b/homeassistant/components/overkiz/strings.json @@ -147,6 +147,7 @@ "sensor": { "battery": { "state": { + "absence": "Absent", "critical": "Critical", "full": "[%key:common::state::full%]", "good": "Good", diff --git a/tests/components/overkiz/snapshots/test_sensor.ambr b/tests/components/overkiz/snapshots/test_sensor.ambr index 4c46ae1f8f0e..fedcabaeadce 100644 --- a/tests/components/overkiz/snapshots/test_sensor.ambr +++ b/tests/components/overkiz/snapshots/test_sensor.ambr @@ -3010,6 +3010,67 @@ 'state': 'good', }) # --- +# name: test_sensor_entities_snapshot[cloud_nexity_rail_din_europe.json][sensor.maple_residence_living_room_smoke_detector_radio_battery-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'low', + 'normal', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.maple_residence_living_room_smoke_detector_radio_battery', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Radio battery', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery', + 'original_name': 'Radio battery', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'battery', + 'unique_id': 'io://1234-5678-1698/8907539-io:MaintenanceRadioPartBatteryState', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor_entities_snapshot[cloud_nexity_rail_din_europe.json][sensor.maple_residence_living_room_smoke_detector_radio_battery-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Living Room Smoke Detector Radio battery', + 'icon': 'mdi:battery', + 'options': list([ + 'low', + 'normal', + ]), + }), + 'context': , + 'entity_id': 'sensor.maple_residence_living_room_smoke_detector_radio_battery', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'normal', + }) +# --- # name: test_sensor_entities_snapshot[cloud_nexity_rail_din_europe.json][sensor.maple_residence_living_room_smoke_detector_rssi_level-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -3065,6 +3126,69 @@ 'state': '100', }) # --- +# name: test_sensor_entities_snapshot[cloud_nexity_rail_din_europe.json][sensor.maple_residence_living_room_smoke_detector_sensor_battery-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'absence', + 'low', + 'normal', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.maple_residence_living_room_smoke_detector_sensor_battery', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Sensor battery', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery', + 'original_name': 'Sensor battery', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'battery', + 'unique_id': 'io://1234-5678-1698/8907539-io:MaintenanceSensorPartBatteryState', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor_entities_snapshot[cloud_nexity_rail_din_europe.json][sensor.maple_residence_living_room_smoke_detector_sensor_battery-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Living Room Smoke Detector Sensor battery', + 'icon': 'mdi:battery', + 'options': list([ + 'absence', + 'low', + 'normal', + ]), + }), + 'context': , + 'entity_id': 'sensor.maple_residence_living_room_smoke_detector_sensor_battery', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'normal', + }) +# --- # name: test_sensor_entities_snapshot[cloud_nexity_rail_din_europe.json][sensor.maple_residence_living_room_smoke_detector_sensor_defect-entry] EntityRegistryEntrySnapshot({ 'aliases': list([