How to set date/time helper to current date?

I need to set a dete/time helper created for an alarm to be set to current date, so i don’t need to set the alarm everyday

How can i do it?

I see there’s the input_datetime service, not really sure what to put so that it can set todays date in the helper

Why don’t you use the scheduler or calendar functionality?

The blueprint i’m using requires an input_datetime

I could create a new automation from scratch but it would require more time, not sure if it’s worth it

This one Wake-up light alarm with sunrise effect

Then there is the service “Input Datetime: Set” which you can use in an automation, you ‘just’ need to find out how to format the date as per the blueprint

That’s the problem, also the input sets date and time, i just need to set the date

so what does it need to look like?

This is the simple setup, setting it to ‘today’

service: input_datetime.set_datetime
  entity_id: input_datetime.test_datetime
  date: "{{ now().strftime('%Y-%m-%d') }}"

EDIT: I meant: this can be the ‘action’ that you add to an automation that triggers daily

1 Like

Thanks it worked! love you!

EDIT: What if i wanted to set the date to tomorrow instead?

How would you automate that?
A blueprint probably does not lauch tomorrow (it should not)

The automation is for an alarm, so an alarm should be set for tomorrow, not today

{{ (now()+ timedelta(days=1)).strftime(’%Y-%m-%d’) }}

Getting this error

Message malformed: template value should be a string for dictionary value @ data[‘action’][0][‘data’

show code please, did you use the quotes ?

EDIT: you should try this out with dev tools > template and/or services before going in the overall automation

service: input_datetime.set_datetime
  date: "{{ (now()+ timedelta(days=1)).strftime(’%Y-%m-%d’) }}"
  entity_id: input_datetime.sveglia

The single-quotes are wrong, use ’ instead of ’
It is hardly visible but one is a comma-alike character, the other more a tick

Worked thanks :heart:

Why not just use a time-only input_datetime?

Asked OP similar, iI did not spend much on detail but he needs to update the helper…hence

Ok I’ll give you a more complete reply.

I’m using this to sync iOS alarms to HA, then I run an automation for the alarm

In the discussion it says

  • It works with a one time modified scheduled alarm as well, but NOT with non-repeating alarms. They lack a date and can’t be used. A possible workaround could be to use names when setting those kind of alarms and filter those within the shortcuts-automation.

So i suppose date is also required. Not sure why but I don’t want to spend too much time on it.

Apart from the iOS shortcut, I have tried to run the blueprint with an input time only and it did not seem to work, no idea why.

I suppose if I ever decide to disable this iOS shortcut, I could just use the time input. I still have to decide if it’s more convenient to set the alarm via iOS or HA