Documentation for v2.19

This commit is contained in:
Philip Abbey
2024-08-29 23:12:13 +01:00
parent 17162c14f2
commit df3be94bf9
4 changed files with 27 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Actions
A simple example using a scene as a `tap`` menu item.
A simple example using a scene as a `tap` menu item.
```json
{

View File

@ -43,6 +43,17 @@ Then you can use the following in your config:
}
```
And you can optionally include a template to reflect some status. See [Templates](Templates.md) for details on hwo to use this JSON field.
```json
{
"entity": "switch.<switch-name>",
"name": "<name>",
"type": "toggle",
"content": "..."
}
```
## Example - Covers
```yaml

View File

@ -118,6 +118,20 @@ Note: Only when you use the `tap_action` field do you also need to include the `
}
```
## Group and Toggle Menu Items
Both `group` and `toggle` menu items accept an optional `content` field as of v2.19. This allows the use of templates to present status information.
```json
{
"name": "Each Lounge Light",
"title": "Lounge",
"type": "group",
"content": "{{'On: %d, Off: %d'|format(expand(state_attr('light.living_room_lights', 'entity_id'))|selectattr('state','eq','on')|map(attribute='entity_id')|list|count, expand(state_attr('light.living_room_lights', 'entity_id'))|selectattr('state','eq','off')|map(attribute='entity_id')|list|count)}}",
"items": [..]
}
```
## Advanced
Here we generate a bar graph of the battery level. We use the following steps to do this: