mill1000 / esphome-winix-c545

An ESPHome external component for the Winix C545 air purifier.
MIT License
16 stars 1 forks source link

Filter Lifetime Never Reports #13

Closed droans closed 1 month ago

droans commented 2 months ago

Running ESPHome 2024.5.4, but I believe it has been present for a while now.

Neither of my Winix fans will report filter lifetime. It seems that the key (P01) is never received by either. Configs are the same and logs are similar.

Screenshots from HA: image

Config:

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));

Logs:


[16:24:32][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"132","S14":"90"}
[16:24:32][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:24:32][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:24:32][D][sensor:094]: 'Light Intensity': Sending state 90.00000  with 0 decimals of accuracy
[16:24:32][D][text_sensor:064]: 'AQI Indicator': Sending state 'Good'
[16:24:32][D][sensor:094]: 'AQI': Sending state 132.00000  with 0 decimals of accuracy
[16:24:32][D][api.connection:1321]: Home Assistant 2024.5.5 (10.10.20.161): Connected successfully
[16:24:46][D][fan:021]: 'Winix C545 Air Purifier' - Setting:
[16:24:46][D][fan:024]:   State: ON
[16:24:46][D][fan:030]:   Speed: 4
[16:24:46][D][winix_c545:035]: Sending sentence: *ICT*AWS_RECV:A211 12 {"A04":"5","A02":"1"}
[16:24:46][D][fan:120]: 'Winix C545 Air Purifier' - Sending state:
[16:24:46][D][fan:121]:   State: ON
[16:24:46][D][fan:123]:   Speed: 4
[16:24:46][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A210 {"A02":"1","A03":"01","A04":"01","A05":"01","A07":"1","A21":"5375","S07":"01","S08":"133","S14":"90"}
[16:24:46][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:24:46][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:24:46][D][sensor:094]: 'AQI': Sending state 133.00000  with 0 decimals of accuracy
[16:24:46][D][switch:055]: 'Plasmawave': Sending state ON
[16:24:46][D][sensor:094]: 'Filter Age': Sending state 5375.00000 h with 0 decimals of accuracy
[16:24:46][D][sensor:094]: 'Filter Remaining': Sending state nan % with 0 decimals of accuracy
[16:24:46][D][fan:120]: 'Winix C545 Air Purifier' - Sending state:
[16:24:46][D][fan:121]:   State: ON
[16:24:46][D][fan:123]:   Speed: 1
[16:24:46][D][fan:132]:   Preset Mode: Auto
[16:27:33][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"133","S14":"90"}
[16:27:33][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:27:33][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:28:58][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A210 {"A02":"1","A03":"01","A04":"01","A05":"01","A07":"1","A21":"5376","S07":"01","S08":"133","S14":"90"}
[16:28:58][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:28:58][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:28:58][D][sensor:094]: 'Filter Age': Sending state 5376.00000 h with 0 decimals of accuracy
[16:28:58][D][sensor:094]: 'Filter Remaining': Sending state nan % with 0 decimals of accuracy
[16:29:25][I][ota:117]: Boot seems successful, resetting boot loop counter.
[16:29:25][D][esp32.preferences:114]: Saving 1 preferences to flash...
[16:29:25][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[16:30:34][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"133","S14":"90"}
[16:30:34][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:30:34][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:33:36][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"133","S14":"218"}
[16:33:36][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:33:36][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:33:36][D][sensor:094]: 'Light Intensity': Sending state 218.00000  with 0 decimals of accuracy
[16:36:37][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"134","S14":"219"}
[16:36:37][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:36:37][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:36:37][D][sensor:094]: 'Light Intensity': Sending state 219.00000  with 0 decimals of accuracy
[16:36:37][D][sensor:094]: 'AQI': Sending state 134.00000  with 0 decimals of accuracy
[16:39:38][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"134","S14":"219"}
[16:39:38][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:39:38][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:42:40][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"135","S14":"219"}
[16:42:40][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:42:40][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:42:40][D][sensor:094]: 'AQI': Sending state 135.00000  with 0 decimals of accuracy
[16:45:41][D][winix_c545:248]: Received sentence: AT*ICT*AWS_SEND=A220 {"S07":"01","S08":"136","S14":"219"}
[16:45:41][D][winix_c545:035]: Sending sentence: *ICT*AWS_SEND:OK
[16:45:41][D][winix_c545:035]: Sending sentence: *ICT*AWS_IND:SEND OK
[16:45:41][D][sensor:094]: 'AQI': Sending state 136.00000  with 0 decimals of accuracy
mill1000 commented 2 months ago

Hi there. Thanks for the logs. I appreciate the details.

Filter lifetime is an odd one. I believe the message is only sent on power up and/or during the Wi-Fi handshake. Thankfully it's also a static value, so you could always just replace the sensor with the fixed value of 6480 hrs.

mill1000 commented 1 month ago

See the updated example.yaml. It now stores the filter lifetime in a global and exports the value via a template sensor. As long as the filter lifetime is reported once (i.e. WiFi handshake) the value is cached permanent and will restore itself when the node reboots.

https://github.com/mill1000/esphome-winix-c545/blob/ecef53e1e2b1483231e8e7e39fae3d3238f6ce8d/example.yaml#L47-L59