Smart Air Purifier controller

Smart Air Purifier controller

I thought this would make a good follow-up post to my first one. Controlling a smart air purifier based off a real-time indoor Air Quality Index. If you haven't already, check out of a bit background on AQI and how to derive AQI from a particle sensor in my last post: Node-red Air Quality Index (AQI) and Home Assistant display

This intelligent air purifier control is achieved through a node-red flow, in order to be able to implement the flow to its full potential, you will need an air purifier setup in home assistant with the ability to control the fan speed. However, if you just have a more basic air purifier with a smart plug to turn it on and off, that will certainly work as-well, just more limited.

Features:

  • Turns on and adjusts air purifer fan speed based on Air Quality Index
  • Open Door Detection - Disable the automation and stop air purifer if the door is open for more then 2 minutes
  • Occupancy Detection - Disable the automation and stop the air purifer if nobody is home
  • Awake Detection - Disable the automation when asleep and put the air purifier into the slowest fan speed
  • Manual Override - Disable the automation for 2hr when a manual speed is set

Of course, in order to achieve all of that functionality you will need a variety of additional sensors in Node-RED/home assistant for occupancy, door and awake detection, setting up these is beyond the scope of this post, but there's tons of information of how to do this on the home assistant forum and elsewhere.

The Node-RED flow it's self is pretty straightforward, the AQI data is passed through all the gates (conditions) and if it pass all the conditions then the switch node at the end sets if the air purifier is on and at what speed. The rate limit and dead band are there just to reduce the air purifier switching on/off unnecessarily frequently.

Prerequisites:
Node-RED pallets (installed though menu -> Manage pallets -> Install):

  • node-red-contrib-home-assistant-websocket
  • node-red-contrib-simple-gate
  • Air purifer - either with fan speed control or switched plug, setup in home assistant

After you install the above dependences and have setup the Node-RED home assistant websocket connection (follow this great guide here), import my Node-RED flow from github: Smart_air_purifier_control.json. After this it will need significant customisation in order make it work with your setup, since everyone's smart home is a little (or a lot) different, and this flow integrates a lot of different sensors into in function. Hopefully this Node-RED flow is a useful starting point, or at least some inspiration as to what can be achieved.

Interface:

For manual control from home assistant I can highly recommend this great card from denysdovhan. It also allows you to easily configure multiple actions on each speed change, so its straight forward enough to set the manual control input boolean to true while also setting the speed.

GitHub - denysdovhan/purifier-card: Air Purifier card for Home Assistant Lovelace UI
Air Purifier card for Home Assistant Lovelace UI. Contribute to denysdovhan/purifier-card development by creating an account on GitHub.