⏱ Trigger - Run ON Timer

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

GitHub Link Click Here

Perfect Timing for Every Trigger Event!:dart:

Like this blueprint? Consider hitting the :heart: button below :+1:

Version: 1.7 :fire:

:warning:You must be on Home Assistant version 2024.6 or later.

Need help? :eyes: See our FAQ: Click Here

:newspaper: The Automation Process:

  • When a trigger is activated, it turns the selected entities ON and then OFF automatically after a pre-set time period.

  • Multiple Triggers:

    • You can set up to 4 different triggers, each with its own time period.
  • Reset on Re-activation:

    • If a trigger is activated again before the time delay expires, the entities will stay ON and the time delay will be reset based on the last trigger event.
  • Timer Helper Option:

    • You have the option to use a timer helper. This is useful for displaying the remaining time on a dashboard and ensures the timer survives a Home Assistant restart.
  • HA Restart Behaviour:

    • With Timer Helper: The timer will resume as if nothing happened, which is recommended for continuity.
    • Without Timer Helper: The automation will attempt to reset to the start of Trigger 1 upon restart.

:rocket: CHANGELOG

  • Version: 1.7 - 29 July-24 - Added collapsible sections update descriptions for better understanding & new layout.
  • Version: 1.6 - 11 Nov-23 - Blueprint name change, added 3 extra triggers, change time input & can add any entity domain.
  • Version: 1.5 - 22 Oct-23 - Added HA safe guard when not using timer helper. Fixed a bug in entity selection.
  • Version: 1.4 - 22 Oct-23 - Added timer helper option, trigger to state option select any entity.
  • Version: 1.3 - 21 Sep-23 - Update deprecated code.
  • Version: 1.2 - 7 Nov-22 - Removed days and reduce hours to 4
  • Version: 1.1 - 7 Nov-22 - Initial release

:shield: MY OTHER BLUEPRINTS

:bulb: Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time
:high_brightness: Smart Light - Entity - Sun Elevation - Ambient & Time Triggers
:infinity: Sensor Light Add On - Media & Movie Lights - House Alarm Lights - Smoke Alarm Lights & Exhaust Fans + More
:shower: Bathroom Humidity Exhaust Fan
:low_battery: Low Battery Notifications & Actions
:vibration_mode: Appliance Notifications & Actions - Washing Machine - Clothes Dryer - Dish Washer - ETC
:loudspeaker: Notifications & Announcements
:calendar: Calendar Notifications & Actions
:round_pushpin: State Notifications & Actions
:robot: Android Notification Channel Manager
:toilet: Toilet Exhaust Fan with time delay
:hourglass_flowing_sand: Entity - Run ON Timer
:magic_wand: Manual light control with auto OFF
:door: Closet, Pantry, and Cupboard Lighting
:timer_clock: Timer
:thermometer: Temperature Control Fan
:snowflake: Temperature Control Exhaust Fan - Inverted
:eight_spoked_asterisk: Toggle Switch - Turn ON & OFF Entities
:nazar_amulet: Press Button - Turn ON & OFF Entities
:on: Switch - Turn ON & OFF Entities

Like this blueprint? Consider hitting the :heart: button below :+1:

11 Likes

This blueprint attempts to use a delay to simulate the function of a timer entity. The main drawback is that, unlike a timer, a delay can’t survive a restart.

The longer the duration of the delay the more vulnerable it is to termination by a restart (or simply by reloading automations in versions prior to 2022.11.0). This blueprint supports delays of hours and days which means the user should be especially careful of when they restart Home Assistant. Automations based on this blueprint may fail to run to completion (i.e. entities that were turned on won’t be turned off).

For long delays, it’s best to avoid delay and use a timer (with restore: true).

I will look into that. Thanks for the heads up but it is time for Zzzzzz

I did original have timer but having issues with it on the trigger variable

Update to Version: 1.2

On @123 advice we have removed days and limited the hours to 4 to reduce the risk of the blueprint fail to run to completion. Normally this time frame is all you will need anyway. If you need more hours just let us know.

We are going to look into timer for long delays when we get more time to spend on this blueprint.

If you have already created an automation with Version: 1.1 it will still function. If you update to Version: 1.2 we recommend you delete the automation created with Version: 1.1, update the blueprint to Version: 1.2 and add back your automation.

Thanks for your understanding.

Blacky :grinning:

Is it possible to extend the trigger domains to input_boolean? So it is easier the create a helper for this automation?

Another feature request:
Could it be possible to disable the boolean after the countdown is finished?

Update:
hmm, I think that my wishes (e.g. an additional action) have to be implemented in my own individual automation. A blueprint would be too specific.

Could you give us an example of what you are trying to do so it helps me to understand.

