Hi all,
I have a problem with one of the events I set up, and I would like advice from you llama experts.
Basically, my event does;
Conditions:
1. every night between 1:00 am and 6:00 am,
2. when screen is off,
3. variable 'at night' has value 0.
Actions:
1. run application Darker (make display darker)
2. stop application Auto screen on (screen on by proximity sensor)
3. set profile to Silent
4. queue another event
wait 1 second, if at home, enable Airplane mode
5. queue another event
wait 1 minute, if Airplane mode is enabled, turn on WiFi (to get email, texts, etc.)
6. queue another event
wait 1 minute 5 seconds, set variable 'at night' to 1 (prevent this event to repeat every time screen turns on and off)
Everything works except Action 5 to turn on WiFi.
There is a deliberate long wait before this action to make sure Airplane mode kicks in. However, event history shows that as soon as Action 4 (Airplane mode) happens (in the same second), Action 5's 'delay cancelled because conditions were no longer met'. I just can't figure out why.
Action 5 has only one condition (Airplane mode enabled) and it's just met by Action 4.
It appears that Action 5 ran before Airplane mode actually kicked in, but isn't Action 5 supposed to wait for 1 minute before it event checks whether its conditions are met?
(edit: No it isn't. Queued events are canceled the moment their conditions test false. If the phone is not in airplane mode when Action 5 is queued, it gets canceled. This is the reason it doesn't work.)
What's more confusing is that Action 5 doesn't always fail. Unfortunately, I haven't checked event history when it does work, though.
Can any one explain this behavior?
Btw, Action 6 runs a whole 1 minute 5 seconds later as it supposed to, satisfying its intended purpose.