⏳ Entity - Run ON Timer

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

GitHub Link Click Here

Version: 1.1

The most common automation used for a Entity Run on Timer. Select a entity so when you turn it ON the pre-set time period will turn it OFF automatically.

The Automation Process:

  • When the entity is turned ON it will then be turned OFF automatically in a pre-set time period. You can have as many entities as you like.
  • If you have multiple entities, then all the entities will turn ON automatically and then turned OFF in the pre-set time period. If you turn one entity OFF the other entities will remain ON until the pre-set time period turns it OFF or you manually turn it OFF.
  • If HA restarts and the entities are already ON, all the entities will still turn OFF automatically starting from the restart point to the end of the pre-set time period.
blueprint:
  name: Entity - Run ON Timer
  description: >
    # ENTITY - RUN ON TIMER
    
    Version: 1.1
    
    
    The most common automation used for a Entity Run on Timer. Select a entity so when you turn it ON the pre-set time period will turn it OFF automatically.
    
    
    Let us know what you think of this blueprint and for community support including updates: [Click Here](https://community.home-assistant.io/t/entity-run-on-timer/499217)
    
    
    The Automation Process:
     - When the entity is turned ON it will then be turned OFF automatically in a pre-set time period. You can have as many entities as you like.
     - If you have multiple entities, then all the entities will turn ON automatically and then turned OFF in the pre-set time period. If you turn one entity OFF the other entities will remain ON until the pre-set time period turns it OFF or you manually turn it OFF.
     - If HA restarts and the entities are already ON, all the entities will still turn OFF automatically starting from the restart point to the end of the pre-set time period.

     Need help? See our FAQ: [Click Here](https://community.home-assistant.io/t/entity-run-on-timer/499217)
  domain: automation
  input:
    trigger_input:
      name: Entities
      description: Select the entities that will be turned OFF by the below pre-set time period.
        IF more than one entity is selected then they will turn ON & OFF together automatically.
        You can select a switch, light, sensor, binary sensor or a input boolean.
      selector:
        entity:
          domain:
            - switch
            - light
            - sensor
            - binary_sensor
            - input_boolean
          multiple: true
    time_seconds:
      name: Seconds
      description: Set the delay time in seconds.
      default: 0
      selector:
        number:
          min: 0
          max: 60
          step: 1
          unit_of_measurement: seconds
    time_minutes:
      name: Minutes
      description: Set the delay time in minutes.
      default: 0
      selector:
        number:
          min: 0
          max: 60
          step: 1
          unit_of_measurement: minutes
    time_hours:
      name: Hours
      description: Set the delay time in hours.
      default: 0
      selector:
        number:
          min: 0
          max: 24
          step: 1
          unit_of_measurement: hours

mode: restart
max_exceeded: silent

variables:
  trigger_input: !input trigger_input
  time_seconds: !input time_seconds
  time_minutes: !input time_minutes
  time_hours: !input time_hours

trigger:
  - platform: state
    id: "t1"
    entity_id: !input trigger_input
    from: 'off'
    to: 'on'
  - platform: homeassistant
    id: "t2"
    event: start

action:
  - choose:
      - conditions:
          - condition:
              - condition: trigger
                id: "t1"
        sequence:
          - alias: "Turn ON the entities"
            service: homeassistant.turn_on
            entity_id: !input trigger_input
          - alias: "Wait the number of hours that has been set"
            delay:
              hours: !input time_hours
          - alias: "Wait the number of minutes that has been set"
            delay: 
              minutes: !input time_minutes
          - alias: "Wait the number of seconds that has been set"
            delay: 
              seconds: !input time_seconds
          - alias: "Turn OFF the entities"
            service: homeassistant.turn_off
            entity_id: !input trigger_input
      - conditions:
          - condition:
              - condition: state
                entity_id: !input trigger_input
                match: any
                state: 'on'
              - condition: trigger
                id: "t2"
        sequence:
          - alias: "Wait the number of hours that has been set"
            delay:
              hours: !input time_hours
          - alias: "Wait the number of minutes that has been set"
            delay: 
              minutes: !input time_minutes
          - alias: "Wait the number of seconds that has been set"
            delay: 
              seconds: !input time_seconds
          - alias: "Turn OFF the entities"
            service: homeassistant.turn_off
            entity_id: !input trigger_input

CHANGELOG

  • Version: 1.1: - 7 Dec-22 - Initial release

MY OTHER BLUEPRINTS
Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time
Smart Relay - Contactor
Push Button Relay - Contactor
Toilet Exhaust Fan with time delay
Timer Relay - Run ON Timer
Bathroom Humidity Exhaust Fan
Temperature Control Exhaust Fan
Temperature Control Exhaust Fan - Inverted
Turn Light, Switch or Scene On & Off with Trigger Conditions

1 Like

Great, thank you!
I will use it for my electric blanket :slight_smile:

1 Like