home-assistant: fix zigbee battery value_template override key
Some checks failed
Run nix flake check / flake-check (push) Failing after 5m39s
Run nix flake check / flake-check (pull_request) Failing after 12m37s

The homeassistant override key should match the entity type in the
MQTT discovery topic path. For battery sensors, the topic is
homeassistant/sensor/<device>/battery/config, so the key should be
"battery" not "sensor_battery".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-06 00:48:30 +01:00
parent b6c41aa910
commit 506e93a5e2

View File

@@ -78,15 +78,15 @@
# Override battery calculation using voltage (mV): (voltage - 2100) / 9 # Override battery calculation using voltage (mV): (voltage - 2100) / 9
"0x54ef441000a547bd" = { "0x54ef441000a547bd" = {
friendly_name = "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" = { "0x54ef441000a54d3c" = {
friendly_name = "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" = { "0x54ef441000a564b6" = {
friendly_name = "temp_server"; 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 # Other sensors