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/<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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user