Skip to content

Commit

Permalink
add lovelace examples to readme
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Helming <[email protected]>
  • Loading branch information
chelming committed Feb 28, 2024
1 parent 73d0b3a commit ad9e584
Showing 1 changed file with 118 additions and 0 deletions.
118 changes: 118 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,121 @@ Unlike the old configuration.yaml approach, the integration will create its own
This method of configuring the integration is still available but is meant primarily to allow for easy upgrades for people using the original integration. On startup, the integration will look for the presence of the configuration and import it into a config entity. The intent here is that once setup, all your entity names, etc. If you subsequently change the configuration.yaml, the next HA restart will re-sync your changes into the config entity. However, it is recommended that once the initial import has been done and confirmed working that the entries in configuration.yaml are removed.

Because the name of the integration has been changed (for now) to avoid conflict with the official packaged version, you will need to change your `envisalink` heading to `envisalink_new` so that this HACS integration will pick it up.

## Lovelace Cards

By installing the [auto-entities](https://github.com/thomasloven/lovelace-auto-entities) card, you can create cards to dynamically display the status of all of your zones.

#### All zones with their status, sorted by zone
```yaml
type: custom:auto-entities
card:
type: entities
title: All zones
filter:
include:
- attributes:
zone: $$*
options:
state_color: true
sort:
method: attribute
attribute: zone
numeric: true
```
#### Zones that are currently open
```yaml
type: custom:auto-entities
card:
type: entities
title: Open zones
filter:
include:
- attributes:
zone: $$*
state: on
options:
state_color: true
secondary_info: last-updated
sort:
method: attribute
attribute: zone
numeric: true
```
#### Zones that have been triggered in the last hour, ordered by the most recent
```yaml
type: custom:auto-entities
card:
type: entities
title: Recent zones
filter:
include:
- attributes:
zone: $$*
last_tripped_time: '< 1h ago'
options:
state_color: true
secondary_info: last-updated
sort:
method: last_changed
reverse: true
```
#### Expanded information
Adding in the custom [multi entity row](https://github.com/benct/lovelace-multiple-entity-row) allows us to display additional information with each zone, like adding in the zone number underneath the friendly name or additional information, like bypassed, low battery, and tamper in the same line.
#### Zone number, bypassed, low battery, and tamper, not showing the state:
```yaml
type: custom:auto-entities
card:
type: entities
title: Recent zones
filter:
template: |
{% for s in states.binary_sensor | selectattr('attributes.zone', 'defined') -%}
{{-
{
'type': 'custom:multiple-entity-row',
'entity': s.entity_id,
'name': s.name,
'secondary_info': {'name':'Zone','attribute':'zone'},
'entities': [
{'attribute':'bypassed','name':'Bypassed'},
{'attribute':'low_battery','name':'Low battery'},
{'attribute':'tamper','name':'Tamper'}
],
'show_state': false,
'state_color': true
}
-}},
{%- endfor %}
sort:
method: attribute
attribute: zone
numeric: true
```
#### Zone number and state but without additional attributes:
```yaml
type: custom:auto-entities
card:
type: entities
title: Recent zones
filter:
template: |
{% for s in states.binary_sensor | selectattr('attributes.zone', 'defined') -%}
{{-
{
'type': 'custom:multiple-entity-row',
'entity': s.entity_id,
'name': s.name,
'secondary_info': {'name':'Zone','attribute':'zone'},
'state_color': true
}
-}},
{%- endfor %}
sort:
method: attribute
attribute: zone
numeric: true
```

0 comments on commit ad9e584

Please sign in to comment.