Automating Air filters
Recently I was watching a Thomas Sanladerer (Making with Layers) video on youtube about the emission of gases from 3D prints. Like Thomas, I am concerned about the fumes that come from my 3D printers and I'm interested in ways to reduce them, especially around my young son.
My big take away from Thomas' video was that I should get some air filters - big ones, not the small ones that I have on my resin printer. So, as seems to be my want at the moment, I headed off to IKEA to purchase 2 air filters, one large and one small. Both of the filters featured in the video, but for reference they are:
The small one, listed at £29:
https://www.ikea.com/gb/en/p/uppatvind-air-purifier-50498224/
The large one, listed at £50:
https://www.ikea.com/gb/en/p/foernuftig-air-purifier-black-40488065/
After walking around IKEA, I found the small one, the Uppatvind, in the bargin corner of the store, with £12 off as it was an ex-display model. This doesn't appear to be problematic at all, so Bonus!
The larger air filter, the Foernuftig, is setup between my 2 FDM printers and the smaller one is for my office. The main problem I then had was how to actually switch them on automatically, perferably when they are required. Despite not having a air quality sensor (a good one costs over £100 and I'd need 2) there are certain times that they can come on to help with the air quality.
The CR-10 Max has it's power controlled via a powerstrip which is controllable by the Tuya eco-system. Fortunately, it has a spare power socket that I could use for the air filter. The larger of the filters is controlled via a dial, so I only needed to automate the power. Once set up in home assistant, creating a routine which starts the air filter when either of the printers are swtiched on is straight forward.
The Uppatvind filter has a push button to switch on the power, as well as set the power level of the device. For this filter, I added the device to a power strip for my computer desk as my hobby desk appears to be out of sockets at the moment. In order to sort the automation for this, I used a device that I had bought but put aside as I didn't have a direct use for - my Fingerbot.
The Fingerbot is a zigbee controlled device that physically presses a button. The one I have effectively toggles the power by pressing the device's button. After mounting the button and confirming that the power levels could be adjusted, I set about automating the device further in Home Assistant.
At present, I have added the actually button from the ZHA and a state tracker via a input select helper. An automation which advances the select state when the button was pushed. I also added a reset section, so that when the power is toggled via the plug socket, it was set back to off.
alias: SmallAirFilter State Update
description: Tracking the state of the SmallAirFilter
triggers:
- type: changed_states
device_id: 5732d9edb9654d2cfc8474790dbaf73b
entity_id: 1ce977f5580dba4cd5f31920bab4b6f8
domain: switch
trigger: device
id: Filterbutton
- type: changed_states
device_id: 2294cbddf85eba6c706871d272b3f812
entity_id: 9130ea155b1925d6ce1031d67de322a0
domain: switch
trigger: device
id: DeskPower
conditions: []
actions:
- if:
- condition: trigger
id:
- DeskPower
then:
- action: input_select.select_first
metadata: {}
data: {}
target:
entity_id: input_select.smallairfilter_state
else:
- action: input_select.select_next
target:
entity_id: input_select.smallairfilter_state
data:
cycle: true
mode: single
While this did work, the airfilter actually remembers it's settings while powered off. In the end, I changed this automation to just not update when the desk wasn't powered.
alias: SmallAirFilter State Update
description: Tracking the state of the SmallAirFilter
triggers:
- type: changed_states
device_id: 5732d9edb9654d2cfc8474790dbaf73b
entity_id: 1ce977f5580dba4cd5f31920bab4b6f8
domain: switch
trigger: device
id: Filterbutton
conditions: []
actions:
- if:
- condition: device
type: is_on
device_id: 2294cbddf85eba6c706871d272b3f812
entity_id: 9130ea155b1925d6ce1031d67de322a0
domain: switch
then:
- action: input_select.select_next
target:
entity_id: input_select.smallairfilter_state
data:
cycle: true
mode: single
In future, I will probably automate this more, but for now, this should be a good start.