Multiple state triggers

Hello

I have way too many small automation’s, so I am trying to combine a few.

Which is best in this situation please? I want the hall light and front door light to turn on when one of us arrives home, even if the other one is already in the house. It is getting dark here, so like to have them come on for when my wife arrives back some nights after 8pm etc

trigger:
  - platform: state
    entity_id: device_tracker.helen
    from: 'not_home'
    to: 'home'
  - platform: state
    entity_id: device_tracker.mark
    from: 'not_home'
    to: 'home'

OR

trigger:
  - platform: state
    entity_id: device_tracker.helen, device_tracker.mark
    from: 'not_home'
    to: 'home'

Do they both do the same thing please?

Cheers
Mark

I’m not sure if the 2nd solution will work (I’ve not tried myself) but the first one will definitely work.
I too have automations based on multiple triggers.

thank you… will give it a bash.

You can provide a list of entity_ids like this:

entity_id: [device_tracker.helen, device_tracker.mark]

or like this:

entity_id: 
  - device_tracker.helen
  - device_tracker.mark

The automation will then trigger on either.

Hello guys!

Sorry to bother you: is it possible to use multiple states on “to state” part, so I don’t need to repeat this trigger?

Like this:

- alias: Alert - MQTT device unavailable
  trigger:
    platform: state
    entity_id:
      - sensor.illumination_158d0001ad6b83
      - sensor.illumination_158d0001ad6c20
      - sensor.illumination_158d0001e02f9a
      - sensor.illumination_158d0001e420d0
      - sensor.illumination_158d0001e43ef1
      - switch.chuveirosocial
      - switch.chuveirosuite
      - switch.muv203bebedouro
      - switch.sirene
      - switch.sistema_alarme_casa
      - switch.toalheiro
      - light.muv303entrada
      - light.muv303dinamica
      - switch.muv303bebedouro
      - light.muv303banheiro
    to: 'unavailable' or 'unknown'
    for:
      minutes: 5

Since I have many entities ids…

Thanks!