It wasn’t really well thought out on my part. With a normal automation it is easier with my special requests.
I want to start a timer via an input_boolean (“activate pool pump for 30min”). After the timer has expired, the input_boolean should be turned off and a pushover message should be sent.
The plan is to start a pool pump over it.

I did it now with an own automation.

New update 1.3

:warning: BLUEPRINT CODE UPDATE :exclamation:

Just a heads up if your still on a old HA version before you update.

From time to time Home Assistant update their code structure and the old code will become “DEPRECATED” stopping / breaking automations from working. It effected this blueprint about 4 to 6 months ago. I wanted to wait some time so everyone had a chance to update their HA version before updating the code as older HA versions can not run the new code. This blueprint has now been updated so it will still operate once HA remove the “DEPRECATED” code from their system. :wink: :+1:

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

Hello,
Another nice blueprint here ! :slight_smile:
I would like to use it to start a bed heater for X minutes.
I use a slider helper as input time
I use a button helper to start the timer

It works but the button entity cannot trigger the automation
If I run manually, the script works as it should.

Any idea ?

Bonus: It would be very nice if just sliding the slider could also (re)start the automation !!!
Bonus 2: display the remaining time in lovelace … is there a way to access the timer entity of the automation ?

Here is the code.
ps: entity_input: - light.salon_salon_1948 … is for testing purpose

Thanks !

alias: Couverture Chauffante
description: ""
use_blueprint:
  path: Blackshome/timer-relay.yaml
  input:
    entity_input:
      - light.salon_salon_1948
    trigger_input:
      - input_button.test_start_couverture
    time_minutes: "{{ states('input_number.test_couverture') | float }}"
    trigger_state: "on"

@sebcbien

I have updated the blueprint and gave it a bit of a tickle, I think I got most of them except the “sliding the slider”, not sure what you were talking about.

Hope this works for you

Blacky :smiley:

1 Like

New update 1.4

New Feature :new:

  • Timer Helper Added a timer helper option. By adding a timer helper it will survive a Home Assistant restart and resume its time. It also allows you to display the time in a dashboard.

    Note - When creating your timer helper, make sure you tick the box to restore so it will survive a HA restart and don’t set any time in the timer helper duration, use the time settings in the automation.

  • Entities You can add any entity you like now.

  • Trigger State You can select a trigger state “Any State Change - Example Button Helper”. This will now work with the new button helper HA released a few months ago.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

1 Like

Hello @Blacky, you are so quick, thanks !!!
Good news, everything works, even the slider now starts the automation, it’s almost perfect !

Here is the code for those who want to do the same thing:

alias: Couverture Chauffante Seb
description: ""
use_blueprint:
  path: Blackshome/timer-relay.yaml
  input:
    entity_input:
      - light.salon_salon_1948
    trigger_input:
      - input_button.couverture_35_min
      - input_number.couverture_chauffante_seb
    time_minutes: "{{ states('input_number.couverture_chauffante_seb') | float }}"
    trigger_state: state
    include_timer_helper: enable_timer_helper
    timer_helper: timer.timer_couverture_chauffante_seb

I can now just set the number with a script or trough api and my heating blanquet will start for XX minutes when I activate my go to bed mode

One more suggestion:
I think that it would simplify further the process to have a button called “heat for 20 minutes”, another one “heat for 35 minutes” etc
If the blue print could set a timer depending of the trigger it would spare the need to create an intermediate script for each button.
Here is the current result:
image

Tip:
Setting the input_number min value to -1 allows to stop the timer and turn off the entity by sliding the slider to -1

image

@sebcbien

No problem

That is a good idea, I will put it on the list. For now you could create 2 automations, one for 20min and one for 35min and use the same timer helper :wink:

Happy days

Blacky :smiley:

1 Like

Also if you click on the timer and you will see a pause, cancel and finish selection.

1 Like

Didn’t know that, very useful !

New update 1.5

New Feature :new:

  • HA Restart If not using a timer helper then the automation will try and restart to then turn your entities OFF.

Bugs Fixes :bug:

  • Fixed a bug not allowing multiple entities as a selection.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

1 Like

New update 1.6

:warning: This is a full redesign and will break your existing automation. We have also changed the name so you can keep your exiting automation and just use the import blueprint button at the top and try it out.

New Feature :new:

  • Name Change - To align with my other blueprint and hopefully for better understanding of the blueprint.
  • Triggers - You can now have 4 different triggers with 4 different run times for your entities in the one blueprint. No need to have multiple automations for different times.
  • Time Input - Removed time sliders to keep the blueprint clean now having 4 time selections.
  • Entities - You can now have any entity domain.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

1 Like

Installed and seems to work as it should :slight_smile:
Thanks !

Thought you would like it. You noticed the update it quickly. I used it for a few weeks now with the timer helper and it has been working well. Finally had time to push it out.

Blacky :smiley:

2 Likes