Setting input_datetime entity

How is it possible to set the value on the input_datetime component? Using the dev service I’ve tried the following:

Domain: input_datetime
Service: set_datetime

{"entity_id":"input_datetime.new_date", "value":"2018-01-01"}

However, this doesn’t work and I’ve tried replacing the value key with other things but always get the following error…

ERROR (MainThread) [homeassistant.core] Invalid service data for input_datetime.set_datetime: extra keys not allowed @ data['value']. Got '2018-01-01'

I figured it out. For anyone else that might run into the same issue the correct way to set the datetime input value is:

{"entity_id":"input_datetime.new_date", "date": "2018-07-19"}

Or replace the date key with time if you need to set the time.

1 Like

i also noticed that in case the datetime has time and date, you have to specify both, just changing the time without the date does not work.

Did anyone have success setting the date/time using a unix timestamp?

Does this still work? I can’t seem to update the date. Trying to figure out how to do it in an automation but no luck