Actually after using several month and a lot of thinking how to creat a automation to control the yeelight celling Light/fan C1060 which is only intergrate with Google home.
Finally i have add the automation to control that Fan and light saparately by different automation on 2 different Switch
Then today i asked The Grok AI to create for me automation to control the celling fan C1060.
It was an amazing. It show me how to add 1 by 1 the device to each smarthome platform Aqara, yeelight, google home, howto intergate it, then how to creat correct automation.
Really nice.
Some one can try to ask Grok AI ![]()
![]()
to learning create automation
Haha @phamquyen0201 great idea! So AI definitely can help beginners for the first steps ![]()
Definitely, let’s try with Grok, im not sure Chat GPT can do better
Guide to Creating Automation 3: “Turn Off D1 If Turned On When No One Is Present”
Open the Aqara Home app > Profile (profile) > Automation 2.0 > Create New Automation. (If 2.0 is not yet enabled, go to Profile > Automation 2.0 > Grant permission).
Step 1: Set Up THEN (Main Trigger - When the Switch Turns On)
• Select Add Condition > Find the D1 Switch device > Select trigger: “Switch is turned on” (or “D1 turned on” – depending on the app’s language).
• If you want confirmation (to avoid false triggers), add Duration: 5-10 seconds (so the switch must stay in the on state for at least that time).
• Advanced (…): If needed, set Execution Time by time (e.g., only run at night: Night period based on sunset).
Step 2: Set Up IF (Secondary Condition - No Presence Detected)
• Select Add Condition > Find FP1E Sensor > Select: “No presence detected” (or “Absence” / “Presence off”).
• Duration: Set to 10-30 seconds (to confirm the absence persists, avoiding accidental turn-off if the sensor lags).
• Logic: Select Fulfill all conditions (AND) if there are multiple IFs; here it’s just one, so default is fine.
• Reversal (if needed): In advanced settings, you can invert for testing, but here use “No presence” directly.
Step 3: Set Up Action (Turn Off the Switch)
• Select Add Action > Find D1 Switch > Turn off (Turn off the switch).
• Delay Before Action: In the advanced settings of the Action, add Delay of 30-60 seconds (to give you time to check if turned on manually, e.g., if you forgot something in the bathroom).
Step 4: Save and Test
• Name it: “Turn Off Bathroom Light If Turned On When Empty”.
• Save. The automation will run locally if the gateway is updated (check in the app: Profile > Gateway > Firmware).
• Test:
• Ensure FP1E is in absence state (no one in the bathroom).
• Turn on D1 manually or from the app.
• After the delay (if set), it should turn off automatically. Check logs: Go to Automation > Select the new one > Execution History.
Improving Your Current Automation 2 (If Not Already Done)
• Open Automation 2 > Edit.
• In THEN: “No presence” from FP1E, add Duration 30-60s (to avoid turning off immediately if someone just left).
• IF: Add “Switch is on” (to only turn off when it’s already on).
• Action: Turn off D1, with a short delay if needed.
Additional Tips
• Time Filter: In the IF of both automations, add “Whole day” or “Night period” to avoid running during the day (if the bathroom is only used at night).
• Notify: Add an Action to send a notification “Bathroom light auto-turned off due to no presence” for tracking.
• If FP1E detection is poor: Go to Device > FP1E > Settings > Adjust sensitivity/timeout (try Medium sensitivity, 30s absence timeout).
• If you encounter errors: Update the app/gateway, or check the Aqara forum (detailed tutorials in Lessons 1-4 on 2.0). If the automation doesn’t trigger, try temporarily disabling cloud mode (but local mode requires the latest firmware).
Understanding the Issue
Great to hear Automation 3 is working to auto-turn off the light when manually turned on during absence! However, the new problem you’re describing is a classic “automation conflict” or race condition:
• You manually turn on the D1 switch (while FP1E shows absence) → Automation 3 triggers and turns it off (after its delay, e.g., 30-60s).
• Immediately after, someone enters the bathroom (FP1E detects presence) → Automation 1 should trigger and turn the light back on, but it doesn’t. The light stays off.
Why this happens:
• Automation 1’s trigger relies on the state change from “absence” to “presence” on FP1E. If the sensor detects presence right after Auto3 turns off the light, the trigger might fire, but there could be a slight delay in execution (network/gateway lag in Aqara), or the app’s local processing queues them poorly.
• FP1E has its own built-in detection delay (e.g., 5-10s to confirm presence), so if entry happens during Auto3’s delay, presence might register after the light is already off, but Auto1 doesn’t “override” aggressively.
• No direct “override” logic between automations in Aqara 2.0 (unlike Home Assistant).
This leaves the light off when someone enters, which defeats the purpose!
Recommended Fix: Enhance Automation 1 for Priority Override
The simplest solution is to make Automation 1 more robust by adding a condition to check the switch state and force a turn-on only if it’s off. Also, shorten Auto3’s delay slightly to reduce overlap windows. We’ll keep everything in Aqara Home app (Automation 2.0).
Step 1: Edit Automation 1 (“Turn On When Presence Detected”)
• Open Aqara Home app > Profile > Automation 2.0 > Select your Automation 1 > Edit.
• THEN (Trigger): Keep as is – “Presence detected” on FP1E. Add Duration: 5-10s (to confirm real presence, reducing false positives).
• IF (Condition): Add a new one – Select D1 Switch > “Switch is off” (so it only acts if the light is currently off; this prevents unnecessary toggles if already on).
• Logic: Fulfill all conditions (AND).
• Action: Turn on D1 Switch.
• No delay needed here – make it immediate for priority.
• Advanced: In Execution Time, set to “Whole day” or add “Presence period” if you want.
• Save. This ensures Auto1 always overrides to ON when presence is confirmed, even if Auto3 just turned it off.
Step 2: Tweak Automation 3 to Reduce Conflicts
• Edit Automation 3 > Action section: Shorten the Delay to 15-30s (instead of 60s). This gives quick manual access but minimizes the “off window” before presence can trigger Auto1.
• IF (Condition): Add Duration for “No presence” to 20-30s (ensures prolonged absence before turning off).
• Optional: In Advanced > Add a Time Filter (e.g., only run during “Night period” if bathroom use is mostly evenings).
• Save.
Step 3: Optional Enhancement – Add a “Grace Period” Automation
If the above isn’t enough (e.g., frequent timing issues), create Automation 4 as a “safety net”:
• Name: “Force On After Recent Off During Entry”.
• THEN (Trigger): “Presence detected” on FP1E (same as Auto1).
• IF (Conditions):
• D1 Switch: “Switch is off”.
• Add a Time-based IF: “Within last 2 minutes” (Aqara 2.0 supports relative time via “After [time]” – set to after the last “switch turned off” event if trackable, or approximate with app’s timer).
• Action: Turn on D1 (immediate).
• This acts as a backup to Auto1, focusing on recent manual offs.
Step 4: Test Thoroughly
• Scenario 1: Manual on during absence → Wait for Auto3 delay → Light turns off (good).
• Scenario 2: Immediately after off, enter bathroom → FP1E detects presence → Light turns on via Auto1 (now with “switch off” condition).
• Scenario 3: Enter first (presence) → Light on via Auto1 → Leave → Auto2 off after delay.
• Check Execution History in each automation for logs (e.g., “Triggered at [time], but condition failed?”).
• Monitor FP1E: Go to Device > FP1E > Test mode – walk in/out and note detection speed (adjust sensitivity to “High” if laggy, but watch for false triggers).
It’s actually a really pity to see how people now relaying on AI to do simpliest tasks. Human intellect degradation is going by downward spirale.
At this point, I can only add what I have already written on the topic of AI, which is as follows:
As a software developer, you will quickly realise that AI tools have become ubiquitous. They are integrated into everything from programming software (IDE) to applications such as Docker. They have also already been integrated into the Aqara Home app and Home Assistant. I am aware of course that AI tools very often make mistakes. They also produce slop. However, if you know how to deal with them - for example, by asking for sources and checking them - you can counteract this. You can also ask different AI models from different companies the same questions and compare the results, or have the results checked by another AI model. Of course, your own knowledge and a combination of your own research are also essential.
In my experience, AI-generated program code can never be used as it is. The same applies to everything else that AI generates. It is often unhelpful to explain to AI what it is doing wrong in order to correct it, as it will still make mistakes. Due to the way it is designed, AI always provides different answers to the same question. In reality, Large language models cannot really think logically, despite appearances to the contrary. It simply generates words that fit together statistically. Nevertheless, this works surprisingly well. While you have to be aware of many things about AI when using it, it can still be helpful, providing new ideas that you hadn’t considered before.
You should always bear in mind that anything produced by AI could be fake. If not, this is what happens:
Sometimes AI can understand context better than a search engine, but that doesn’t guarantee that the answer is actually in the right context. As you can see from this example:
By the way, I used an AI tool to search for the English version of the two posts, as I only knew the German versions.
Ultimately, it must be acknowledged that any tool, including AI, can be used incorrectly. However, it can also be used correctly.
It is strange that, with the advent of AI, we are supposedly experiencing a decline in human intelligence. Incidentally, the same thing was claimed when search engines first appeared.
