This is not what I asked.
My question was - what makes the template to be evaluated?
If it is evaluated on every change (state changed form “1” to “2”) - then this is too often and undesired.
The fact that used states.sensor is what triggers it to be re-evaluated. Though I am a little confused by that other bit of the docs that says
When merely counting states, the template is only re-rendered when a state is added or removed from the system.
I don’t know if that means that it only COUNTS the total number of states under that domain, or if it means every state change. I guess that it means it only COUNTS the number, and that won’t be re-evaluated unless a new state is added or removed. The thing that makes it confusing is do they mean state as in new data, or do they mean state as in the actual entity itself.
EDIT:
I am basing the assumption that it means entities themselves rather than the states of those entities - because it says when they are added or removed, and states are not removed, they are only updated. Entities are added and removed.
This is exactly why I posted this thread.
Evaluating the template on every change is not needed in my case - I am only interested to know a number of entities.