Ramping up an air purifier when 3D printing
Setting a Philips air purifier AC3829 to turbo mode with home assistant when my 3D printer prints (a Prusa mini)
My Prusa mini printer is sitting in my home office, so when it’s printing for a longer job I can close the door to the office and lessen the noise.
Whilst discussions are going on online on “safe” 3D printing in the same room as you are sitting/working in, I already have an air purifier in my room, so might as well hook it up to start cleaning the air a bit faster when I’m printing.
I have an AC3829 air purifier in my office, it is controllable with 2 apps, Air Matters and Clean Home+
On this page
Home assistant requirements
Betaboon made a library to control these devices called aioairctrl and a forked home assitant component philips-airpurifier-coap to use this component you will need to have HACS installed on your homeassitant ( a community store )
Once HACS is up and running add the https://github.com/betaboon/philips-airpurifier-coap to HACS and install it
UPDATE 09/2022: it seems there is native support for the prusa now
For the Prusa Mini we will need another community component called Prusa Mini Integration for Home Assistant
Give homeassistant a quick reboot and those components should be ready to go.
Network requirements
I’ve also assigned reserved “fixed” IP’s on my DHCP server for the air purifier, and the prusa mini, so they stay on the same IP’s
Home Assistant configurations
I configured the 2 devices as such:
NOTE: I only care for the Prusa status, I’ve disabled the other options to reduce disk r/w due to logging
fan: platform: philips_airpurifier_coap host: 192.168.1.46 model: ac3829 sensor: - platform: prusa_connect host: 192.168.1.52 # set printer ip name: Prusa Mini scan_interval: 30 # set refresh interval (seconds) monitored_conditions: - status # return printer state: printing, online, offline, cooling, heating # - temp_nozzle # return nozzle temperature # - temp_bed # return bed temperature # - material # return current loaded material # - progress # return printing progress 0-100 # - time_est # return estimated time to complete (minutes) # - project_name # return printing job filename # - pos_z_mm # return z height in mm (floating point) # - time_tts # return time readable by google assistant
Validate the config and restart homeassistant
Creating the automation
When the Prusa is heating up the status will be “cooling”, when it’s printing the status will be “printing”
When done with printing it will be “cooling” again until cooled off, I’ve also added a delay of 30 minutes, meaning after printing the air purifier still works for half an hour to get the room odour-free.
I’ve attached the YAML for the 2 automation
- id: '1633969897389' alias: Ramp up air purifier with printer printing description: '' trigger: - platform: state entity_id: sensor.prusa_mini_status to: printing - platform: state entity_id: sensor.prusa_mini_status to: cooling condition: [] action: - service: fan.set_preset_mode target: entity_id: fan.philips_airpurifier data: preset_mode: turbo mode: single
- id: '1633970083682' alias: Set air purifier to auto when printing is done description: '' trigger: - platform: state entity_id: sensor.prusa_mini_status from: printing condition: [] action: - service: fan.set_preset_mode target: entity_id: fan.philips_airpurifier data: preset_mode: auto - delay: hours: 0 minutes: 30 seconds: 0 milliseconds: 0 mode: queued max: 10
For the first automation, we want to turn the purifier to turbo if our printer is cooling or printing.
The other automation is similar, with just an added delay of 30 minutes.
Run both of the automation to verify if they work, (disable the 30m delay though, for the test)
Enjoy!