Last active
July 4, 2025 15:46
-
-
Save gwww/79a2e97594b6d43c1cb3acc6f6cf43e7 to your computer and use it in GitHub Desktop.
Turn off light/switch after time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Light/switch auto-off after time | |
| description: Turn off a light/switch after time has passed. On HA restart timer is restarted (for simplicity) | |
| source_url: https://gist.github.com/gwww/79a2e97594b6d43c1cb3acc6f6cf43e7 | |
| domain: automation | |
| author: Glenn Waters | |
| input: | |
| light_target: | |
| name: Light/switch | |
| selector: | |
| entity: | |
| filter: | |
| - domain: light | |
| - domain: switch | |
| auto_off_time: | |
| name: Wait time | |
| description: Time to leave the light/switch on after being turned on. | |
| default: 30 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 600 | |
| unit_of_measurement: minutes | |
| mode: restart | |
| max_exceeded: silent | |
| triggers: | |
| - trigger: state | |
| entity_id: !input light_target | |
| to: "on" | |
| - trigger: homeassistant | |
| event: start | |
| - platform: event | |
| event_type: automation_reloaded | |
| condition: | |
| condition: state | |
| entity_id: !input light_target | |
| state: "on" | |
| actions: | |
| - delay: | |
| minutes: !input auto_off_time | |
| - action: homeassistant.turn_off | |
| entity_id: !input light_target | |
| alias: "Turn off the light/switch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment