Currently, automation in the Aqara Home App only supports the “If-Then” structure, with conditions limited to “AND” and “OR” logic. Crucially, it struggles to clearly differentiate between Triggers and Conditions.
This is why I strongly hope Aqara Home will adopt a “When-If-Then” logic structure:
When: Defines the Triggers. The automation process starts when any one of these conditions is met.
If: Defines the Conditions. These are additional checks performed after the automation is triggered to determine whether the actions should actually execute.
This structure would allow me to create the automations I need much more clearly. Does anyone else share this need or find the current setup confusing?
@Sonja Your thoughts on the current automation setup in the Aqara Home App are quite insightful, and you’re certainly not alone in wanting more flexibility. As of now, the app indeed supports an “If-Then” structure using “AND” and “OR” logic. This setup can sometimes make it challenging to clearly distinguish between triggers and conditions, which might limit the complexity of automations you can create.
The “When-If-Then” logic you propose would indeed add a valuable layer of nuance, enabling more precise and conditional automation. This approach, where “When” specifies the triggers and “If” adds additional conditions post-triggering, could greatly enhance the clarity and efficiency of automation setups.
While the current system is designed to validate the rationality of automation settings and prevent conflicts, as mentioned in the reference information, there’s always room for improvement based on user feedback. Sharing your needs and experiences helps the community and developers understand where enhancements are necessary.
Let’s keep the conversation going! Who else thinks a “When-If-Then” structure could make a difference in their smart home setup?
WHEN: front door sensors opens.
IF: no motion detected for 20 seconds by front door motion sensor
THEN: arm Away mode
WHEN: Away mode actived
IF: back door sensor opens
AND
IF: back door motion sensor detects movement
THEN: activate intruder automation.
(activate light, sound alarm, record video, enable person tracking, send notification etc)
Not only the addition of
WHEN:
IF:
THEN:
automation logic. But include AND: option would be such a game changer for even simple automations like the examples I gave above.
I fully support you, I have been asking Aqara to make this possible for more than two years.
In addition to your automation, I will tell you about mine.
WHEN there is movement in corridor1 or corridor2 or corridor3
IF the lighting in the yard is like this
THEN turn on the light (for understanding, the light turns on in a place that illuminates three locations, night lighting).
Instead of one automation, I have to do 3 things.
I also have a number of similar automations related to temperature control in the room that I have to duplicate.
For information: at the moment I have replaced the WHEN condition with the “signal” command and use it in automation. The “signal” command can be written in the “Connect to ecosystems” section, go to “Home assistant” then “Signal Management”. Home assistant does not need to be enabled, just go in, create a signal and everything works.
I’d also like some sort of variables to share information between automations. At the moment I use the enable/disable state of other fake automations as a pseudo-variable.
Thanks, sounds like a helpful work around that I will look into. I’ve been exploring exposing Aqara Arm Away & Arm Home scene’s with “connect to ecosystem” using M100 Hub via Matter with Samsung SmartThings app. Up until recently, I’ve had to rely on geolocation to auto Arm Home/Away. Which I found to be so unreliable that I had to check to make sure it worked. Which really defeats the purpose because I could just manually arm in the time it took me to check. Also, do to the fact that I live in a apartment building, every time take my dog out for a walk around the neighborhood, by the time geolocation Armed Away mode I was nearly at the point where I would be heading back which would Arm Home mode. I wanted my Away mode to auto arm after walking out my door and my Home mode to arm right before I walked it. I read somewhere that implementing a Smart Lock into the Aqara security monitoring system could achieve this. However, living in an apartment building restricted me from using that solution. However, by exposing Aqara Arm Away & Arm Home Scene’s into SmartThings. I was able to use Samsung phone to create the routines “If disconnected from my home Wi-Fi network, Then activate the Aqara Arm Away Mode Scene exposed in SmartThings app” and “When connected to my home Wi-Fi network, Then activate the Aqara Arm Home Mode Scene exposed into SmartThings app”. Which now only takes seconds to Arm Away Mode a few feet from my unit door and Arms Home Mode few seconds before walking in my front door. This method has been extremely reliable working flawless 100% of the time. Also, I was able to expose all of my Aqara Door and Window Sensors P1 into Google Home App using my M100 Hub with my Google Nest mini speaker via Matter. I then created Google Home automations “If (front, back, bedroom, etc) Door Sensor is open, Then Nest Mini speaker says” (front, back, bedroom, etc) Door Open" out loud.
I don’t know if your aware that Aqara has opened automation 2.0 beta testing which has the exact advanced logic capabilities we’ve been discussing. If you’re interested in becoming a beta tester than you need to leave a comment on that forum requesting to be included. I just received a response that I’ve been accepted to be a beta tester. It just began so I haven’t yet had the opportunity to check it out. I’m pretty psyched up about it.
I’m updating gradually as well, but it takes time to clearly check whether they are local within the “Enga” building. It often happens that you think they are local, but in fact they are cloud-based.
Thanks for all those iinteresting When-If-Then examples and sorry for the very late reply. Now I fully understand and be happy you all forced Aquara to integrate such a functionality which is very helpful.