I have a sensor, checking something once an hour, triggering an automation.
How do I get the automation to only do the action at a certain time?
Meaning, if the automation goes off this morning at 09:00, I want the notification 10:00 this morning. If the automation goes off at 11:00 or 13:00, I want the notification at 10:00 in the morning next day.
Either there is some command that can be uses (do_time: ‘10:00:00’) or some delay calculation template?
If so, just have the automation turn on an input_boolean and then everyday at 10am, if the input_boolean is on, send the message. After the message is played, just have an automation turn off the input_boolean.
With this approach, you would be notified at 10AM if the condition was met just as you have it outlined above. For instance, if the condition was met at 9:35AM, you would be notified at 10AM that same day. Even further, if the condition was met at 5PM, you would be notified at 10AM the next day.
Should be easy to implement. Let me know if you need any help.
Let us know how you get along. if you run into any issues, we should be able to smash through them. Don’t worry about the N00b thing. You’ll be up and flying pretty quick!
The workaround with the Boolean and two automations worked fine. Thanks!
I am still hoping to get it work with one automation. To make it easier for myself, let’s say I only want to delay the automation action to tomorrow at 10:00 hours.
alias: Test Notification
initial_state: ‘on’
trigger:
platform: state
entity_id: input_boolean.test_done
from: ‘off’
to: ‘on’
action:
I gave up doing this with one automation. At least it works using two.
To other N00bs out there who don’t want to be awakened in the middle of the night by HA update notification, set your own time.
alias: HA Update Available Boolean Set
initial_state: ‘on’
trigger:
platform: state
entity_id: sensor.ha_upstream
action:
I’ve never gone that far with time based templates, so I probably wouldn’t be of much help there. I think that the way you set it up will still be the best as I’ve never had much luck with a reliable template based trigger. Some people don’t have that experience, but I can’t for the life of me get template based triggers to be reliable without frequent service restarts to keep the timer in sync.
I think you did it best with your solution, and if it’s working, I’d stick with it.