external_components: # Pull from Github - source: github://mill1000/esphome-winix-c545@main components: [winix_c545] # # Pull from local folder # - source: components # components: [winix_c545] uart: - tx_pin: 26 rx_pin: 25 baud_rate: 115200 winix_c545: fan: - platform: winix_c545 name: None # Use friendly name of device globals: - id: filter_lifetime_value type: int restore_value: yes sensor: - platform: winix_c545 filter_age: name: Filter Age id: filter_age on_value: then: - component.update: filter_remaining filter_lifetime: id: raw_filter_lifetime internal: true on_value: then: - lambda: |- id(filter_lifetime_value) = x; id(filter_lifetime_sensor).update(); aqi: name: AQI light: name: Light Intensity fan_speed: name: Fan Speed - platform: template name: Filter Lifetime id: filter_lifetime_sensor device_class: duration entity_category: diagnostic unit_of_measurement: h accuracy_decimals: 0 lambda: |- auto value = id(filter_lifetime_value); return (value == 0) ? NAN : value; on_value: then: - component.update: filter_remaining - platform: template name: Filter Remaining id: filter_remaining device_class: "" entity_category: diagnostic unit_of_measurement: "%" accuracy_decimals: 0 lambda: |- return 100 * (1 - (id(filter_age).state / id(filter_lifetime_sensor).state)); text_sensor: - platform: winix_c545 aqi_indicator: name: AQI Indicator switch: - platform: winix_c545 plasmawave: name: Plasmawave