Trying to build an AutomateIt Pro rule... having some issues (screen off, recurring actions)

LeoRex

Retired Moderator
Nov 21, 2012
6,223
0
0
Visit site
I used to use Llama, but things got a bit wonky when it was starting Wifi back up (wifi would connect, then drop the connect and not re-establish) so I decided to give AutomateIt a poke... but the big rule I want is a rule that messes with my wifi/mobile data when the screen is off to help extend battery life. The rule needs to do this:

1) screen goes off wait 5 seconds and disable wifi/mobile and sync
2) Start a recurring rule that runs every 15 minutes (or whatever) that enables wifi/mobile, calls for a sync, the disables the wifi/mobile a minute later.

The programmer in me would like to have this all done in 1 rule (which I could do in Llama)... The best I could come up with is two recurring rules that kick off when the screen goes off... 1 that disables data on screen off, then disables things every 15 minutes..2 that runs every 15 minutes and offset it by 14 minutes so it alwyas kicks off a minute before everything gets shut down again.

Anyone have any thoughts as to how to get this in one uber-rule?
 

Muzikant

Member
May 7, 2012
5
0
0
Visit site
You can't do that in one rule.

What I would do to make it a bit cleaner is to reverse the rules you have defined:
1. Turn Wifi/Mobile data on every 15 minutes
2. Turn Wifi/Mobile data off every 15 minutes with 1 minute delayed execution

Both rules will be enabled when screen is off (using a composite action of two Enable/Disable rule action) and disabled when screen is on.

Doing it that way you gain a "one minute grace period" when you turn off your screen it was accidently turned off, and the countdown to turn off will be only 1 minute which I think is nicer.
 

LeoRex

Retired Moderator
Nov 21, 2012
6,223
0
0
Visit site
Yeah... I've been playing around with a method like that. Ran into some crazy run-away loops that hung up the app and froze the phone for a minute when I tried to do too many cute things.. but I think I have it nailed down. Thanks for the response!