Skip to main content
  1. Posts/

Hello! local control for your Blueair Air Purifier

·493 words·3 mins· loading ·
IoT Smart Home Node.js MQTT Air Quality Home Automation
Embark on a journey to enhance your smart home with local control of Blueair Air Purifiers. This project leverages Node.js and MQTT to bypass the need for cloud services, offering enhanced privacy and seamless integration.

Background
#

As a smart home enthusiast and a Blue Air 205 owner, I’ve always been keen on integrating my devices seamlessly. While I’ve scripted control mechanisms for these devices before ( alackmann/openhab-blueair), this project goes a little further.

By analyzing the network traffic from my BlueAir 205 (via Wireshark), I uncovered the reliance of these purifiers on api.blueair.io for commands and updates. This information allowed the development of a local API and control system making things faster and removing the need for an internet connection for local control.

Overview
#

This project is an IoT game-changer for Blueair Air Purifier users. By setting up a local Node.js server and MQTT broker, you gain complete control over your air purifier without depending on the BlueAir’s cloud. This approach resolves the semi-regular authentication issues I was getting with the previous method and is MUCH more responsive within the home when automation rules make a change.

How It Works
#

This Node.js application mimics the BlueAir external API, tricking the air purifier into thinking it’s communicating with the official servers. In essence, it creates a local environment that perfectly mirrors the expected network interactions of the purifiers, complete with MQTT communication for real-time control and feedback.

HTTP Phase
#

Coming soon

MQTT Messaging
#

Coming soon

Project Components
#

This project is essentially two docker containers to run a local API and provide a local MQTT broker for the BlueAir devices to connect to.

  • Local API Server: Hosted on your network, this is a custom Node application that removes the need for external internet access for your air purifier (assuming you can override your local DNS)
  • MQTT Broker & Bridge: A local MQTT broker (using opensource project EMQX) which your device will now connect to instead of Blueair’s network. (Mosquitto was not compatible)

Installation and Setup
#

  1. Docker Deployment: Deploy the docker containers into your environment using the provided docker-compose.yaml file.
  2. DNS Redirection: Redirect api.blueair.io DNS queries to your local server using your existing firewall, pihole or similar. This is a prerequesite! If you don’t have this ability in your own network, you’ll need to implement this OR not use this project.

For detailed, step by step configuration, checkout the Github README.md

Inviting Collaborations
#

I’ve not implemented every endpoint or service that the BlueAir units use here (especially air quality monitoring as my devices don’t have it). This could also work for Home Assistant with some tweaks I’m sure. If either of these are an issue for you and you want to enhance the project, log an issue and send PRs :)

Github
#

For full information and code, visit the repository: