If you want specific time control (or more control in general since automations are far more powerful) of when an entity is updated, an automation makes a lot more sense for the use case:
Itās possible you took what I wrote out of context. I was referring specifically to mf_socialās template whose purpose is to identify unavailable entities.
What are the odds of entities in these domains being unavailable: automation, zone, script, scene, etc?
If the odds are next to zero then it stands to reason one shouldnāt check them. In other words, for the purpose of this specific template, we donāt need to assign listeners to entities in those domains. However, thatās precisely what happens given that the template begins with {{ states | etc ... }}
. Therefore the template is evaluated for every possible state-change in the system, including entities that have no practical impact on this particular template.
Thatās why I suggested narrowing the field by using something like {{ expand(states.sensor, states.binary_sensor, states.light, states.switch) | etc ... }}
. At least this way listeners are assigned exclusively to the kind of entities this template is interested in and updated only when one of these āentities of interestā changes state.
The automation wonāt supersede the listeners that the system will automatically assign to the entities it detects in the complex template.
That was my point; thereās no longer a means of superseding the automatic assignment of listeners. My automation might be evaluating the template every 15 or whatever minutes but that complex template will also be evaluated by the boatload of automatically assigned listeners.
The automation isnāt using a template entity.
AND its not a sensor.
It writes to an input text
I see what you mean; use an automation instead of a Template Sensor.
That begs the question, how are the results of this automation supposed to be reported? I know I can publish via an MQTT Sensor but, man oh man, this is a long way around for what was easy-peasy with a Template Sensor.
Precisely and feh!
Sorry, I read it again now and see that I picked a poor quote to frame my point. The point still stands, though ā¦ just skip my first paragraph
So create a sensor that reads the input text
Early flagelation of post animation equus ferus negated
(cpu death prevented)
Based on some of the provided templates, and feedback there are a few more template performance improvements coming in 0.116
https://github.com/home-assistant/core/pull/40012 (merged)
https://github.com/home-assistant/core/pull/40250 (waiting for review)
https://github.com/home-assistant/core/pull/40272 (builds on #40250)
https://github.com/home-assistant/core/pull/40323 (builds on #40272)
Can you elaborate on what the PRs mean when they state they improve performance of templates involving ācounting statesā?
What comes to mind is the count
filter but I doubt thatās what the PRs mean.
It is anything that looks at the number of states but does not access the state object attributes. The count
filter is a good example of this.
Thanks heaps for the code help, Iāve copied it across not, time to test . Iām actually in Kangaroo land though
EDIT: and in the west here we donāt have daylight savings because the farmers are worried that the cows will get confused
That explains the sideways picture
Sod the cows (just donāt give them watches), itās me that gets confused with DST
Iām working out a āfoolproofā way (if it works for me itās foolproof) of sorting this, I hope to come back to it soon.
So are you doing a Priscilla thing, visiting family or back for good ? (and is that because I called you Mike ?)
Cheers
At least we put our clocks forward by 1 hour so thatās one less hour of 2020 we have to endureā¦
Donāt worry, come October thereās an hour in there weāll make you live twice (a la groundhog day)
No that will be April 2021. We go forward an hour in a week or so.
Ah, southern hemisphereā¦
We are last weekend in March and last weekend in October (forward and back)
So you are back and forward in???
I donāt actually use scenes and zones, but Iām fairly confident that their state objects never change, they are just either there (scening and zoning) or not.
So I think that only listening to automations and scripts is āextraneousā, but I donāt think itās āexpensiveā.