Purpose Specific Triggers, YAML support?

With the latest release, it appears to start adding support for what I understand can cover labels

I don’t see anywhere that showcases using it in our YAML. I have multiple automations that would definitely simplify utilizing this like:

  trigger:
    - trigger: state
      entity_id: label.monitor_battery_level
      to: "unavailable"
      for:
        minutes: 5

Rather than, manually listing each individual entities or getting complicated with templates.

Is this “lab feature” only for the GUI for now? Is there any known example of this that I couldn’t find?

These are still “experimental” so they’re not “fully documented”*… and there are still a significant number of triggers and conditions that are waiting to be implemented. But, you can see what the YAML will look like by playing around in the Automation editor. Here’s an example of what a label-based scene trigger and label-based light trigger look like currently:

trigger: scene.activated
target:
  label_id: favorite_scenes
trigger: light.turned_off
target:
  label_id: real_lights
options:
  behavior: any

From what I’ve seen, it looks like the current methodology is to develop each of the domain/integration-specific event versions first. So, it might be a little while before we see more open/broad triggers like the one you have described.

* With such a huge possible variety of triggers and conditions, and the possibility that integrations may be able to supply their own specific triggers in the future, these triggers may never get the degree of documentation that current triggers have. Just look at how lightly-documented Device Triggers are compared to State or Calendar triggers.

1 Like

Ah good call I didn’t think to make one and then look at the generated YAML after the fact. Thanks! Looking forward to having this implemented soon enough.