-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add documentation for counter component #3250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| --- | ||
| layout: page | ||
| title: "Counter" | ||
| description: "Instructions how to integrate counters into Home Assistant." | ||
| date: 2017-08-26 06:00 | ||
| sidebar: true | ||
| comments: false | ||
| sharing: true | ||
| footer: true | ||
| logo: home-assistant.png | ||
| ha_category: Automation | ||
| ha_release: 0.53 | ||
| --- | ||
|
|
||
| The `counter` component allows one to count occurrences fired by automations. | ||
|
|
||
| To add a counter to your installation, add the following to your `configuration.yaml` file: | ||
|
|
||
| ```yaml | ||
| # Example configuration.yaml entry | ||
| counter: | ||
| counter: | ||
| initial: 30 | ||
| step: 1 | ||
| ``` | ||
|
|
||
| Configuration variables: | ||
|
|
||
| - **[alias]** (*Required*): Alias for the slider input. Multiple entries are allowed. | ||
| - **name** (*Optional*): Friendly name of the slider input. | ||
| - **initial** (*Optional*): Initial value when Home Assistant starts. Defaults to 0. | ||
| - **step** (*Optional*): Step value for the slider. Defaults to 1. | ||
| - **icon** (*Optional*): Icon for entry. | ||
|
|
||
| Pick an icon that you can find on [materialdesignicons.com](https://materialdesignicons.com/) to use for your input and prefix the name with `mdi:`. For example `mdi:car`, `mdi:ambulance`, or `mdi:motorbike`. | ||
|
|
||
| ## {% linkable_title Services %} | ||
|
|
||
| ### {% linkable_title Media control services %} | ||
| Available services: `increment`, `decrement`, and `reset`. | ||
|
|
||
| #### {% linkable_title Service `counter/increment` %} | ||
|
|
||
| Increments the counter with 1 or the given value for the steps. | ||
|
|
||
| | Service data attribute | Optional | Description | | ||
| | ---------------------- | -------- | ----------- | | ||
| | `entity_id` | no | Name of the entity to take action, e.g., `counter.count0`. | | ||
|
|
||
| #### {% linkable_title Service `counter/decrement` %} | ||
|
|
||
| Decrements the counter with 1 or the given value for the steps. | ||
|
|
||
| | Service data attribute | Optional | Description | | ||
| | ---------------------- | -------- | ----------- | | ||
| | `entity_id` | no | Name of the entity to take action, e.g., `counter.count0`. | | ||
|
|
||
| #### {% linkable_title Service `counter/reset` %} | ||
|
|
||
| With this service the counter is reset to its initial value. | ||
|
|
||
| | Service data attribute | Optional | Description | | ||
| | ---------------------- | -------- | ----------- | | ||
| | `entity_id` | no | Name of the entity to take action, e.g., `counter.count0`. | | ||
|
|
||
|
|
||
| ### {% linkable_title Use the service %} | ||
|
|
||
| Select <img src='/images/screenshots/developer-tool-services-icon.png' alt='service developer tool icon' class="no-shadow" height="38" /> **Services** from the **Developer Tools**. Choose **counter** from the list of **Domains**, select the **Service**, enter something like the sample below into the **Service Data** field, and hit **CALL SERVICE**. | ||
|
|
||
| ```json | ||
| { | ||
| "entitiy": "counter.count0" | ||
| } | ||
| ``` | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the image missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, my bad, you can ignore this one 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an issue with Github preview. Will only be visible after deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually running branches locally when reviewing...
Nevertheless, it was an issue on my end 👍