List of states in an automation trigger? Is this valid syntax?

I’m pretty sure, I read something about using lists for state triggers in automations in one of the last HA release notes, but this doesn’t seem to be mentioned in the docs.

Although the syntax checker doesn’t complain about this trigger…

    - entity_id: sensor.spulmaschine_status
      platform: state
      to:
        - an_trocknen
        - an_spuelen
        - an_waschen
        - an_heizen

I’m not sure, if this is actually working, i.e. firing, if sensor.spulmaschine_status changes to one of the states in this list.

My question: Is this valid syntax for an automation trigger?

Ok, found what I was looking for. Version 0.112 introduced multiple states and entities for automations, but for conditions rather than triggers. Thus, the syntax above may not work as expected, if at all.

But I think it should be possible to achieve a similar result with a combination of a trigger omitting the to: clause and putting the list of states in a condition below…

Now would be the time to request this sort of trigger. Here:

https://community.home-assistant.io/c/what-the-heck/52

Yeah, maybe it’s worth a shot.

I don’t think it will work. An entity’s state is a string value. Your trigger is has set the to: option to be a list not a string. There’s nothing in the documentation that suggests each item in the list will be compared with the entity’s state.

In addition, what was introduced in 0.112 has nothing to do with what your example is attempting. 0.112 provided a streamlined way of combining multiple triggers, not combining multiple states.