Successfully Automating My Levoit Air Purifier with VeSync

I’ve been really excited about integrating my Levoit Core 400s air purifier into my Home Assistant setup using VeSync. I wanted to create an automation that would turn the purifier on or off based on the state of my window sensors. While the basic functionality worked out of the box, I ran into a little hiccup when it came to setting the fan speed.

At first, the purifier would only turn on at speed 2, which wasn’t what I wanted. I spent some time digging through the documentation and experimenting with different settings. After a bit of trial and error, I realized that I needed to adjust the automation to explicitly set the fan mode to ‘Auto’ when the purifier turns on. This involved tweaking the YAML configuration to include the correct attributes.

Here’s what I ended up doing:

yaml
automation:

  • alias: Window Open Detection
    trigger:
    • platform: state
      entity_id: binary_sensor.window_sensor
      to: ‘on’
      action:
    • service: fan.turn_on
      entity_id: fan.levoit_core_400s
      data:
      speed: auto

Now, whenever a window is opened, the purifier kicks in at the optimal speed based on the air quality sensors. It’s such a nice touch, and I love how seamlessly everything works together now. If anyone else is looking to do something similar, I’d highly recommend checking out the VeSync integration and exploring the different automation options available in Home Assistant. The community resources and documentation have been invaluable in making this project a success!