Ability to use wildcards in triggers #27
Replies: 4 comments 18 replies
-
|
I 2nd your feature request to specify multiple entities in the automation's Trigger without having to individually list them, but I think it should be implemented consistently with how multiple entities are collectively being specified in the automation's Action: by enabling Areas in Trigger same way they are in Target. So all entities or devices assigned to that/those area(s) would be included. In almost exactly your use case, in lieu of the wildcard feature you request, I had to manually list ALL the trigger entities in the Trigger section, but at least in the Action section I used
meaning "do the Action in whichever area the active trigger was in". This last bit let me massively reduce the number of redundant automations (same stuff, different room) by targeting "the trigger's area". Relevant: https://github.com/orgs/home-assistant/discussions/172 The rationale for Areas based entity grouping in the trigger section rather than entity wildcards boils down to:
|
Beta Was this translation helpful? Give feedback.
-
|
I don't have a specific solution to suggest, but I think it's important to highlight the spirit of the original request, which is to be able to create a single automation that will capture all entities of a certain type (battery percentage being the most obvious example), with any entities added/removed in future automatically being detected by the automation. In my case, the main problem I'd like to solve is getting a notification if a zigbee sensor (anywhere in my house) is on low battery, without needing to track every zigbee sensor in an automation since there's a lot of them and I'm often adding/removing them. Wildcards seem like a natural choice here to my programmer brain, but there might be a better UX solution apparent to someone more familiar with the HA framework. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, I just unmarked this answer - the topic/feature request should still be open. As you indicate yourself as well: this is not the solution that was asked for. One of the further specifications indicated the battery use-case as an example, and yes: that's now possible - but that was not my request or suggestion. To illustrate the misalignment:
This was not the spirit of the request. I don't want to capture all entities of a certain type, I requested it to be name-based. I can use wildcards in recorder, logbook - why not in automations? |
Beta Was this translation helpful? Give feedback.
-
|
For the record (phun intended): recorder and logger settings do allow wildcards 🤷🏻 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature
It would be great to have wildcard support in state triggers, so one can simplify automations. The idea would be to trigger on any state change of matching entities.
I.e. Trigger on sensor.tgtg_* :
Use cases
The ability to create one automation/script that triggers on the state of multiple possible entities, i.e. battery_level sensors, humidity sensors, Too good to go sensors - you name it - by using a wildcard.
Current workarounds
No response
Anything else?
See also https://community.home-assistant.io/t/how-to-get-wildcard-state-triggers/471625 for a complex workaround.
Beta Was this translation helpful? Give feedback.
All reactions