V0.81 and template sensors

I hope this isn’t a stupid question but it seems pretty important to me and I for one want to understand it before I upgrade and find things don’t work. It does seem to me that this is potentially a very big change with not a great deal of explanation.

What exactly is the implication of this change in 0.81 and more specifically what does “if we can’t find relevant entities in the template” mean?


Template sensors will no longer auto update if we can’t find relevant entities in the template. You’ll want to review your template sensors and consider adding relevant entity_id entries or use the new homeassistant.update_entity service.

It warns you in the log file if it finds any that it can not detect the entity id’s to update on.

I have these two which do not update as it can’t detect the correct entities to evaluate on; which is expected:

      dayofyear:
        friendly_name: 'Day Number'
        value_template: "{{ now().strftime('%j') }}"

      weekofyear:
        friendly_name: 'Week Number'
        value_template: "{{ now().strftime('%U') }}"

Ah, that is good to know. Thanks.

These seems interesting, can you elaborate on the setup of these entries?
Are they “sensors”? based on “platform: time_date”? Thanks. Also did you find a good use for them, I thought originally that they could be great to pinpoint a specific day such as a birthday or Halloween, Christmas etc, until I though that this would not work for leap years.

They show up as sensors and can be used as such. The now function returns the current system time.

I use them for a couple things; like countdown to end of the year; etc.

Have you figured out a fix for these sensors yet?

I have a couple of sensors that use similar value_templates. I don’t really need up to the second detection so I just use “sensor.time” as the entity_id to update on which should update every minute.

But there might be a need in the future to update a sensor by the second tho.

I think it’s a bug it doesn’t pickup on now() as a trigger.