From e083a6bff7fafd17d5ff6ad4b87916b83727d8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Seux?= Date: Mon, 19 Jun 2023 19:21:43 +0200 Subject: [PATCH] feat: Support Home Assistant water device_class (#18066) This should be sufficient for https://www.zigbee2mqtt.io/devices/ZVG1.html to be water_consumed sensor to be usable in Energy dashboard (water section). Co-authored-by: Koen Kanters --- lib/extension/homeassistant.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/extension/homeassistant.ts b/lib/extension/homeassistant.ts index dcd5f7f53..b4affc725 100644 --- a/lib/extension/homeassistant.ts +++ b/lib/extension/homeassistant.ts @@ -732,6 +732,10 @@ export default class HomeAssistant extends Extension { entity_category: 'diagnostic', state_class: 'measurement', }, + water_consumed: { + device_class: 'water', + state_class: 'total_increasing', + }, x_axis: {icon: 'mdi:axis-x-arrow'}, y_axis: {icon: 'mdi:axis-y-arrow'}, z_axis: {icon: 'mdi:axis-z-arrow'},