Assign now() to input_datetime.vakantie_einde

Hi, I like to have a input of a date and a time to set the end of my holiday.
I made a helper ‘input_datetime.vakantie_einde’ with date and time and I put this on my dashboard.
I can change the date and time and I added an automation that works perfect.

The date and time on my dashboard is the last input and I like to change that to the date and time now().
Is it possible to do that, so that the info on my dashboard is updating automatic to the current date and time?

Post deleted.

You have to do it with a script or automation. You can’t do it directly from the UI.

You could put a “refresh” input button helper next to it that triggers an automation to update the field.

What I did, is making a script to update the input.datetime with the now() =>

data:
  timestamp: "{{ now().timestamp() }}"
target:
  entity_id: input_datetime.vakantie_einde
action: input_datetime.set_datetime

and I made an automation that triggers every minute to start that script.
That is working but I was thinking that I made it to difficult.
So, thats the way to do it or not?

What are you then using that datetime entity for? I thought you wanted a way to quickly enter it into a field on your dashboard, but your script will make sure it’s always (almost) the current time.

1 Like

Well I made a dashboard card to set my end date and time when I’am back from holiday.
If there is a new time and date bigger then now() an automation is switching to holiday mode.
So the starting date and time on screen is now() and I can then add some days and a time when I want that the holiday mode is at the end…