Like this blueprint? Consider hitting the button below
Version: 1.6
The Automation Process:
If selecting “Trigger entity state ON”, when the entity is turned ON, it will be automatically turned OFF after the pre-set time period.
If selecting “Trigger entity state OFF”, when the entity is turned OFF, it will be automatically turned ON after the pre-set time period.
You have a “Trigger Entity Sync” option. When using multiple entities and one entity changes state i.e. manually turned ON or OFF, then all the entities will be turned ON or OFF automatically in sync together.
You have the option to use a timer helper. This is useful if you would like to display the remaining time in a dashboard and the timer will survive a HA restart.
HA Restart - If you use a timer helper it will resume as nothing happened (recommended). If you don’t use a timer helper, then when HA restarts, the automation will try and reset back to the start.
CHANGELOG
Version: 1.6 - 7 Nov-23 - Added trigger ON or OFF state option. Added trigger entity sync option.
This is a lovely blueprint. Many devices have an inbuilt timer, would be great if this gave us the ability to either count down within HA or set the inbuilt timer to count down. I do prefer the count down within a device itself as it ensures that if HA loses connection for any reason, the device will still turn off.
Yea if you have a timer in the device then all you need to do is link HA to it or you will have to go into the device manually.
Yep that is one fall back using any home automation, if it can’t connect at the time to preform any task then it could be missed unless you have a 2 way conversation and the code that supports it.
It is really up to you but you could have a few lights or switches that you would like to operate at once. You may need a light and a fan on at the same time. It is why we love HA you get to choose.
Hi Blacky, is there a possibility to build something to have either different timers to choose from and one to control that entity completely manual?
Would be nice for my water-tab using it in different situations, fill my pond for xx mins. Or have it run till I stop it for continually watering.
Updated the HA restart to only trigger the automation if entities are ON. This prevents the automation running for no reason when HA is restarted. All the entities will still turn OFF automatically starting from the restart start point to the end of the pre-set time period.
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.
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
Is it possible to make this blueprint universal so it could also turn off a device for a defined time and then turn back on after the time has elapsed? (Selectable action to temporarily turn on or off).
Also, it was not clear to me that this ran EVERY TIME an entity was turned on. I like the ability to turn turn on (or hopefully off) a device for a pre-defined time but can this also be made to only run 1 time (like a 1-shot) in addition to every time like it currently does? There are many times where I have a certain automation but want to temporarily override a state but allow the existing automation to take control again. With this setup, if my existing automation turns on a device that has this blueprint applied, it will turn off every time going forward based on the time defined in the blueprint.
Yes this is possible but maybe my Timer Relay - Run ON Timer will suit you better. You can choose the state ON or OFF of an entity to then turn ON another entity.
Yes it is a run on timer, so when you turn it ON the timer will turn it OFF.
I am not realy sure what you are trying to achieve. When will it know when to do the “1-shot”. Have a look at my other blueprint and let me know if this works for you.
The other one is close but still makes this automatic. Here’s what I’m attempting to do. I can create individual automations but am hoping I won’t have to:
I have a number of things that come on upon home occupancy such as lamps, fans, etc. for the house and basement. There are times that I’m working from home and, with no one else home, I don’t need much of this on. I’m trying to find a way to turn off these selected items for a selectable time until the rest of the family comes home and they the come back on. I could active this from a push button or Apple Watch complication, for example but I don’t want these turning off every time I turn them on, only when I manually active the action. is this possible?
Have you considered using presence detection (person) so when those people are home then it will enable the items you would like. If you are home then only some items are enabled and the other items are not. My sensor light blueprint will do this but not sure if that works for you.
@Blacky thanks for the blueprint. I’ve changed it a bit and added climate entity, because wanted to control floor heating with it. Here is the updated code: run-on-timer.yaml · GitHub
I am using this to control two e-bike battery chargers. The chargers are plugged into Sonoff S31 plugs running Tasmota and connected to HA using MQTT using the Tasmota add on. I added the switch names as the entities to the automation created with this blueprint. I set the off time to 2 hours. I created an entity list dashboard that has switches for the two entities that control the plugs and one for this automation. If this automation is turned on and I turn on one of the plugs it will turn off the automation in 2 hours. That lets me charge the batteries for a fixed amount of time when they are low. If I want to fully charge them I simply turn off the automation and turn on the chargers. It works perfectly! Thanks.