I’m looking at:
But I’m not sure I can do what I’m hoping… Essentially I want to setup an automation that will take any light switch that has been turned on, and after X hours, automatically turn it off if it’s still on. And I was hoping to do this without writing an automation for every light, just one that somehow takes input as both the trigger and action entity_id?
Generically I was hoping for something like:
- alias: "Turn Lights Off" initial_state: True trigger: platform: state entity_id: <trigger.template> to: 'on' for: 02:00:00 action: service: light.turn_off entity_id: <trigger.template>
Where <trigger.template> would be whatever device triggered the automation to start… Any thoughts?