please let me ask another thing, since weāve now got the expand() function working very nicely in the new template engine. This new way of templating is proving costly when templates use the {{states|ā¦}} variants, creating listeners on all states, which are updated constantly. Bdraco is working hard on improving on that.
Yet, Iāve found this related issue, also very costly now, and it has to do with automations using
platform: event
event_type: state_changed
also creating listeners on all states.
example:
- alias: GitHub boolean updates sensor
id: GitHub boolean updates sensor
trigger:
# platform: state
# entity_id: >
# {{expand('group.github_repo_updates')|map(attribute='entity_id')|join(',')}}
platform: event
event_type: state_changed
condition:
>
{{trigger.event.data.entity_id in
state_attr('group.github_repo_updates','entity_id')}}
the condition checks if the triggering state_change is for one of the input_booleans made for each repo used in the HA instance, which is quite the numberā¦ so you can imagine I donāt like to write them all out individually
In the commented section, Ive illustrated a way to do the same, using the expand() function, if allowed for triggering, (which it nw obviously isnāt). very elegant, foolproof, and no further conditions needed. It would need to allow a template for the state trigger. this point work for template trigger, since that needs an evaluation to āTrueā.
long story short: will you allow this to happen, and/or is it already in development. Do think I made a FR earlier, but would gladly do so once more if needed.
btw below the reason for not writing the entities individually:
thanks for having a look if you would.