Re Levoit LV-PUR131S WiFi Air Purifier

Wondering if someone can help… I’m a total newb to HA. I have followed the instructions to add the Levoit Air Purifier here: https://selfhostedhome.com/levoit-lv-pur131s-wifi-air-purifier-review/
I have tried to do all suggested but cannot get the sensor to work for the air quality. I’d like to be able to display the history graph of the air quality but when I add this:

platform: template
sensors:
levoit_air_quality:
friendly_name: Levoit Air Quality
value_template: “{{ state_attr(‘fan.angelina_s_air_purifier’, ‘air_quality’) }}”
icon_template: “mdi:cloud”

to the config.yaml I get these errors:

CHECK CONFIGURATION
Component error: platform - Integration ‘platform’ not found.
Component error: sensors - Integration ‘sensors’ not found.

I’m considering buying this same model and was curious about the state of integration with the purifier into Home Assistant.

Has anyone out there successfully integrated the Levoit LV-PUR131S into their Home Assistant setup?

Yes I have it fully integrated and works perfectly!

I used this custom component:

With this in my config:

vesync:
  username: !secret vesync_username
  password: !secret vesync_password 

I also had to add a few things but others didn’t need to as they loaded automatically:

   - platform: template
     sensors:
      air_quality:
         friendly_name: Air Quality
         value_template: "{{ state_attr('fan.angelina_s_air_purifier', 'air_quality') }}"
      filter_life:
         friendly_name: Filter Life
         value_template: "{{ state_attr('fan.angelina_s_air_purifier', 'filter_life') }}"
      mode:
         friendly_name: Mode
         value_template: "{{ state_attr('fan.angelina_s_air_purifier', 'mode') }}"
      screen_status:
          friendly_name: Screen Status
          value_template: "{{ state_attr('fan.angelina_s_air_purifier', 'screen_status') }}"
1 Like

Fantastic news, thank you! I’ve just ordered the purifier, it will arrive later today!

:+1:

I’m not the most advanced user but give me a shout if you need anything and I’ll see if I can help in anyway.

Thanks, I appreciate it!

Hi all. I’ve got the Vesync component installed and reading data, I think similarly to you @nckslater . Have you managed to post any data to the purifier? Through scripts or automations? I’d like to include it in my bed time routine, so turn the filter on, set night mode, set sleep timer, etc. I’m having trouble setting up scripts to configure the purifier. Using IFTTT in the mean time.
Thanks

how do we use these templates for alerting when the filter needs replacing for example, I’ve not use templates before so struggling to understand how to use it.

They’ve updated how to access Filter Life and Air Quality data. This is my current working configuration and card setup.

image

configuration.yaml

  - platform: template
    sensors:
      air_quality:
        friendly_name: Air Quality
        value_template: "{{ states('sensor.levoit_131s_air_purifier_air_quality') }}"
      filter_life:
        friendly_name: Filter Life
        value_template: "{{ states('sensor.levoit_131s_air_purifier_filter_life') }}"
      mode:
        friendly_name: Mode
        value_template: "{{ state_attr('fan.levoit_131s_air_purifier', 'mode') }}"
      screen_status:
        friendly_name: Screen Status
        value_template: "{{ state_attr('fan.levoit_131s_air_purifier', 'screen_status') }}"
      air_quality_int:
        device_class: humidity
        unit_of_measurement: '%'
        unique_id: levoit_131s_air_purifier_air_quality_int
        friendly_name: Air Quality Interger
        value_template: >-
          {% set mapper =  {
              'excellent' : '100',
              'good' : '65',
              'fine' : '35',
              'bad' : '10' } %}
          {% set state = states('sensor.levoit_131s_air_purifier_air_quality') %}
          {{ mapper[state] if state in mapper else '0' }}

UI Card Config

      - type: entities
        entities:
          - type: custom:hui-gauge-card
            entity: sensor.air_quality_int
            name: Air Quality
            needle: true
            max: 100
            min: 0
            unit: '%'
            segments:
              - from: 0
                color: '#dc1d1e'
              - from: 20
                color: '#d2a765'
              - from: 40
                color: '#f1d4a4'
              - from: 70
                color: '#87CEEB'
            theme: material_dark_theme_custom
          - entity: fan.levoit_131s_air_purifier
            name: Air Purifier Power
          - entity: sensor.levoit_131s_air_purifier_filter_life
            name: Air Filter Remaining
            icon: mdi:air-purifier
        theme: material_dark_theme_custom
        title: Levoit 131S Air Purifier

If using this chunk of code, you should probaly remove theme: material_dark_theme_custom, unless you have that theme setup. It allows for transparent cards. I am directly pasting what I have working to hopefully help others.

I added device_class: humidity, in an attempt to get history/recorder to show a graph instead of the horiontal bar of data. I ended up having to manually delete data from InfluxDB with InfluxDBStudio to get rid of non-numeric string entries for sensor.air_quality_int before I found out that unit_of_measurement: '%" is required under air_quality_int in configuration.yaml. Once I did that, and rebooted the server, graphs started to show up. Humidity device_class can probably be removed.

4 Likes