automation 3:
trigger:
# Multiple entities for which you want to perform the same action.
- platform: state
entity_id:
- light.bedroom_closet
- light.kiddos_closet
- light.linen_closet
to: "on"
# Trigger when someone leaves one of those lights on for 10 minutes.
for: "00:10:00"
action:
- service: light.turn_off
target:
# Turn off whichever entity triggered the automation.
entity_id: "{{ trigger.entity_id }}"