Start a script tomorrow

Hi everybody,

I’m sorry to be a new to Home Assistant. I have a problem for which I need some guidance.

My problem is: There is a message that is sent to a Telegram bot, with a button that, when is pressed, shoud execute some actions the day after (tomorrow) at specific date (ie. 20:00).
I have no idea how to do that…
Any suggestions are appreciated.

How about using a date/time helper ?
Set the date/time helper:

service: input_datetime.set_datetime
target:
  entity_id: input_datetime.<your_helper>
data:
  datetime: "{{ today_at('20:00') + timedelta(days=1) }}"

and have it trigger your automation

platform: time
at: input_datetime.<your_helper>
1 Like

Wow!
I did not know about “datetime helpers”… I’ve just arranged the code for this, and it seems working. Tomorrow I’m going to check it fully functionality.

One question: If Home Assistant is rebooted, I guess the value of “input_datetime.<your_helper>” will be reset… I guess…
If so, do you know how it can be possible to store this value?

Thank you so much

Not necessarily:

If you want to keep the prior value, don’t assign a value to initial.

Glad I could help.
I am not familiar with ‘initial’ in datatime, but the value is not reset at a restart nor a reboot. Just don’t reboot at 20.00 :wink:

Ps, if you set my reply as ‘Solution’, you help others that have the same question :+1: it’s at the bottom of the response.