To summarize:
- Glad we removed
entity_id
. - Think we need to replace it.
Sounds like politics:
My predecessor’s plan was flawed and I have cancelled it. I am replacing it with a new plan (proceeds to outline a nearly equivalent plan).
The decision to remove entity_id
didn’t foresee one specific consequence, namely losing the ability to easily control/constrain the template’s evaluation (i.e. what refreshes it and how often). I’m pleased to see that this loss is now recognized and the discussion has turned to mitigation.
scan_interval
On the surface, it sounds like a more flexible replacement for entity_id
because you have more choices of polling frequency. However, it lacks the ability of sensor.date
to trigger at the beginning of every new day. That’s an important ability for many common date/time calculations that must reset daily. For that you will now be obliged to use an automation (thereby increasing the complexity of what was once possible by simply adding entity_id: sensor.date
).
Question: if I specify a scan_interval
will that prevent the assignment of listeners to the template?
That, of course, is the desired behavior because it’s how entity_id
works.
automation
Using an automation with a Time Pattern Trigger (to periodically update a Template Sensor) was already a technique used in all versions prior to 0.115. It was typically suggested to users who needed a very specific updating frequency (i.e. not once a minute or once a day). Based on my impression, most users rarely needed to use this technique because most Template Sensors worked satisfactorily with a one-minute or once-a-day update interval (using sensor.time
and sensor.date
, respectively).
auto-update
In the past, simply adding entity_id
was an implicit auto_update: false
. In addition, entity_id
was more compact because it also indicated the entity (or entities) that would serve to update the template. It appears it is now suggested to use two options to perform what was once achievable with a single option.
I still believe entity_id
was a simpler way to get the job done. However, whatever combination of new options (scan_interval, auto_update, whatever) are used to replace entity_id
would be appreciated because the current situation complicates certain Template Sensors.