Automation help please (again)

what would be the right syntx if I would like to add another entitiy to be turned off at this automation (ignore the condition…)

alias: 'Turn Off second floor Bathroom light '
description: After 15Min
trigger:
  - type: no_motion
    platform: device
    device_id: 42a53a88cd153c09ebb714c8d162510b
    entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_4b1c8b06_ias_zone
    domain: binary_sensor
    for:
      hours: 0
      minutes: 15
      seconds: 0
condition:
  - condition: state
    entity_id: *********
    state: 'off'
action:
  - service: switch.turn_off
    target:
      entity_id: switch.childern_bath_2_2
mode: single

Hey don‘t you just use the graphical automation editor?

you are right, tried and succeeded :frowning:

For future info…

action:
  - service: switch.turn_off
    target:
      entity_id: 
        - switch.childern_bath_2_2
        - switch.some_other_switch

nope, didn’t work, only this worked:

action:
  - service: switch.turn_off
    target:
      entity_id: switch.childern_bath_2_2
  - service: switch.turn_off
    target:
      entity_id: switch.childern_bath_3
mode: single

It should have.

It’s always worked that way in the past and I just checked in the UI services tab and when I added two entities looking at the resulting yaml it is exactly as I posted it above (aside from a blank “data:” line).

image

unless there is a bug.

But I guess I don’t know what you mean “didn’t work”.

It didn’t pass config validation or didn’t actually switch off both switches?

really strange I added with the UI and got another result (the one mentioned above,
didn’t work, i.e when I tried adding through the yaml way (in the ui) as you suggested, it erased automatically the second entity

Maybe you messed up file permissions during manual editing?

Could be, how can I check?

ls -la /config/automations.yaml