The good thing with a timer is that it survives a restart and the time just continues on if you set it up correctly. Also if you restart HA and at the time you ask it to turn OFF, it is the exact time HA restarts then it will stay ON. How many time would this happen? probably a very rare occasion but is nice to know that if you start somting it you give it your best shot to make sure you turn it OFF. I do like it when you can just set the ON and OFF time with not having to do any maths, but unlike a local timer with a battery back-up this can help.
Thank you for the explanation. Good to know that timers survive a reboot (with some left over fringe cases).
In this particular blueprint, the start time appears statis, so the end time is also statis.
A start time at 7:15 with a duration of 15 minutes would be the same as start time 7:15 and end time 7:30.
I did think if a use case where I would want to adjust or extend the timer in certain events. This is not possible with a static end time, so your choice to use a timer seems to be more future/feature proof.
Hi Blacky,
I am looking for random light on/off while on vacation.
Searched the community but nothing found .
A blueprint with the ability to set a time frame when the random action
must run with a days of the week selection and calendar option.
Is this what you might create for the HA community?
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.
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)
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.
This feature was introduced in Home Assistant 2024.6, so you must have this version or later for the blueprint to work.
Maintenance
Set blueprint to my new layout.
Update input descriptions for better understanding.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
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?
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.
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.
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?
I am developing a blueprint for ceiling fans though, 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.