Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 75 additions & 3 deletions source/_lovelace/entity-filter.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down