Hi there! Just wanted to show you how I integrated the air purifier into Home-Assistant. Now I’m able to adjust the fan speed, switch it off and on and also see if I need to replace the filter. Inspired by https://www.reddit.com/r/ikeahacks/comments/m0rdlw/förnuftig_but_it_has_rest_api/. Just to make it clear, you’ll loose the warranty and my hack is not supported by IKEA. Do it on your own risk.
This tutorial is not for a beginner. I assume you know how to connect some wires, how to use a step-down-converter and upload some code using ESPhome.
- 1x Wemos D1 mini or a similar ESP8266 or ESP32 device.
- 1x Step-Down converter to convert 24V down to 5V for the ESP32 (common Gnd)
- Some wire and hot glue
I recommend to unsolder the LED next to the antenna on the Wemos D1 mini or it will light up depending on the position of the rotary switch.
Ok, let’s start. It’s quite easy to get access to the PCB. Get the front off and the filter our (as shown in official tutorial). Now loose the two screws next to the LED and remove the inner part by lifting it up.
Loose the two screws fixing the PCB and pull out the knob on the other side. Below the knob is a flat nut you have to remove. Now take out the PCB and disconnect the two connectors.
First, solder some wires to the back of the socket where 24V is connected to the PCB. This wire goes to the step-down converter where it is converted to 5V and connected to the Wemos 5V input.
On the top side of the PCB (where the knob was), cut away the connectors for the rotary switch near the PCB (see picture for which legs you have to cut). Take a sharp side cutter and cut each leg individually next to the PCB. Bend the legs up and solder a wire to each of them. Sorry for the bad picture, I took it after applying hot glue… You don’t need to solder a wire to the leg opposite to the small red push button on the PCB – only 4 are needed here. Connect them to D1, D5, D6, D7 on the Wemos. D7 ist next to the one we don’t connect.
On the other side take out the remaining parts from the rotary switch you cut on the other side to make the holes free. Solder 4 wires on them. One is a bridge to ground, the others also connect to the Wemos (see label on the following picture). The last wire needs to be soldered to the LED or the resistor next to it (red circle on image).
It looks like the controller on the PCB checks all the positions of the rotary switch from highes power to off. Highest value “wins”. So we don’t ever need the actively select the “off”-setting. This is the one we connected to Gnd. Don’t worry about the “short” to Gnd. This is how the rotary switch worked too.
That’s it! Secure all the wires using hot glue and put all the parts next to the existing PCB. I managed to put the step-down converter behind the Wemos D1 mini, it’s barely visible. Use some more hot glue to fix it to the case. Make sure you don’t short out anything.
Before closing it, upload following ESPHome configuration to the Wemos.
esphome: name: $devicename platform: ESP8266 board: d1_mini substitutions: devicename: esp82-fornuftig1 friendly_name: FORNÜFTIG # Insert your SSID and Your PWD after inital setup wifi: networks: - ssid: !secret wifi_ssid password: !secret wifi_password # Enable logging logger: logs: # Make adc input less verbose adc: INFO # Enable Home Assistant API api: password: xxxxxxxxxxx # Enable OTA upgrade ota: safe_mode: True password: xxxxxxxxxxx sensor: # Read LED from adc input 10 times per second - platform: adc pin: A0 internal: true id: led_internal update_interval: 100ms accuracy_decimals: 1 filters: - delta: 0.1 on_value: if: condition: lambda: 'return x < 0.2;' then: - binary_sensor.template.publish: id: led_sensor state: OFF else: - binary_sensor.template.publish: id: led_sensor state: ON binary_sensor: - platform: template id: led_sensor name: "friendly_name Filter" device_class: problem - platform: gpio internal: true id: in_d1 pin: number: D1 mode: INPUT_PULLUP inverted: True on_press: - fan.turn_off: id: fan_internal - platform: gpio internal: true id: in_d5 pin: number: D5 mode: INPUT_PULLUP inverted: True on_press: - fan.turn_on: id: fan_internal speed: 1 - platform: gpio internal: true id: in_d6 pin: number: D6 mode: INPUT_PULLUP inverted: True on_press: - fan.turn_on: id: fan_internal speed: 2 - platform: gpio internal: true id: in_d7 pin: number: D7 mode: INPUT_PULLUP inverted: True on_press: - fan.turn_on: id: fan_internal speed: 3 output: - platform: gpio pin: D2 id: gpio_d2 inverted: true - platform: gpio pin: D3 id: gpio_d3 inverted: true - platform: gpio pin: D4 id: gpio_d4 inverted: true - platform: template id: fan_out_internal type: float write_action: if: condition: lambda: 'return state < 0.1;' then: - output.turn_off: gpio_d4 - output.turn_off: gpio_d3 - output.turn_off: gpio_d2 else: - if: condition: lambda: 'return state < 0.4;' then: - output.turn_on: gpio_d4 - output.turn_off: gpio_d3 - output.turn_off: gpio_d2 else: - if: condition: lambda: 'return state < 0.7;' then: - output.turn_off: gpio_d4 - output.turn_on: gpio_d3 - output.turn_off: gpio_d2 else: - output.turn_off: gpio_d4 - output.turn_off: gpio_d3 - output.turn_on: gpio_d2 fan: - platform: speed output: fan_out_internal id: fan_internal name: "$friendly_name Fan" speed_count: 3
Test it out! The rotary switch does still work but it is also possible to control it from within Home-Assistant. The rotary switch will (of course) not move when controlled from Home-Assistant. But as soon as you move the switch again the corresponding setting will be used.
My first tutorial here, so please be gentle :). Feedback welcome!
Edit: See post IKEA FÖRNUFTIG in Home-Assistant - #32 by RubenKelevra about how to integrate it into energy monitoring.