mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +00:00
Expand entity-filter options (#10349)
* Update entity-filter.markdown * filter should be array
This commit is contained in:
parent
fbc7dfb14a
commit
6fded6db56
@ -20,11 +20,11 @@ type:
|
||||
type: string
|
||||
entities:
|
||||
required: true
|
||||
description: "List of entities to filter."
|
||||
description: A list of entity IDs or `entity` objects, see below.
|
||||
type: list
|
||||
state_filter:
|
||||
required: true
|
||||
description: List of strings representing states.
|
||||
required: false
|
||||
description: List of strings representing states or `filter` objects, see below.
|
||||
type: list
|
||||
card:
|
||||
required: false
|
||||
@ -38,6 +38,60 @@ show_empty:
|
||||
default: true
|
||||
{% endconfiguration %}
|
||||
|
||||
## Options For Entities
|
||||
|
||||
If you define entities as objects instead of strings (by adding `entity:` before entity ID), you can add more customization and configurations:
|
||||
|
||||
{% configuration %}
|
||||
entity:
|
||||
required: true
|
||||
description: Home Assistant entity ID.
|
||||
type: string
|
||||
type:
|
||||
required: false
|
||||
description: "Sets a custom card type: `custom:my-custom-card`"
|
||||
type: string
|
||||
name:
|
||||
required: false
|
||||
description: Overwrites friendly name.
|
||||
type: string
|
||||
icon:
|
||||
required: false
|
||||
description: Overwrites icon or entity picture.
|
||||
type: string
|
||||
secondary_info:
|
||||
required: false
|
||||
description: "Show additional info. Values: `entity-id`, `last-changed`."
|
||||
type: string
|
||||
format:
|
||||
required: false
|
||||
description: "How the state should be formatted. Currently only used for timestamp sensors. Valid values are: `relative`, `total`, `date`, `time` and `datetime`."
|
||||
type: string
|
||||
state_filter:
|
||||
required: false
|
||||
description: List of strings representing states or `filter` objects, see below.
|
||||
type: list
|
||||
{% endconfiguration %}
|
||||
|
||||
## Options For state_filter
|
||||
|
||||
If you define state_filter as objects instead of strings (by adding `value:` before your state value), you can add more customization to your filter:
|
||||
|
||||
{% configuration %}
|
||||
value:
|
||||
required: true
|
||||
description: String representing the state.
|
||||
type: string
|
||||
operator:
|
||||
required: false
|
||||
description: Operator to use in the comparison.
|
||||
type: string
|
||||
attribute:
|
||||
required: false
|
||||
description: Attribute of the entity to use instead of the state.
|
||||
type: string
|
||||
{% endconfiguration %}
|
||||
|
||||
### Examples
|
||||
|
||||
Show only active switches or lights in the house
|
||||
@ -67,6 +121,24 @@ card:
|
||||
title: People at home
|
||||
```
|
||||
|
||||
Specify filter for a single entity
|
||||
|
||||
```yaml
|
||||
type: entity-filter
|
||||
state_filter:
|
||||
- "on"
|
||||
- operator: ">"
|
||||
value: 90
|
||||
entities:
|
||||
- sensor.water_leak
|
||||
- sensor.outside_temp
|
||||
- entity: sensor.humidity_and_temp
|
||||
state_filter:
|
||||
- operator: ">"
|
||||
value: 50
|
||||
attribute: humidity
|
||||
```
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/lovelace/lovelace_entity_filter_glance.png' alt='Entity filter combined with glance card'>
|
||||
Entity filter combined with glance card.
|
||||
|
Loading…
x
Reference in New Issue
Block a user