Hello everyone, the product management team of the Aqara Home App is working on an article to help explain how to configure automations. This is our first draft, and we’d love for you to take a look and let us know whether the explanations are clear. If anything is unclear or could be improved, please feel free to share your feedback and suggestions.
Here is the main text:
Below is a polished, natural English translation suitable for an article or community post. I’ve kept terminology precise and consistent with the smart-home automation context.
Automation conditions fall into two categories: transient trigger conditions and state conditions.
A transient condition can trigger an automation, while a state condition is used to evaluate whether the automation should proceed.
When configuring an automation, you may use only a transient trigger condition along with its effective time period. However, in most cases, we recommend combining transient and state conditions.
For example:
- “Someone passed by” is a transient trigger condition.
- “Illuminance is below 50 lux” is a state condition.
If you set the rule as “turn on the light when someone passes by and illuminance is below 50 lux,” you effectively prevent the light from being triggered during the daytime by mistake.
Using only state conditions is not recommended. The system checks state conditions periodically, and whenever the condition is met, it reports the result, which may cause very frequent triggers.
A typical example of a state condition is a threshold like “higher than” or “lower than.”
For instance: “When the temperature detected by the sensor is above 30°C.”
If used alone, this condition may trigger continuous actions or notifications.
Usage Pattern 1
When: Trigger when a specific event occurs, when any event among several occurs, or when multiple events occur in sequence.
Then: Execute the action.
Example:
“When the camera detects an unfamiliar face, execute specific action commands.”
Usage Pattern 2
When: Defines when the system should perform the check.
If: Defines what conditions must be met for the action to run.
Then: Execute the action.
Example: a “late-night reminder.”
At 23:00 every night, if any light in the bedroom is still on, the hub plays a reminder: “It’s bedtime. Good night!”
If at 23:00 all lights are already off, it means the user is away or already asleep, so no reminder is needed.
A Special Case You Should Pay Attention To
If you want to create an automation that executes only when all conditions are met, you may notice a challenge:
- WHEN does not support “match all conditions,”
- Only IF supports “all conditions must be met,”
- But WHEN is mandatory,
So how should you configure this?
Let’s use a very common example:
“Turn off the lights when both Sensor A and Sensor B detect no presence.”
A common—but incomplete—setup is:
- When Sensor A detects no one
- If Sensor B also detects no one
- Then turn off the lights
But this misses another possible sequence:
- When Sensor B detects no one
- If Sensor A also detects no one
- Then turn off the lights
Some users may instead put everything in IF:
“If Sensor A detects no one AND Sensor B detects no one, then turn off the lights,”
and then become unsure what to put in WHEN.
The correct configuration should be:
When (any of the following is met):
- Sensor A detects no one
- Sensor B detects no one
If (all of the following are met):
- Sensor A detects no one
- Sensor B detects no one
Then: Turn off the lights
Plain explanation:
As long as either A or B first detects “no one,” the system “wakes up” and checks whether both sensors are now detecting “no one.”
If yes, it turns off the lights.





