diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index d5a465b8ccc..09287448fe5 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -990,6 +990,18 @@ CAPABILITY_TO_SENSORS: dict[ ) ], }, + Capability.SAMSUNG_CE_WATER_CONSUMPTION_REPORT: { + Attribute.WATER_CONSUMPTION: [ + SmartThingsSensorEntityDescription( + key=Attribute.WATER_CONSUMPTION, + translation_key="water_consumption", + state_class=SensorStateClass.TOTAL_INCREASING, + device_class=SensorDeviceClass.WATER, + native_unit_of_measurement=UnitOfVolume.LITERS, + value_fn=lambda value: value["cumulativeAmount"] / 1000, + ) + ] + }, } diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index 8b0b92e73a7..81f4d34c8bb 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -487,6 +487,9 @@ "wrinkle_prevent": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::wrinkle_prevent%]", "freeze_protection": "Freeze protection" } + }, + "water_consumption": { + "name": "Water consumption" } }, "switch": { diff --git a/tests/components/smartthings/snapshots/test_sensor.ambr b/tests/components/smartthings/snapshots/test_sensor.ambr index cbe05801a2f..0e9ddf2ea09 100644 --- a/tests/components/smartthings/snapshots/test_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_sensor.ambr @@ -8494,6 +8494,58 @@ 'state': '0.0', }) # --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_water_consumption-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.machine_a_laver_water_consumption', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Water consumption', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'water_consumption', + 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_samsungce.waterConsumptionReport_waterConsumption_waterConsumption', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_water_consumption-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'water', + 'friendly_name': 'Machine à Laver Water consumption', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.machine_a_laver_water_consumption', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '1642.2', + }) +# --- # name: test_all_entities[ecobee_sensor][sensor.child_bedroom_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': set({