Skip to content

Commit

Permalink
Update example with template sensor for Filter Remaining %
Browse files Browse the repository at this point in the history
  • Loading branch information
mill1000 committed Mar 22, 2024
1 parent e4b6658 commit ae6ad7c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,32 @@ sensor:
- platform: winix_c545
filter_age:
name: Filter Age
id: filter_age
on_value:
then:
- component.update: filter_remaining
filter_lifetime:
name: Filter Lifetime
id: filter_lifetime
on_value:
then:
- component.update: filter_remaining
aqi:
name: AQI
light:
name: Light Intensity

- platform: template
name: Filter Remaining
id: filter_remaining
update_interval: never
device_class: ""
entity_category: "diagnostic"
unit_of_measurement: "%"
accuracy_decimals: 0
lambda: |-
return 100 * (1 - (id(filter_age).state / id(filter_lifetime).state));
text_sensor:
- platform: winix_c545
aqi_indicator:
Expand Down

0 comments on commit ae6ad7c

Please sign in to comment.