I will explain why I develop it like this and how I use it as it may help you or anyone reading this.
My use case is to turn on my electric blanket in my bed. Depending on how cold it is depends on how long I would like my electric blanket ON. When developing it a slider is hard to set on your mobile phone and I just wanted something quick and easy. The electric blanket is plugged into a smart switch and it is turned ON for the max time. Safe guards are in the electric blanket controller so all is good.
I created 4 press button helpers and a timer helper.
Select any state change, enable all triggers, entered in my smart plug, enabled timer helper and enter in the helper.
Then I put each press button helper in each timer input.
Then with time I have one for 30 min, one for 2 hours, one for 4 hours and one for 9 hours.
Then I added each button helper into the dashboard and the timer helper (Tip: If you click on the timer helper you can stop it, pause it etc).
Now when I would like to turn on my electric blanket depending on how cold it is I just press the button for the time I would like, no slider to adjust just press.
It is a blueprint as I use this on all my beds and beds have 2 sides (2 controllers)
I don’t know if that will work for you but I thought I would explain this as it just could be what your looking for.
All your YAML looks good, just check your timer helper. Below is my one for your reference. Note the duration and the restart must be ticked so it will survive a HA restart.
I would like to switch on the light when a trigger is activated AND during night only
Another request:
could you add a notification system before and after the action ?
For instance, a notification is sent via Telegram or other solution before the light is switched on and another notification after it is back to off.
last question: how do you display remaining time of a timer please ? I can display the duration of the timer in a card but not the remaining time.
It is probably because you are using a device and not an entity. But have a look at this blueprint Manual light control with auto OFF it may be more inline with what you are trying to do.
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
My end durations were never triggering the ‘off’ state. I finally recognized I had changed “Use The Timer Helper Options” to ‘Use a timer helper’. I expected that since I hadn’t selected a Timer Helper in the next form item, that it would fall back to the default delay duration triggering the ‘off’ state but this is currently not the case. Basically, if you say you’ll use a timer helper but don’t specify one, your timer will never fire.
I suggest removing the 'Use a Timer Helper Options question altogether. You can infer from the ‘Timer Helper’ question. Use one if one is specified, otherwise don’t.
If you select to use the Timer Helper then yeah you have to input your timer helper into the Timer Helper input. In the description of Timer Helper input is states that you need to select your timer helper if you opted to use a Timer Helper. I will update it so that if you select to use a Timer Helper and you don’t select one it will not work.
From time to time, Home Assistant updates their YAML standards and coding practices. To align with their roadmap, we’ve updated the code accordingly. We will continue to apply these updates across all our blueprints as they are revised.
If you opted to use a Timer Helper and you don’t input your timer, the automation will not run.
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