Input datetime
The input datetime helper in Home Assistant holds a date, a time, or both, that can be set from a dashboard or from automations, and used as a trigger. An alarm clock you can put on a dashboard, for example.
Spook adds actions to the input datetime integration to create and delete these helpers from automations and scripts.
Actions
Spook adds two actions for input datetimes. You find them wherever you add an action, marked with a 👻.
Create an input datetime
Creates a new input datetime helper, the same as adding one on the helpers page.
Some moments only matter for a while. The time the guests are due, the day the holiday ends, the moment a script should check back. Made by hand, that helper stays on the helpers page long after. Made with this action, the script makes it when it needs it, and deletes it when it is done.
How to use it
- Open the automation or script that should make the helper, and select Add action.
- Search for create an input datetime, and select Input datetime: Create an input datetime 👻.
- Fill in Name, like
Wake up. - Turn on Has a date, Has a time, or both. At least one has to be on.
- Optionally, set Input datetime entity ID to pick the entity ID yourself, Initial value, and Icon.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

| Action properties | |
|---|---|
| Action | Input datetime: Create an input datetime 👻 |
| Action name | input_datetime.create |
| Action targets | No targets |
| Action response | Optional, the entity_id of the new input datetime |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
name | string | Yes | Wake up |
input_datetime_id | string | No | wake_up |
has_date | boolean | No | false |
has_time | boolean | No | true |
initial | string | No | 07:30:00 |
icon | string | No | mdi:alarm |
At least one of has_date and has_time has to be on, and both are off when left out, so give at least one. An initial value has to be something Home Assistant can read as a date, a time, or both. One it cannot read is refused before anything is made.
Without an input_datetime_id, the entity ID follows the name, as it does in the UI, and gets a number at the end if that name is already taken. With an input_datetime_id, you get exactly that entity ID or an error: one that is already taken is refused, and does not get a number at the end.
Make a wake up time, set to half past seven, and keep its entity ID for the steps after it:
action: input_datetime.create
data:
name: "Wake up"
input_datetime_id: wake_up
has_time: true
initial: "07:30:00"
response_variable: created
The new input datetime's entity ID is then in {{ created.entity_id }}.
Delete an input datetime
Deletes one or more input datetime helpers.
The other half of Create an input datetime: the script that made a helper cleans it up again. It works on any input datetime made in the UI as well, disabled ones included.
How to use it
- Open the automation or script that should do the cleaning up, and select Add action.
- Search for delete an input datetime, and select Input datetime: Delete an input datetime 👻.
- Under Entity ID, choose the input datetimes to delete.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once. Mind that it really deletes.

| Action properties | |
|---|---|
| Action | Input datetime: Delete an input datetime 👻 |
| Action name | input_datetime.delete |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
entity_id | string | list of strings | Yes | input_datetime.wake_up |
Remove the wake up time again:
action: input_datetime.delete
data:
entity_id: input_datetime.wake_up
- Input datetimes set up in YAML can only be removed from the YAML. Asking for one is an error.
- Everything in the list is checked first: if one of them cannot be deleted, none of them are.
Use cases
What people use this for:
- Let a script make the date or time it needs, and clean it up again afterwards, so the helpers page only has input datetimes you actually use.
Missing something here?
An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.
Input button
Spook adds actions to create and delete input button helpers in Home Assistant from your automations and scripts, without a trip to the helper settings.
Input number
Spook adds actions to create and delete input number helpers, jump them to their minimum or maximum, change their range, and step them by any amount.


