Forked from JonTheNiceGuy/Turn Off Light After Time.yaml
          
        
    
          Last active
          January 12, 2024 02:14 
        
      - 
      
- 
        Save tdiekel/88ac0967cf6d3002aa91e65e3768eb45 to your computer and use it in GitHub Desktop. 
    Automatic light or switch turn off 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: Automatic light or switch turn off after time | |
| description: 'Given a light entity, watch for it turning on, and then turn it off after a certain period of time. | |
| Based on [Turn Off Light After Time](https://gist.github.com/JonTheNiceGuy/5ac636739165dd593030c0fed16eb618) | |
| by JonTheNiceGuy' | |
| domain: automation | |
| input: | |
| light_or_switch: | |
| name: Light or switch | |
| description: Select the light or switch to monitor and control | |
| selector: | |
| entity: | |
| domain: | |
| - light | |
| - switch | |
| time: | |
| name: Duration | |
| description: The duration to leave the light or switch on for | |
| selector: | |
| duration: | |
| trigger: | |
| - platform: state | |
| entity_id: !input light_or_switch | |
| to: 'on' | |
| for: !input time | |
| condition: [] | |
| action: | |
| - service: homeassistant.turn_off | |
| data: {} | |
| entity_id: !input light_or_switch | |
| mode: single | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment