After trying to understand the original electronics I decided to simply add a galvanic separated circuit. Two relays are added to the contacts of the original switches for the on/off button and for the fan speed.
Since the Air Purifier can still be operated also manually, there is the need to measure its status. I used a transistor to set a GPIO high if the AP is on.
With these 2 switches and the sensor to identify its status, rules in node red can easily be created to have air quality measurement, or time based rules to automate the use of the Air Purifier.
As microcontroller I'm using an ESP32. Its inexpensive and ESPHome makes it super easy to integrate it into your smart home network.