Automation 2.0. Lesson2. Advanced settings "..." (Execution time, delay of conditions, reversal of conditions) is

Lesson 1 (continued) Automation 2.0, lesson 1 (continued), description of the algorithm for transitioning automation 1.0 to 2.0

Good afternoon.
Some users do not pay attention to this symbol next to the automation conditions “…”, these are very important updated components of automation 2.0.
Let’s consider the conditions that are hidden under the “…” icon.
Fig1

CONDITIONS “…” WHEN.
The first condition, the time interval for executing the conditions. In this setting, you can select the period for controlling the sensor or the condition of the device state (selected hour, day, night).
There are four states:
-specified time period;
allows you to set the start and end time of the action within 24 hours (3,4) and set days/weeks/months (5).
Fig2, 3,4,5


-day period;
allows you to select the period “sunrise”, “sunset” (daily time interval). The parameter interval is quite extended from 15 minutes to 4 hours relative to the event (sunset, sunrise)
Fig6, 7,8.


-night period;
allows you to select the period “sunset”, “sunrise” (night time period). The parameter interval is quite extended from 15 minutes to 4 hours relative to the event (sunset, sunrise).
Fig9,10,11



-whole day (selection not by hours but by days, weeks, months).
This parameter works for a whole day (without a time interval), allows you to select the day of the week, day of the month, whole month.
Fig12, 13.


Note!!!
Automation associated with sunset and sunrise is now carried out by the gateway (locally). Each gateway is tied to its location, a mathematical algorithm calculates sunset and sunrise for a smart home. I am writing this for users who have not set the region for their gateway, and then do not understand why the automation is not working correctly.
Let’s continue the review.
Let’s consider the second setting “Daration”.
Fig. 14

This setting allows the user to set a delay for the condition that occurred. Example - there was movement (motion sensor) after this there is a delay (set by the user) of the signal from the sensor and after this timeout, the following conditions are checked that are in the “IF” section. The delay time can be set from 5 seconds to 3 hours.
Fig. 15.

CONDITIONS “…” in “IF”
In the IF tab, the conditions for using the time range are similar to the description for “WHEN”, so I will not repeat them.
The “Duration” time delay conditions have a fundamentally different purpose.
This parameter sets the time period for the sensor or condition during which there will be no triggering. For example, the door is open (opening sensor), the time parameter is set to 5 seconds, this means that if the door is opened and closed for 5 seconds, the automation will not be triggered (the condition will trigger when it is more than 5 seconds). We will consider examples of this condition in other lessons.
Fig. 16, 17


Another parameter “Cancel NOT Met” which changes the specified state of the condition to the opposite, I call this parameter “reverse” for myself. Example - I set the parameter sun (weather), after using reverse the weather will change to cloudy, or the switch on will turn into a switch off (note, the name “on” does not change, as well as “sun”, there is just a record with the condition (19) ).
Fig. 18, 19


This completes lesson 2.
To be continued, thank you for reading and sharing the topic (you can also on other platforms with a link to our forum).
See you soon!

Lesson 3 Automation 2.0. Lesson 3. Controlling lighting devices

18 Likes

@gafich10 Thank you for sharing such a detailed and thoughtful walkthrough on the advanced automation condition settings under the “…” menu in Automation 2.0! Your breakdown of the time interval, day/night period, and whole-day settings offers great clarity for users who might overlook these powerful customization options.

Highlighting how the time-based triggers work—especially the flexibility in setting specific periods, relative sunrise/sunset offsets, and even whole-day or multi-day schedules—really helps users envision more dynamic automations. Your note about the gateway calculating sunrise and sunset locally based on its region is a valuable reminder, as not setting the gateway location can certainly lead to confusing automation behavior.

Your explanation of the “Duration” setting, both in the WHEN and IF sections, is also spot-on. The distinction between using it for a delay after a trigger versus using it to require a condition to persist for a certain time before triggering is often missed, so your examples are especially helpful.

Finally, your mention of the “Cancel NOT Met” (or “reverse”) parameter, and the practical example of inverting logic, adds another layer of flexibility that advanced users will really appreciate.

Thanks again for your contribution—posts like this make it much easier for others to unlock the full potential of Aqara automations. If you (or anyone reading) have further suggestions for improvement, feel free to submit manual feedback via customer service. Looking forward to future lessons and examples from you!

5 Likes

Hello, wait for lesson 4. I will describe the complete scheme for your question there. The scheme is working, I used it throughout the house.

1 Like

How can I make it work 30 minutes after the power drops below 5 watts?

Hello, the answer to your question is understanding the operation of the algorithm 2.0.
Fig.

So I will explain it using your example.
Event description:

  • the socket was turned on;
  • 10 minutes passed (for example)
  • the power dropped below 100W.

Description of automation after 10 minutes when the power dropped below 100W:

  1. In the “WHEN” condition, the “consumption is less than 100W” condition was triggered, this condition is frozen (the period is set to 30 minutes), which means that after 30 minutes we will check what is in the “IF” condition if it is constantly less than 100W. If the power rises and falls again, the countdown (30 minutes) will start over.
  2. In the “IF” condition, at the moment when the power dropped below 100 W after 10 minutes, the “consumption is less than 100W” condition was triggered, which is waiting for its verification with "“WHEN” (this is the 30 minutes that I described above).

Note, the “socket is on” condition is set in the “IF” condition so that the automation is constantly no spam after 30 minutes, because after each automation test, a new control cycle begins, when in the “IF” there is a condition that the automation stops due to an unsatisfactory check.
When the entire described cycle passes, the socket will be turned off, after 30 minutes, as you wanted.

3 Likes

Yeah, I see, but it’s precisely under these conditions that my outlet turns off immediately when I turn it on.

I tested it, everything works. Look carefully, did you make an analogue based on my sample?
Give a screenshot of your automation.

1 Like

Yes, I’ll check it on another Socket now.

It worked on the other one!
I’ll reset this one and reconnect it.

Hi. The outlet is working again. To get it working, I had to reset it, connect it to Matter, reset it again, and connect it to ZigBee. And, of course, all the automations were removed, and everything worked again.
Maybe someone will find this useful.

Thank you, gafich10.

1 Like

I’ve got a vibration sensor. I don’t see the “duration” option available. Am I missing something?

I’m trying to trigger an action when the vibration stops for 2 minutes.

Thanks!

Hi, welcome to the forum. Unfortunately, not all actions support this feature. I can’t help you because I don’t have a vibration sensor.:slightly_frowning_face:

Have you activated Automation 2.0?

I think so. How can I verify that I have?


Smart Automation 2.0

2 Likes

Thanks for the pointer. It’s enabled.

I’m trying to replicate the washer/dryer automation that someone talked about “Inspirations” area. He was using Homekit and Home Assistant. I’m trying to do this completely within the Aqara sphere.

My basic plan is to detect that the washing machine is running (vibration for 2 minutes) and then send an alert when the washing machine stops running (no vibration for 2 minutes). I need to carry state between “machine is running” detection and “machine is not running” detection, so I only alert when the machine finishes and not when it’s just idle.

I’m an IT guy, so I’m no stranger to programming. This is just my first adventure in the home automation world.

Thanks!

1 Like

Please provide a screenshot of the conditions that the vibration sensor produces for “WHEN” and “IF”. I’ll try to suggest something.

The vibration sensor does not appear in the “If” section

1 Like

The vibration sensor can also present “drop detected” and “tilt detected”, but I don’t think those are going to be useful for this application.

1 Like