Air purifier automation triggered after airing the room

Hi everyone,

I’d like to share one of my automations and also ask for some advice on improving it in the new automation format.


My setup:

I have an air purifier plugged into an Aqara Smart Plug.
I created a scene called “purify air” which:

  1. Turns on the Smart Plug
  2. Waits 15 minutes
  3. Turns off the Smart Plug

Automation 1.0 (old format):
This version worked perfectly.

When:

  1. Door and Window Sensor closes
  2. Door and Window Sensor had been open for more than 1 minute
  3. Aqara Smart Plug is off

Then:
Execute scene “purify air”


Automation 2.0 (new format):

When:
→ Door and Window Sensor closes

If (all conditions):
→ Door and Window Sensor had been open for more than 1 minute
→ Aqara Smart Plug is off

Then:
Execute scene “purify air”


The idea:
Whenever I ventilate the room (balcony door open for more than 1 minute) and then close it again, the air purifier should run for 15 minutes to refresh the air.

I started doing this because after airing, I often noticed increased PM2.5 and PM10 values in the room — likely due to outdoor air quality. So the purifier helps bring those levels back down quickly.

The 1-minute condition is important because my cat often wants to go out onto the balcony — but I don’t want the air purifier to start every time she goes in and out briefly.


The issue:
This worked perfectly in Automation 1.0, but in Automation 2.0 it only works if I remove the condition “Door and Window Sensor had been open for more than 1 minute.”
It seems the new automation logic doesn’t detect that past open-state condition anymore.


Question:
Has anyone managed to reproduce this behavior in Automation 2.0?
Is there a workaround or a different way to express “had been open for more than X minutes before closing”?

Thanks in advance for any suggestions or ideas!

4 Likes

Hello, you need to make this type of automation. Also check out my lesson 5 about vector movement (in your case, vector opening/closing of the balcony). 2 minutes is a waiting period, after this time the first condition burns out (doors open for more than 1 min) so choose experimentally. It must be longer than 1 minute (to cover the time of 1 min. open doors). Automation 2.0, Lesson 5, vector lighting control by sensors

1 Like

Thank you for the detailed explanation.

So the idea is to create a sequence trigger, where:

  1. The door (in my case, the balcony door) stays open for more than 1 minute
  2. Then within the next 2 minutes, it has to be closed
    → in order to trigger the automation.

However, in my situation it’s not very practical. I usually keep the balcony door open for about 10 minutes (In summer, it can also be significantly longer) when ventilating, and the “within” option can only go up to 5 minutes. After that time, the “opened for over 1 min” condition expires, so the automation doesn’t run when I finally close the door.

And it will probably be a little difficult to explain to my wife that she must close the balcony door within a specified period of time :wink:

That’s why I’m still looking for a way to express this logic more flexibly - something like “had been open for more than 1 minute before closing,” which worked in Automation 1.0.

Any ideas on how to achieve that behavior in Automation 2.0 would be very welcome - and thanks again for your helpful explanation!

Hi, ok, I understand, I’ll think of another option and reply later.

1 Like

Hello, I tried different options, unfortunately at the moment the automation algorithm 2.0 cannot fulfill your conditions. My recommendations, switch to automation mode 1.0 and recreate your old automation. Fig.


Lesson 1, at the end I made a note 3, how to switch to 1.0.
I will pass this problem to the developers to fix the work.
Sorry for the inconvenience. Automation 2.0. Lesson 1. Introduction

1 Like

Thank you very much for your efforts.

Indeed, I had already considered simply recreating the automation as an older version. I have now done so.

Thank you for passing the issue to the developers. If you receive any feedback, I would be grateful if you could let me know. Otherwise, I will simply try it out when I notice an update.

1 Like