Skip to content

Expand entity-filter options#3692

Merged
bramkragten merged 8 commits into
home-assistant:devfrom
iantrich:dynamic-filter
Sep 24, 2019
Merged

Expand entity-filter options#3692
bramkragten merged 8 commits into
home-assistant:devfrom
iantrich:dynamic-filter

Conversation

@iantrich
Copy link
Copy Markdown
Member

@iantrich iantrich commented Sep 12, 2019

Closes #3543

Adds the following to state_filter:

  • operator option. Specify operator to use in comparison. Options are ==, >, >=, <, <=, !=, regex
  • value option. Specify value to compare against.
  • attribute option. Specify attribute to use instead of state in comparison.

Adds state_filter as an option to entities as well

e.g.

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

Closes #3543

Adds the following to `state_filter`:
- `operator` option. Specify operator to use in comparison.
- `value` option. Specify value to compare against.
- `attribute` option.  Specify attribute to use instead of state in comparison.

e.g.
```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
```
@iantrich
Copy link
Copy Markdown
Member Author

iantrich commented Sep 12, 2019

Need to make a change to setConfig before this is reviewed/merged

Comment thread src/panels/lovelace/common/evaluate-filter.ts Outdated
Comment thread src/panels/lovelace/common/evaluate-filter.ts Outdated
Comment thread src/panels/lovelace/cards/hui-entity-filter-card.ts Outdated
@bramkragten
Copy link
Copy Markdown
Member

I think your example is wrong, the state_filter of an entity should be an array?

Comment thread src/panels/lovelace/cards/hui-entity-filter-card.ts Outdated
Comment thread src/panels/lovelace/cards/hui-entity-filter-card.ts Outdated
@bramkragten bramkragten merged commit 886c6dd into home-assistant:dev Sep 24, 2019
@bramkragten bramkragten mentioned this pull request Oct 2, 2019
@iantrich iantrich deleted the dynamic-filter branch October 30, 2019 03:20
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Entity Filter - Attributes Filter [Feature Request]

3 participants