---
title: "Input boolean"
description: "Spook adds actions to create and delete input boolean (toggle) helpers in Home Assistant from your automations and scripts, and to turn them on or off for a while."
canonical_url: "https://spook.boo/input-boolean"
---
# Input boolean

> Spook adds actions to create and delete input boolean (toggle) helpers in Home Assistant from your automations and scripts, and to turn them on or off for a while.

The input boolean helper in Home Assistant is a toggle: on or off, controlled from a dashboard or from automations, and usable as a trigger or condition.

Spook adds actions to the input boolean integration to create and delete these helpers from automations and scripts, and to turn them on or off for a while.

## Actions

Spook adds four actions for input booleans. You find them wherever you add an action, marked with a 👻.

### Create an input boolean

Creates a new input boolean (toggle) helper, the same as adding one on the helpers page.

Some flags are only needed for a while. A script that runs a party mode, a move, a holiday: it needs a toggle to remember "this is going on", and nothing else ever looks at it. Made by hand, that toggle stays on the helpers page forever. Made with this action, the script makes it when it starts, and [deletes it](#delete-an-input-boolean) when it is done.

**How to use it**

1. Open the automation or script that should make the toggle, and select **Add action**.
2. Search for **create an input boolean**, and select **Input boolean: Create an input boolean 👻**.
3. Fill in **Name**, like `Guest mode`.
4. Optionally, set **Input boolean entity ID** to pick the entity ID yourself, **Initial value**, and **Icon**.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.create) opens it in your Home Assistant, ready to run once.

![The Actions tool with Create an input boolean 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-input-boolean-create.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Input boolean: Create an input boolean 👻 |
| Action name | `input_boolean.create` |
| Action targets | No targets |
| Action response | Optional, the `entity_id` of the new input boolean |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.create) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.create) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | Yes | `Guest mode` |
| `input_boolean_id` | string | No | `guest_mode` |
| `initial` | boolean | No | `false` |
| `icon` | string | No | `mdi:account-multiple` |

Without an `input_boolean_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_boolean_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.

**Example actions in YAML**

Make a guest mode toggle, and keep its entity ID for the steps after it:

```yaml
action: input_boolean.create
data:
  name: "Guest mode"
  input_boolean_id: guest_mode
  initial: false
response_variable: created
```

The new input boolean's entity ID is then in `{{ created.entity_id }}`.

### Delete an input boolean

Deletes one or more input boolean helpers.

The other half of [Create an input boolean](#create-an-input-boolean): the script that made a toggle cleans it up again. It works on any input boolean made in the UI as well, disabled ones included.

**How to use it**

1. Open the automation or script that should do the cleaning up, and select **Add action**.
2. Search for **delete an input boolean**, and select **Input boolean: Delete an input boolean 👻**.
3. Under **Entity ID**, choose the input booleans to delete.
4. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.delete) opens it in your Home Assistant, ready to run once. Mind that it really deletes.

![The Actions tool with Delete an input boolean 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-input-boolean-delete.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Input boolean: Delete an input boolean 👻 |
| Action name | `input_boolean.delete` |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.delete) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.delete) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `entity_id` | string \| list of strings | Yes | `input_boolean.guest_mode` |

**Example actions in YAML**

Remove the guest mode toggle again:

```yaml
action: input_boolean.delete
data:
  entity_id: input_boolean.guest_mode
```

**Known limitations**

- Input booleans 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.

### Turn on for

Turns input booleans on for a while, and turns them back off when the time is up. Spook stores when each one is due back, so a restart of Home Assistant in between does not stop that.

It is [Turn on for](https://spook.boo/misc#turn-on-for), with the same rules, for input booleans only. Named outright, anything that is not a input boolean is refused with an error. Picked up through an area, a device, a floor, a label or a group, it is passed over.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **turn on for**, and select **Input boolean: Turn on for 👻**.
3. Under **Targets**, choose the input booleans.
4. Set **Duration** to how long they should stay on, like `00:15:00` for fifteen minutes.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.turn_on_for) opens it in your Home Assistant, ready to run once.

**Technical details**

| Action properties |
| --- |
| Action | Input boolean: Turn on for 👻 |
| Action name | `input_boolean.turn_on_for` |
| Action targets | Yes, `input_boolean` entities |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.turn_on_for) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.turn_on_for) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `duration` | string | Yes | `00:15:00` |

**Example actions in YAML**

Guest mode, for the evening:

```yaml
action: input_boolean.turn_on_for
target:
  entity_id: input_boolean.guest_mode
data:
  duration: "04:00:00"
```

**Known limitations**

- The rules of [Turn on for](https://spook.boo/misc#turn-on-for) apply: only something plainly `on` or `off` is held. Something already on is left alone, and turning it off yourself ends the hold.

### Turn off for

Turns input booleans off for a while, and turns them back on when the time is up. Spook stores when each one is due back, so a restart of Home Assistant in between does not stop that.

It is [Turn off for](https://spook.boo/misc#turn-off-for), with the same rules, for input booleans only. Named outright, anything that is not a input boolean is refused with an error. Picked up through an area, a device, a floor, a label or a group, it is passed over.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **turn off for**, and select **Input boolean: Turn off for 👻**.
3. Under **Targets**, choose the input booleans.
4. Set **Duration** to how long they should stay off, like `00:30:00` for half an hour.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.turn_off_for) opens it in your Home Assistant, ready to run once.

**Technical details**

| Action properties |
| --- |
| Action | Input boolean: Turn off for 👻 |
| Action name | `input_boolean.turn_off_for` |
| Action targets | Yes, `input_boolean` entities |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.turn_off_for) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=input_boolean.turn_off_for) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `duration` | string | Yes | `00:30:00` |

**Example actions in YAML**

Notifications, off for an hour:

```yaml
action: input_boolean.turn_off_for
target:
  entity_id: input_boolean.notifications
data:
  duration: "01:00:00"
```

**Known limitations**

- The rules of [Turn off for](https://spook.boo/misc#turn-off-for) apply: only something plainly `on` or `off` is held. Something already off is left alone, and turning it on yourself ends the hold.

## Use cases

What people use this for:

- Let a script make the flag it needs, and clean it up again afterwards, so the helpers page only has toggles you actually use.


## Sitemap

See the full [sitemap](https://spook.boo/sitemap.md) for all pages.
