⏲ Timer

@Fred54

I have started this but never finished it and it just got forgotten. I will put it on my list so I don’t forget again.

Blacky :smiley:

I wanted to create a timer to " turn on a switch for 1 hour and then turn it off for half an hour. and then repeat" I did try this blueprint but it only runs once at 00:00 hours and doesn’t repeat for the next 24 hours. yaml code for the automation it created.
1 min on and 30sec off was used to test the automation only.

alias: "Timer for zigbee relay "
description: ""
use_blueprint:
  path: Blackshome/timer.yaml
  input:
    trigger_one_duration:
      hours: 0
      minutes: 0
      seconds: 30
    timer_helper: timer.1_hour_timer
    entity_input:
      entity_id: light.relay_1_light
    trigger_two_duration:
      hours: 0
      minutes: 1
      seconds: 0
    include_extra_triggers:
      - use_trigger_two

@yousaf465

In this blueprint you can turn ON and OFF 4 times a day.

Blacky :smiley:

you mean I have to use 4 timers to turn and off 4 times?

No, you have one timer, that timer can be use to turn ON and OFF your entities 4 times a day + it can move to the next day as long as it starts (see timer 4).

Example;

Timer 1 - Start Time = 6 am (ON at 6 am)
Timer 1 - Duration = 2 hrs (OFF at 8 am)

Timer 2 - Start Time = 9 am (ON at 9 am)
Timer 2 - Duration = 2 hrs (OFF at 11 am)

Timer 3 - Start Time = 5 pm (ON at 5 pm)
Timer 3 - Duration = 3 hrs (OFF at 8 pm)

Timer 4 - Start Time = 9 pm (ON at 9 pm)
Timer 4 - Duration = 6 hrs (OFF at 3 am)

Blacky :smiley:

New Update 1.2

:new: New Feature - Collapsible Sections

  • Collapsible Sections - Added collapsible sections to the blueprint. This enhancement improves the blueprint user interface by making it cleaner and more organized, allowing sections to be collapsed.

    :warning: This feature was introduced in Home Assistant 2024.6, so you must have this version or later for the blueprint to work.

:toolbox: Maintenance

  • Set blueprint to my new layout.
  • Update input descriptions for better understanding.

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

Hey Blacky,

I’m using this blueprint for a 16h on 8h off light setup. If home assistant is updated or restarted during the on duration it seems it looses track of the elapsed time and duration remaining. Is it feasible to fix this or might be unfixable?

@rs_007

Are you talking about the time it takes to restart HA is lost in the timer? If so that is a HA thing. So when HA restart it pauses the timer and then when it starts again it restarts the timer but you must tick restore. I hardly notice as my restart is about 1 second. I know my NUC running HA is a overkill but it fast.

Blacky :smiley:

Perhaps it might be on upgrades my home assistant core auto updates on Sunday (docker image) I’ve noticed once so far that the timer is going longer then the set duration

I could be… the reason we use a timer here is because if you have a long time like 4 hours and then you restart HA just before it ends it wont start from the start of 4 hours, it just completes the remain time… yes you have to add the restart time but that is normally not that much and it is the only way it can be done.

Blacky :smiley:

Aloha Blacky, I’m relatively new to HA and like your blueprint. I’m using this to turn on a ceiling fan at 8:30pm to run for a few hours, nightly. How can I add another condition (presence sensor) so that the timer doesn’t run when I’m away?

@Phily808

Aloha Phil, welcome to the community

This blueprint is just a basic timer.

I am developing a blueprint for ceiling fans though, :thermometer: Temperature Control Fan. It currently works of temperature but time, device tracker, maybe presence would be some condition I would consider adding to it. Looks like you live in Hawaii and it would be a good place to get some feedback from you and your thoughts on my other blueprint.

I am thinking rise in temp + time condition + HA knows your home = fan ON. Maybe have a look at the other blueprint and if you like post something in that thread.

Blacky :smiley:

Thank you for your blueprint. I’ve been using it for a long time. Since it’s almost Christmas and the houses are beautifully lit, I would like to use your timer for the Christmas lights.
Unfortunately I’m missing 3 options. 1. Turn on entities at sunset. 2. Turn off entities at a certain time. 3. Only turn on entities when I’m home.

Why do I need the options? The outside lighting should always come on at sunset or shortly before and turn off at 11 p.m.
The lighting inside should also come on at sunset, but only when I’m home. I would always turn it off myself.

Would that be possible?

@TheBermud

If you would like to achieve options 1 & 2 then try my :high_brightness: Smart Light.

If you would like to achieve options 1, 2 & 3 try my :bulb: Sensor Light. For this one you would set it up like this.

  1. Create a schedule helper for the trigger making your start time well before sunset and your finish time at 11 pm.
  2. Use the sun elevation condition.
  3. Use the Device Tracker Options so it will only work when your home.

Hope this helps you.

Blacky :smiley:

1 Like

Thank you for your answer. This helps a lot :slight_smile:

1 Like

Does this blueprint help, if I want to run send a TTS notification to the companion app based on time and motion trigger and run it only once per day, is there an option to set for it to run only once per day?

@marksev1

No it will not work for what your asking. Looks like this would be a custom automation.

Blacky :smiley:

Depending on what you want to achieve:

  • time trigger with motion as condition
  • motion as trigger with time as condition

Create a helper that you turn on/off with the automation and off/on at the end of the day as a condition as well.

Yeah the bullet points I’m aware and can do it in the graphical automation editor, but regarding the helper I’m a bit confused on how to do.

Your TTS notification automation/script turns the helper off and somewhere, after it has run (overnight?) you turn the helper back on.
In that TSS notification automation/script, you use that helper as a general condition to execute it.

I’m doing it this way and turn that helper on when the sleeptime routine is activated.