
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 the counter integration to create and delete these helpers from automations and scripts.
Devices & entitiesยถ
Spook does not provide any new devices or entities for this integration.
Actionsยถ
Spook adds the following new actions to your Home Assistant instance:
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 can make a counter, and delete it again when it is done.
Action properties | |
|---|---|
Counter: Create a counter ๐ป | |
| |
No targets | |
Optional, the | |
Newly added action | |
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, rather than quietly given a number at the end.
1 2 3 4 5 6action: 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 made in the UI or with the action above, disabled ones included. Counters set up in YAML can only be removed from the YAML.
Everything in the list is checked first: if one of them cannot be deleted, none of them are.
Action properties | |
|---|---|
Counter: Delete a counter ๐ป | |
| |
No targets | |
No response | |
Newly added action | |
Action data parameters | |||
|---|---|---|---|
Attribute | Type | Required | Default / Example |
| Yes |
|
Repairsยถ
Spook has no repair detections for this integration.
Use casesยถ
Some use cases for the enhancements Spook provides for this integration:
Let a script make the counter it needs, and clean it up again afterwards, so the helpers page only has counters you actually use.
Blueprints & tutorialsยถ
There are currently no known blueprints or tutorials for the enhancements Spook provides for this integration. If you created one or stumbled upon one, please let us know in our discussion forums.
Feature requests, ideas, and supportยถ
If you have an idea on how to further enhance this integration, for example, by adding a new action, entity, or repairs detection; feel free to let us know in our discussion forums.
Are you stuck using these new features? Or maybe youโve run into a bug? Please check the Support page on where to go for help.