I’m wanting to make a dynamic automation that acts on a number of sensors, the list of which will change.
I am using the 17track platform, and want to trigger an automation based on whether or not the “info_text” attribute contains a string. That’s easy enough using a template condition (or trigger) of:
{{ 'out for delivery' in state_attr('sensor.17track_package_my_package', 'info_text')|lower }}
The problem is that I don’t want to have to build new or edit my automations every time a new package shows up in 17track. Is there any way to essentially do:
{{ 'out for delivery' in state_attr('sensor.17track_package*', 'info_text')|lower }}
Is there a way to do this kind of wildcard trigger? Should I just give up and use AppDaemon?
Interesting note, I am on latest and saw that change, but my entities are still named sensor.17track… I think it’s not the entity_id that changed, but the entity name.
Automation triggers on any entity update but only if the entity_id starts with “sensor.17track_package” AND “out for delivery” OR “delivered” is in the info_text of the sensors attribute.