Do value templates for Batteries reduce battery life

I’ve seen a lot of approaches to battery monitoring, and several pretty cool options that save you the trouble of creating templates for all your batteries. I’ve seen a few comments about polling, and battery life, etc. But does a value template that pulls its value from another sensor really have any effect on battery life? I would think not, but was curious.

Like this one for example (it’s a pretty commmon template around here)

      door_lock_batteries_garage_door:
        friendly_name: Garage Door Lock Battery Level
        value_template: "{% if states.zwave.lock_garage_door_lock %}
            {{ states.zwave.lock_garage_door_lock.attributes.battery_level }}
          {% else %}
            unknown
          {% endif %}"
        unit_of_measurement: '%'
        # entity_id: zwave.lock_garage_door_lock
        icon_template: >-
          {% set battery_level = states('sensor.door_lock_batteries_garage_door')|int('unknown') %}
          {% set battery_round = (battery_level|int / 10)|int * 10 %}
          {% if battery_level == 'unknown' %}
            mdi:battery-unknown
          {% else %}
            {% if battery_round >= 100 %}
              mdi:battery
            {% elif battery_round > 0 %}
              mdi:battery-{{ battery_round }}
            {% else %}
              mdi:battery-alert
            {% endif %}
          {% endif %}

The Battery level is already there in the zwave entity, does having a template cause more polling?

Thanks,

No templates kinda sit around until something else updates. That’s how they work. If the template points to any entity, it will not update until the entity updates.

EDIT: It’s the main reason using now() in a template never works. People think the template will always update all the time, but the template only monitors home assistant entities. now() isn’t an entity, so the template never updates!

If you look around the forum, you will see alot of posts about templates not updating when now() is used.

2 Likes