mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
Update ecovacs template sensor & binary_sensor examples (#20050)
This commit is contained in:
parent
682ac4f24e
commit
62a9d55ff2
@ -87,13 +87,11 @@ Here's an example of how to extract the filter's lifespan to its own sensor usin
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
vacuum_filter:
|
||||
friendly_name: "Vacuum Filter Remaining Lifespan"
|
||||
unit_of_measurement: "%"
|
||||
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') }}"
|
||||
template:
|
||||
- sensor:
|
||||
- name: "Vacuum Filter Remaining Lifespan"
|
||||
unit_of_measurement: "%"
|
||||
state: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') }}"
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
@ -104,13 +102,11 @@ Or, if you want a simple binary sensor that becomes `On` when the filter needs t
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
vacuum_filter_replace:
|
||||
friendly_name: "Vacuum Filter"
|
||||
device_class: problem
|
||||
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}"
|
||||
template:
|
||||
- binary_sensor:
|
||||
- name: "Vacuum Filter"
|
||||
device_class: problem
|
||||
state: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}"
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user