Counter
The counter helper in Home Assistant keeps count: it goes up or down by a step, can be reset, and can be kept between a minimum and a maximum. Handy for counting how often something happened.
Spook adds actions to create and delete these helpers from your automations and scripts.
Actions
Spook adds two actions for counters. You find them wherever you add an action, marked with a 👻.
Create a counter
Creates a new counter helper, the same as adding one on the helpers page.
Great for a script that needs to count something only for itself: it makes a counter, counts, and deletes it again when it is done. Or for setting up a new installation with the counters you always want, in one go.
How to use it
- Open the automation or script that should create the counter, and select Add action.
- Search for create a counter, and select Counter: Create a counter 👻.
- Fill in Name, like
Coffee cups. - Fill in whatever else you want to set: Initial value, Minimum, Maximum, Step, Restore or Icon. To pick the entity ID yourself, fill in Counter entity ID.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

| Action properties | |
|---|---|
| Action | Counter: Create a counter 👻 |
| Action name | counter.create |
| Action targets | No targets |
| Action response | Optional, the entity_id of the new counter |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
name | string | Yes | Coffee cups |
counter_id | string | No | coffee_cups |
initial | integer | No | 0 |
minimum | integer | No | 0 |
maximum | integer | No | 10 |
step | integer | No | 1 |
restore | boolean | No | true |
icon | string | No | mdi:coffee |
Without a counter_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 a counter_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.
Create a counter for coffee cups, and keep its entity ID for the next steps:
action: counter.create
data:
name: "Coffee cups"
counter_id: coffee_cups
maximum: 10
response_variable: created
The new counter's entity ID is then in {{ created.entity_id }}.
Delete a counter
Deletes one or more counter helpers, disabled ones included.
The other half of Create a counter: a script cleaning up the counter it made, or you clearing out the counters that piled up over the years. Everything in the list is checked first: if one of them cannot be deleted, none of them are.
How to use it
- Open the automation or script that should delete the counter, and select Add action.
- Search for delete a counter, and select Counter: Delete a counter 👻.
- Under Entity ID, choose the counters to delete.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once. Mind you: running it deletes the counter for real.

| Action properties | |
|---|---|
| Action | Counter: Delete a counter 👻 |
| Action name | counter.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 | counter.coffee_cups |
Delete the coffee cups counter:
action: counter.delete
data:
entity_id: counter.coffee_cups
- Only counters made in the UI or with Create a counter can be deleted. Counters set up in YAML can only be removed from the YAML.
Use cases
What people use this for:
- Let a script make the counter it needs, and clean it up again afterwards, so the helpers page only has counters 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.
Home Assistant Link
Spook adds switches for Home Assistant Link, so you can turn Alexa, Google Assistant and remote access on and off from a dashboard or an automation.
Cover
Spook adds actions that move a cover in Home Assistant a step further open or closed, without working out the new position yourself.


