Update ecovacs template sensor & binary_sensor examples (#20050)

This commit is contained in:
SNoof85 2021-10-30 16:40:34 +02:00 committed by GitHub
parent 682ac4f24e
commit 62a9d55ff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"
template:
- sensor:
- name: "Vacuum Filter Remaining Lifespan"
unit_of_measurement: "%"
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') }}"
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"
template:
- binary_sensor:
- name: "Vacuum Filter"
device_class: problem
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}"
state: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}"
```
{% endraw %}