At What Rates Do Templates Render & Update

The name tag on the top is for attribution. I am not the original author of this. Petro is…
petro - Original post
Templates will update once a minute if you have the following functions in the template:

now()
utcnow()
today_at()
relative_time()

Templates will update when a state changes if you use

closest()
distance()
states.xxx.xxx
states()
state_translated()
states_attr()
is_state()
is_state_attr()
expand()
has_value()

Templates will render at most once per second if you use

states.<domain>

Templates will render at most once per minute if you use the states object without specifying a domain or full entity_id, e.g.

states 

The Home Assistant Cookbook - Index.

5 Likes

I was just looking at this, thanks!

I have one thing to add, and someone please correct me if I’m wrong, but as far as I can tell a time-based trigger in a template will work down to the second, as in:

  - trigger:
      - platform: time
        at: '23:59:30'

At least, it seems to be working that way for me.

Yes, but the post is not about template entities. It’s about the template itself, as in the jinja.

The template itself (without a trigger) will cause a template entity or a frontend field using the template to update based on the information in the guide. Or if you use the template for history stats start and end, it will cause those to render based on the information above.