mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 08:16:53 +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
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
sensor:
|
template:
|
||||||
- platform: template
|
- sensor:
|
||||||
sensors:
|
- name: "Vacuum Filter Remaining Lifespan"
|
||||||
vacuum_filter:
|
unit_of_measurement: "%"
|
||||||
friendly_name: "Vacuum Filter Remaining Lifespan"
|
state: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') }}"
|
||||||
unit_of_measurement: "%"
|
|
||||||
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') }}"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
@ -104,13 +102,11 @@ Or, if you want a simple binary sensor that becomes `On` when the filter needs t
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
binary_sensor:
|
template:
|
||||||
- platform: template
|
- binary_sensor:
|
||||||
sensors:
|
- name: "Vacuum Filter"
|
||||||
vacuum_filter_replace:
|
device_class: problem
|
||||||
friendly_name: "Vacuum Filter"
|
state: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}"
|
||||||
device_class: problem
|
|
||||||
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user