Help - Lovelace Card for VeSync Fan Control

Hi, I recently purchased a Levoit Core 200S air purifier (newer revision) and got the integration to work by modifying the python files (Vesync integration is not returning any devices · Issue #61417 · home-assistant/core · GitHub).

I now have automation working (but had to control the air purifier by calling the fan service), and have a basic button in my Lovelace dashboard for on/off functionality, but would like to get additional buttons created to control the different speeds/modes. Outside of Off, there are four speed modes: Low, Medium, High, and Sleep (slower than Low mode). The goal would be to put these buttons in a conditional card that only gets exposed if the air purifier is set to On.

I haven’t found an existing card (including through HACS) that has met my needs or actually worked, and any help would be greatly appreciated.

In case it is needed, I am running the latest version of Home Assistant Core via a docker container on my Unraid server. It is a relatively new setup that I have only been running for a few weeks now.

THis card works:
GitHub - denysdovhan/purifier-card: Air Purifier card for Home Assistant Lovelace UI

I have the exact opposite problem, my 200S suddenly stopped working in HA about a week ago and the integration is throwing an error. I haven’t been able to chase it down yet. BUT when the integration works, this card works fine.

1 Like

Thanks @NathanCu. I will give that a shot when I get home and will let you know the results.

1 Like

After playing around with the YAML code, I was finally able to get it to work (and will only show when my power toggle button is enabled). I wound up having to specify the numerical speed for Low, Med, and High. For Sleep, I just called the specific mode.

I just wish that there was a way to hide the AQI object so I can clean it up more (I know that there are a few requests for that on the GitHub page).

Screenshot_20220202-125234_Home Assistant

1 Like

Know this thread is dated, but I wanted to share my Purifier Card configuration for the Levoit 200S using the VeSync integration, as I couldn’t really find a fully-featured example anywhere. Took a bit of playing around as well, but overall am very happy with the performance. Hope this helps!

type: custom:purifier-card
entity: fan.levoit_air_purifier_200s
stats:
  - entity_id: sensor.master_bedroom_air_quality_pm25
    subtitle: PM2.5
  - attribute: screen_status
    subtitle: Display
  - attribute: night_light
    subtitle: Night Light
  - attribute: child_lock
    subtitle: Lock
  - entity_id: sensor.levoit_air_purifier_200s_filter_life
    unit: '%'
    subtitle: Filter Life
aqi:
  entity_id: sensor.u_s_air_quality_index
shortcuts:
  - name: Sleep
    icon: mdi:weather-night
    service: fan.set_preset_mode
    service_data:
      preset_mode: sleep
  - name: Low
    icon: mdi:circle-slice-3
    service: fan.set_percentage
    service_data:
      percentage: 33
  - name: Med
    icon: mdi:circle-slice-5
    service: fan.set_percentage
    service_data:
      percentage: 66
  - name: High
    icon: mdi:circle-slice-8
    service: fan.set_percentage
    service_data:
      percentage: 100
show_name: false
show_state: false
show_toolbar: true
compact_view: false

Note in my case I have a separate PM2.5 sensor, as the 200S does not have one (believe the 300+ models do however and the sensors on these models can be used instead). I’m also pulling AQI from the AirVisual integration.

4 Likes

Thank you very much for your brilliant work. You shared it just “in time” because I purchase 200S recently and I was looking at the community forum for ideas on how to configure my device and bang I could find the ready-made recipe :heart:
The only question I have is, if you could share with me also, what PM2.5 sensor you use - I might consider adding it to my air purifier too. Is this any kind of device or your own made sensor?

Glad this helped! Yes, I’m using a semi-homemade PM2.5 sensor: it’s an IKEA Vindriktning Air Quality Sensor, modified with an ESP32 and ESPHome with added temp, humidity, TVOC and eCO2 sensors all in one. Great project if you’ve never looked into it and like DIY. Alternatively I know there are number of devices for a bit more with built-in connectivity that you can buy and integrate to grab the room’s PM2.5.

1 Like

Is there anyway you can control the status of the attributes? I want to be able to turn the screen_status off and on when i have it on at night. I can see all the attributes listed when i look at the state of it in developer tools but i dont know the actions to take to apply a change to that attribute. Basically at night i want it to turn onto preset mode (which i have done and is straight froward) but also turn the screen off.

Anyone else had any luck?

1 Like

Hi jason,

I found your template and it looks great, I did some mods because I have a 300s which includes a pm25 sensor, however I’ve been having issues with the shortcuts, whenever I click one I get this error:

Failed to call service fan/set_percentage. extra keys not allowed @ data['target']['percentage']. Got 66

I’m quite new to home assistant and I can’t seem to figure out what the issue is, any help would be appreciated

Thank you in advance

PS.

Here’s my yaml:

type: custom:purifier-card
entity: fan.air_cleaner
stats:
  - entity_id: sensor.air_cleaner_pm2_5
    subtitle: PM2.5
  - attribute: screen_status
    subtitle: Display
  - attribute: night_light
    subtitle: Night Light
  - attribute: child_lock
    subtitle: Lock
  - entity_id: sensor.air_cleaner_filter_lifetime
    unit: '%'
    subtitle: Filter Life
shortcuts:
  - name: Auto
    icon: mdi:auto-mode
    service: fan.set_preset_mode
    service_data:
      preset_mode: auto
  - name: Sleep
    icon: mdi:weather-night
    service: fan.set_preset_mode
    service_data:
      preset_mode: sleep
  - name: Low
    icon: mdi:circle-slice-3
    service: fan.set_percentage
    service_data:
      percentage: 33
  - name: Med
    icon: mdi:circle-slice-5
    service: fan.set_percentage
    service_data:
      percentage: 66
  - name: High
    icon: mdi:circle-slice-8
    service: fan.set_percentage
    service_data:
      percentage: 100
show_name: false
show_state: false
show_toolbar: true
compact_view: false

Update:

Figured out how to do it, here’s the updated version:

type: custom:purifier-card
entity: fan.air_cleaner
stats:
  - entity_id: sensor.air_cleaner_pm2_5
    subtitle: PM2.5
  - entity_id: sensor.air_cleaner_filter_lifetime
    unit: '%'
    subtitle: Filter Life
shortcuts:
  - name: Auto
    icon: mdi:auto-mode
    preset_mode: auto
  - name: Sleep
    icon: mdi:weather-night
    preset_mode: sleep
  - name: Low
    icon: mdi:circle-slice-3
    percentage: 33
  - name: Med
    icon: mdi:circle-slice-5
    percentage: 66
  - name: High
    icon: mdi:circle-slice-8
    percentage: 100
show_name: false
show_state: false
show_toolbar: true
compact_view: true