From 506e93a5e27afa3a791dbf706b6436765a40bbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Fri, 6 Feb 2026 00:48:30 +0100 Subject: [PATCH] home-assistant: fix zigbee battery value_template override key The homeassistant override key should match the entity type in the MQTT discovery topic path. For battery sensors, the topic is homeassistant/sensor//battery/config, so the key should be "battery" not "sensor_battery". Co-Authored-By: Claude Opus 4.5 --- services/home-assistant/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/home-assistant/default.nix b/services/home-assistant/default.nix index 352b74c..61dbc30 100644 --- a/services/home-assistant/default.nix +++ b/services/home-assistant/default.nix @@ -78,15 +78,15 @@ # Override battery calculation using voltage (mV): (voltage - 2100) / 9 "0x54ef441000a547bd" = { friendly_name = "0x54ef441000a547bd"; - homeassistant.sensor_battery.value_template = "{{ (((value_json.voltage | float) - 2100) / 9) | round(0) | int | min(100) | max(0) }}"; + homeassistant.battery.value_template = "{{ (((value_json.voltage | float) - 2100) / 9) | round(0) | int | min(100) | max(0) }}"; }; "0x54ef441000a54d3c" = { friendly_name = "0x54ef441000a54d3c"; - homeassistant.sensor_battery.value_template = "{{ (((value_json.voltage | float) - 2100) / 9) | round(0) | int | min(100) | max(0) }}"; + homeassistant.battery.value_template = "{{ (((value_json.voltage | float) - 2100) / 9) | round(0) | int | min(100) | max(0) }}"; }; "0x54ef441000a564b6" = { friendly_name = "temp_server"; - homeassistant.sensor_battery.value_template = "{{ (((value_json.voltage | float) - 2100) / 9) | round(0) | int | min(100) | max(0) }}"; + homeassistant.battery.value_template = "{{ (((value_json.voltage | float) - 2100) / 9) | round(0) | int | min(100) | max(0) }}"; }; # Other sensors