Add Future Improvements and Home Assistant to purifier

This commit is contained in:
2026-06-08 14:15:38 -06:00
parent 6a7828cb9d
commit 5db575251e
+50 -3
View File
@@ -1,7 +1,7 @@
Title: Hacking my Air Purifier onto Wifi
Date: 2026-05-27
Category: Writing
Summary: Hardware hacking my Airmega 200M Purifier onto Wifi
Category: Creations
Summary: Hardware hacking my Airmega 200M Purifier onto Wifi.
Image: purifier1.jpg
Wide: true
@@ -73,4 +73,51 @@ This showed me the hack was indeed possible, so I ordered a differential probe o
I wrote a quick Arduino sketch to see if the 0-3.3 V PWM it outputs was enough to control the speed and it was. This, combined with the fact there's 5 V supplied by the ribbon cable meant that the Arduino could be connected simply with three wires, without the need for level shifters or a power supply.
I ordered 17 different 6-pin connectors with the same pitch off Digikey and tested each one until I was satisfied with the fit. I programmed the Arduino, soldered it all up, and the hack was complete!
I ordered 17 different 6-pin connectors with the same pitch off Digikey and tested each one until I was satisfied with the fit. I programmed the Arduino, soldered it all up, and the hack was complete! I've been using it for almost a year now.
## Future Improvements
As I mentioned before, it should be possible to communicate directly with the integrated particulate sensor over its cable. I didn't bother to do this because I already had my own [[Custom Air Quality Monitor]] running. The sensor data could then be used as feedback to control the fan speed, similar to the built in functionality.
The control board is completely disabled after doing this hack which might be inconvenient for house guests or spouses. An improvement could be using the Arduino to intercept the speed control signal instead by putting it in the middle. It could read the control board's PWM signal by timing the pulse width, or as a voltage on one of its analog pins after low-pass filtering it. Then whenever there's a change to the MQTT speed or control board speed, output the latest value.
## Appendix: Home Assistant
I don't actually use Home Assistant for this, but here's how one could configure it. This assumes you have an MQTT broker (ie. mosquitto) running. If you don't, Home Assistant can be configured to run a broker by installing the Mosquitto broker add-on from the Add-on Store.
### Set up MQTT
Go to Settings > Devices & Services > MQTT > Configure > Re-configure MQTT.
Enter your MQTT broker details. If you are using the broker add-on, it should be automatically discovered.
### Add the Slider
1. Go to Settings > Devices & Services > Helpers
2. Click + Create Helper (bottom right) and select Number
3. Set the Name (like "Purifier Speed") and Icon (I used "mdi:air-purifier")
4. Set Minimum value to 0 and Maximum value to 100
5. Click Create
Note the Entity ID of the slider. Mine is "input_number.purifier_speed".
### Add the Automation
Go to Settings > Automations & Scenes > + Create Automation > Create new automation.
You can do this with the UI but I prefer entering YAML code. Click the three dots at the top right and select "Edit in YAML". Paste this in:
```
trigger:
- platform: state
entity_id: input_number.purifier_speed
action:
- service: mqtt.publish
data:
topic: "iot/purifier/mega_1234/speed"
payload: "{{ states('input_number.purifier_speed') | int }}"
```
Note that `input_number.purifier_speed` has to match the Entity ID of the slider and `mega_1234` should be changed to the ID the purifier Arduino reports over serial after programming.
Hit save and call it something like "Purifier automation". The slider should now be on your dashboard under a "Helpers" section.