Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
yamdankee
Jan 23, 2005

~anderoid fragmentation~
Is there a way you can have tasker "touch" a certain part of the screen at a certain time? AutoHotkey can give you coordinates of your computer screen and it can click there, is there anything similar with Tasker?

Or maybe I'm going at it the wrong way. I just want 'High' to be the default quality setting on Hulu Plus. I always have good signal when I use it, but I have to change from 'Med' to 'High' every time I watch a show.

Adbot
ADBOT LOVES YOU

TrisIsPluto
Sep 19, 2004
"...and then he said, that's not a machine gun, that's my wife!"
Okay, I think I'm doing something wrong. I'm trying to set up a work mode profile - silent with exceptions for specific callers. I used this from the tasker wiki, deleted the power/time conditions and put in a location. Somehow, though, it never says the profile is active even if I set the radius to 2km. What am I screwing up?

Bearnt!
Feb 6, 2004

No onions, no onions
For me Tasker has been pretty lovely handling locations. For my work profile I just changed from location to WiFi SSID instead so if that's an option for you it may be best going that route. You could also try creating a task and adding it as a widget then pressing it every time you want to run it (annoying I know). Perhaps a time/date like 9-5, M-F?

Bahama.Llama
Aug 17, 2006

Scary Money
Strange... I've always had really good luck with locations. Have you tried staring from scratch with the location being the only context? I suppose that's what you're doing now... but starting from nothing is always step one.

Also, when you set up your location, did you use the "fetch location" option to be sure that Tasker would be looking at your current location?

brc64
Mar 21, 2008

I wear my sunglasses at night.

Bearnt! posted:

For me Tasker has been pretty lovely handling locations. For my work profile I just changed from location to WiFi SSID instead so if that's an option for you it may be best going that route. You could also try creating a task and adding it as a widget then pressing it every time you want to run it (annoying I know). Perhaps a time/date like 9-5, M-F?

One of the complications I've run into with locations is that if you're just using "Network" location in Tasker (which I do, 'cuz I don't want Tasker polling GPS every couple of minutes), you have to remember that you generally get more accuracy when wifi is enabled as well.

If one of the things you want to do is toggle wifi, I would suggest building your task with wifi disabled and using the less accurate reading for your location. I don't know if I'm explaining this very well, so I'll also give an example. My numbers are completely made up and may be exaggerated:

Let's say you want a task to enable wifi when you're home and disable it when you leave. Let's also say that when you're home, with wifi on, "Net" location gives you an accuracy of 20m. If you disable wifi, Net location gives you an accuracy of 500m.

So, if you want Tasker to enable wifi when you're home and use the 20m accuracy, Tasker will only trigger when you enter that circle. If wifi is off as you're coming home (which it would be, given the nature of the task), it will never trigger the task because with wifi off the most accurate position is 500m, which is going to be outside that 20m circle.

Does that make sense?

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!
I want to make a task that will turn on airplane mode for 15 minutes, turn it off for one minute, and repeat until I disable it. How can I pull this off?

Brightman
Feb 24, 2005

I've seen fun you people wouldn't believe.
Tiki torches on fire off the summit of Kilauea.
I watched disco balls glitter in the dark near the Brandenburg Gate.
All those moments will be lost in time, like crowds in rain.

Time to sleep.

brc64 posted:

One of the complications I've run into with locations is that if you're just using "Network" location in Tasker (which I do, 'cuz I don't want Tasker polling GPS every couple of minutes), you have to remember that you generally get more accuracy when wifi is enabled as well.

If one of the things you want to do is toggle wifi, I would suggest building your task with wifi disabled and using the less accurate reading for your location. I don't know if I'm explaining this very well, so I'll also give an example. My numbers are completely made up and may be exaggerated:

Let's say you want a task to enable wifi when you're home and disable it when you leave. Let's also say that when you're home, with wifi on, "Net" location gives you an accuracy of 20m. If you disable wifi, Net location gives you an accuracy of 500m.

So, if you want Tasker to enable wifi when you're home and use the 20m accuracy, Tasker will only trigger when you enter that circle. If wifi is off as you're coming home (which it would be, given the nature of the task), it will never trigger the task because with wifi off the most accurate position is 500m, which is going to be outside that 20m circle.

Does that make sense?
This gives me an idea. Might not be the best, but you could have GPS turn on once the network location detects that you're near home and then use that for improved accuracy in another profile. My current setup is based on time and my routine which works for me, but this might be a better method.

Vykk.Draygo posted:

I want to make a task that will turn on airplane mode for 15 minutes, turn it off for one minute, and repeat until I disable it. How can I pull this off?
Yeah, this should do it:
1. Network->Airplane mode: on
2. Tasker->Wait: 15 minutes
3. Network->Airplane mode:off
4. Tasker->Wait: 1 minute
5. Tasker-> Goto Action: 1

Or a profile set to "Every 15 minutes": Turn Airplane mode off, wait 1 minute, turn airplane mode on. The task can be made into a shortcut though.

Brightman fucked around with this message at 16:16 on Jul 7, 2011

brc64
Mar 21, 2008

I wear my sunglasses at night.

Brightman posted:

This gives me an idea. Might not be the best, but you could have GPS turn on once the network location detects that you're near home and then use that for improved accuracy in another profile. My current setup is based on time and my routine which works for me, but this might be a better method.
This is actually a suggested "advanced method" which I've thought about doing, but my issue with that, if I'm following the logic, is that once you're home, GPS is going to continue to poll periodically until you leave, right? Otherwise how do you exit the Home profile?

Profile 1: Are you close to home?
Coarse location, somewhere near the house, when triggered, activates->

Profile 2: Are you home?
GPS location, at home, when triggered, activates->

Profile 3: Home
I guess maybe you could make Home use coarse location, which you should automatically be inside by that point, but then how do you switch back to profile 1 when you leave? Because if you're home and you go back to Profile 1, it would just cycle endlessly through the profiles.

Brightman
Feb 24, 2005

I've seen fun you people wouldn't believe.
Tiki torches on fire off the summit of Kilauea.
I watched disco balls glitter in the dark near the Brandenburg Gate.
All those moments will be lost in time, like crowds in rain.

Time to sleep.
Oh sorry, I forgot to mention the profile I already have for it now, well I mentioned it before in here months ago, but whatever.

Right now GPS turns on around 5:10 when I get off work and am headed home, when it sees that I'm home it turns on wifi, and when wifi connects to my router then it disables GPS. It turns it back on when it loses connection, which was a problem with my phone until I got Gingerbread since it kept dropping connection for some reason.

Currently I don't mind the GPS polling since it's usually only a problem on the weekends, but I guess you could set it up so when the phone loses wifi connection it just doesn't turn GPS on and that should go back to profile 1.

Profile 1: Network locate ->Activate GPS when in range
Profile 2: GPS Locate ->Turn on Wifi
Profile 3: Wifi connect->Turn off GPS w/o exit condition

Or would this just have network polling all the time, or would that even be an issue? Yeah I guess it would cycle like you said...might have to throw in a variable there or something...ah, there's a Tasker action that let's you change profile statuses, so you can actually turn profiles 1 and 2 off and on when home.

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

Brightman posted:


Yeah, this should do it:
1. Network->Airplane mode: on
2. Tasker->Wait: 15 minutes
3. Network->Airplane mode:off
4. Tasker->Wait: 1 minute
5. Tasker-> Goto Action: 1

Or a profile set to "Every 15 minutes": Turn Airplane mode off, wait 1 minute, turn airplane mode on. The task can be made into a shortcut though.

This works great, but how do I exit the task from a widget? Clicking it again doesn't turn airplane mode off.

Brightman
Feb 24, 2005

I've seen fun you people wouldn't believe.
Tiki torches on fire off the summit of Kilauea.
I watched disco balls glitter in the dark near the Brandenburg Gate.
All those moments will be lost in time, like crowds in rain.

Time to sleep.
I've been messing with this and not having much luck. The problem with that task as a widget is that it will just run the task, not toggle it, so it will just run it forever. So you'd want to put the task in a profile and have a widget with a task that just toggles that profile on/off using Tasker->Profile Status set to toggle. However I still ran into the infinite loop problem even with the profile off, also this still doesn't end with airport mode turning off unless you hit it in that 1 minute window. If you do a profile like a mentioned earlier with the Context being "Every 15 minutes" I think it waits the 15 minutes first before doing the tasks, and it won't go below 2 minutes for whatever reason.

I tried using another profile and variables but the airport mode kept toggling even without the infinite goto loop and the profile off.

I suppose you could make the widget toggle airport mode and then toggle the profile, so it'd turn airport mode on, then the profile would wait and go about its business. Click it again and it'll turn airport mode off as long as you're not in that minute window again, and then toggle the profile off. This might work.

Might be easiest to just make a toggle for a profile for the airport toggling task and put it next to an airport toggle button. I think you can do this with WidgetSoid. Or someone else will think of something better.

Syrinxx
Mar 28, 2002

Death is whimsical today

Brightman posted:

I suppose you could make the widget toggle airport mode and then toggle the profile, so it'd turn airport mode on, then the profile would wait and go about its business. Click it again and it'll turn airport mode off as long as you're not in that minute window again, and then toggle the profile off. This might work.

Might be easiest to just make a toggle for a profile for the airport toggling task and put it next to an airport toggle button. I think you can do this with WidgetSoid. Or someone else will think of something better.
The option to turn on 4G/Wifi antennas every 15/30/60 etc minutes for a background update is built into Juice Defender if you're really in need of it.

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

Syrinxx posted:

The option to turn on 4G/Wifi antennas every 15/30/60 etc minutes for a background update is built into Juice Defender if you're really in need of it.

I need airplane mode so it'll check for SMS too.

This would all be much easier if the dev would implement running task killing but he doesn't seem to think it's a priority from what I found on Google.

I tried to set up a command to stop the task before it turns airplane mode off if it is already off, but I must be doing it wrong because it still wouldn't stop.

brc64
Mar 21, 2008

I wear my sunglasses at night.

Vykk.Draygo posted:

I need airplane mode so it'll check for SMS too.

This would all be much easier if the dev would implement running task killing but he doesn't seem to think it's a priority from what I found on Google.

I tried to set up a command to stop the task before it turns airplane mode off if it is already off, but I must be doing it wrong because it still wouldn't stop.

My brain is a little fried at the moment, but is this something that could potentially be handled with a variable that tracks whether airplane mode is currently on or off?

Something like:

Widget checks ProfileRunning variable. If variable is true, turn off the profile. If it's false, start it.

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

brc64 posted:

My brain is a little fried at the moment, but is this something that could potentially be handled with a variable that tracks whether airplane mode is currently on or off?

Something like:

Widget checks ProfileRunning variable. If variable is true, turn off the profile. If it's false, start it.

Maybe, but I wouldn't have a clue how to set that up. I am awful with Tasker variables.

Brightman
Feb 24, 2005

I've seen fun you people wouldn't believe.
Tiki torches on fire off the summit of Kilauea.
I watched disco balls glitter in the dark near the Brandenburg Gate.
All those moments will be lost in time, like crowds in rain.

Time to sleep.

brc64 posted:

My brain is a little fried at the moment, but is this something that could potentially be handled with a variable that tracks whether airplane mode is currently on or off?

Something like:

Widget checks ProfileRunning variable. If variable is true, turn off the profile. If it's false, start it.

I was messing around with that, although it was the other way, widget turned a variable on and off which a profile was looking for, so maybe this would work. There's also a context for State->Airplane mode, but it doesn't specify on/off so I'm not sure what's going on with it...google reveals that it means enabled, so inverting it would be off. I think this will work:

Make a profile called "whatever":
Context: State->Airplane Mode
Start task:
1)Wait 15 minutes
2)Turn off airplane mode
3)Wait one minute
Exit Task:
1)Turn on airplane mode

Turn profile off

Make a widget with this task:
1)Tasker->Profile Status: Toggle the profile "whatever"
2)Turn on airplane mode
3)Wait 5 seconds
4)Turn off airplane mode

This works for me. When you click the widget it toggles the profile on, turns airplane on to start the loop, waits 5 seconds (might work with less), then turns it off hitting the exit loop (apparently it will play out a enter task fully but outside influence kicks it straight to the exit loop) which turns it back on resetting the loop. When you click it again it turns the profile off, turns on airplane mode (most likely needlessly), waits 5 seconds because turning off the profile apparently sends it straight to the exit loop, and then turns airplane mode off.

Actually that seems odd, doesn't it? Let me increase my waits (I wasn't going to sit around for 15 minutes) and make sure it's not just coincidence...yeah, this works. The way tasker decides to hit exit tasks is sorta odd. Because it'll wait the full minute at the end of the start task, but it won't say wait the full 5 minutes when I turn the profile off with the widget, but it will still hit the exit task if you don't have that wait in there (I tried it without the wait and it toggled airplane mode on/off/on). Also there was that problem where I had the loop in a profile I was trying to toggle and the loop would keep going even with the profile off, so while I get how this works, the answer to why it works this way is hardly intuitive.

tater_salad
Sep 15, 2007


I'm having a problem with variables. I want to set something up to make sure that my wife is awake at a specific time or I get an alert to call her.

State 1: time 10:30
Events
I have taker set a random number as %rand
Then I have it text %rand to my wife
Then set %response to 3
Wait 30 and alert me if %response ~ 3 (ive also tried =)

State 2: text from wife comes in from wife and contains %rand
Event: set %response to 1.

if I run it normally without the if statement (alert runs fine) it works fine, but the second I put the if statement in it srnds texts but won't alert me if she doesn't respond.

The Diddler
Jun 22, 2006


I have a task set that stops my notification LED from blinking at night. Well, I did. It stopped working about a week ago, and I can't figure out how to fix it. Does anyone else have something like this that works and can help me?

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

Brightman posted:

I was messing around with that, although it was the other way, widget turned a variable on and off which a profile was looking for, so maybe this would work. There's also a context for State->Airplane mode, but it doesn't specify on/off so I'm not sure what's going on with it...google reveals that it means enabled, so inverting it would be off. I think this will work:

Make a profile called "whatever":
Context: State->Airplane Mode
Start task:
1)Wait 15 minutes
2)Turn off airplane mode
3)Wait one minute
Exit Task:
1)Turn on airplane mode

Turn profile off

Make a widget with this task:
1)Tasker->Profile Status: Toggle the profile "whatever"
2)Turn on airplane mode
3)Wait 5 seconds
4)Turn off airplane mode

This works for me. When you click the widget it toggles the profile on, turns airplane on to start the loop, waits 5 seconds (might work with less), then turns it off hitting the exit loop (apparently it will play out a enter task fully but outside influence kicks it straight to the exit loop) which turns it back on resetting the loop. When you click it again it turns the profile off, turns on airplane mode (most likely needlessly), waits 5 seconds because turning off the profile apparently sends it straight to the exit loop, and then turns airplane mode off.

Actually that seems odd, doesn't it? Let me increase my waits (I wasn't going to sit around for 15 minutes) and make sure it's not just coincidence...yeah, this works. The way tasker decides to hit exit tasks is sorta odd. Because it'll wait the full minute at the end of the start task, but it won't say wait the full 5 minutes when I turn the profile off with the widget, but it will still hit the exit task if you don't have that wait in there (I tried it without the wait and it toggled airplane mode on/off/on). Also there was that problem where I had the loop in a profile I was trying to toggle and the loop would keep going even with the profile off, so while I get how this works, the answer to why it works this way is hardly intuitive.

I've been playing with this off and on for the last week or two. The exit task on the profile doesn't seem to set the profile into motion again, so once it kicks airplane mode off and back on the first time, airplane mode will remain on until I disable it. I've tried all sorts of things to try to make this work but nothing I do works. Even with one task for on and one for off, I still can't get it to do a stupidly simple task like this.

b0nes
Sep 11, 2001
Am I doing this right>
Basically I want the brightness to go all the way uo when it is daytime, the phone is plugged in and either Maps or Waze is operating.

edit wht do I do to save this and make it work. Because after I do it it says "no active profiles" in the notification bar.

b0nes fucked around with this message at 20:54 on Jul 16, 2011

tater_salad
Sep 15, 2007


It should work, maybe delete the power context?

b0nes
Sep 11, 2001

tater_salad posted:

It should work, maybe delete the power context?

What do I add so that full brightness will be only when the power or USB is plugged in?

tater_salad
Sep 15, 2007


b0nes posted:

What do I add so that full brightness will be only when the power or USB is plugged in?

It may be that your car charger isn't being recognized properly.
Thats one thing I hate about tasker, there is no debug mode to see how things are set.

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

b0nes posted:

What do I add so that full brightness will be only when the power or USB is plugged in?

Change "power" to "USB plugged".

krushgroove
Oct 23, 2007

Disapproving look

b0nes posted:

edit wht do I do to save this and make it work. Because after I do it it says "no active profiles" in the notification bar.

I may be forgetting something but that button that says 'off' should say 'on' and be lit up green.

Brightman
Feb 24, 2005

I've seen fun you people wouldn't believe.
Tiki torches on fire off the summit of Kilauea.
I watched disco balls glitter in the dark near the Brandenburg Gate.
All those moments will be lost in time, like crowds in rain.

Time to sleep.

Vykk.Draygo posted:

I've been playing with this off and on for the last week or two. The exit task on the profile doesn't seem to set the profile into motion again, so once it kicks airplane mode off and back on the first time, airplane mode will remain on until I disable it. I've tried all sorts of things to try to make this work but nothing I do works. Even with one task for on and one for off, I still can't get it to do a stupidly simple task like this.

So the profile isn't looping properly then? When airplane mode is on is the profile not active then? Does the widget at least work?

You turn on the widget, this toggles the profile to on, and flips airplane on activating the profile, waits, and then flips it off sending it to the exit condition which turns airplane on and reactivates it. Does it remain on here, or does it wait the 15, turn off for 1 minute, and then the exit condition turns on airplane mode and then it never goes off?

Hmm, yeah, testing the profile again I'm getting the same behavior. This doesn't make a lot of sense...oddly this seems to turn my wireless on when airplane mode goes off as well. If that's happening for you too might want to throw that into the widget if it's a problem.

Okay, I think I figured it out. Move the last wait in the entry task to the exit task, so on exit it will wait one minute and then turn on airplane mode:

Context: airplane mode
entry task: wait 15 minutes, turn off airplane mode
exit task: wait 1 minute, turn on airplane mode

I've gotten this to loop 3 times now, although I haven't messed with this setup with the widget, but it should be okay since that turns the profile on and off.

Jensen
Jun 4, 2006

brc64 posted:

I do have a question about coarse location as it pertains to Android applications. How accurate is it? I've seen various levels of accuracy with GPS off, the most accurate being pretty drat accurate with a combination of network and wifi locations. Does the coarse location permission give them the most accurate result the phone can get at the time?

Yes. Course is everything that is not GPS (satellites). Wifi does get included in course.

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

Brightman posted:

So the profile isn't looping properly then? When airplane mode is on is the profile not active then? Does the widget at least work?

You turn on the widget, this toggles the profile to on, and flips airplane on activating the profile, waits, and then flips it off sending it to the exit condition which turns airplane on and reactivates it. Does it remain on here, or does it wait the 15, turn off for 1 minute, and then the exit condition turns on airplane mode and then it never goes off?

Hmm, yeah, testing the profile again I'm getting the same behavior. This doesn't make a lot of sense...oddly this seems to turn my wireless on when airplane mode goes off as well. If that's happening for you too might want to throw that into the widget if it's a problem.

Okay, I think I figured it out. Move the last wait in the entry task to the exit task, so on exit it will wait one minute and then turn on airplane mode:

Context: airplane mode
entry task: wait 15 minutes, turn off airplane mode
exit task: wait 1 minute, turn on airplane mode

I've gotten this to loop 3 times now, although I haven't messed with this setup with the widget, but it should be okay since that turns the profile on and off.

This works except if you toggle the profile off while it's in the exit task, Airplane Mode will end up on in the end. I fixed this by adding an additional 10 second wait and turning off airplane mode again. This is certainly more minimalistic than the way I figured out earlier which involved two profiles and two tasks.

Syrinxx
Mar 28, 2002

Death is whimsical today

Does anyone know if Tasker will complete an exit task if the phone has been rebooted since the entry task?

For example if I have

code:
From 0:00 to 08:00  
   > Bluetooth Off  
   < Bluetooth On

From 06:00
   > Reboot
Would it turn Bluetooth back on?

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

Syrinxx posted:

Does anyone know if Tasker will complete an exit task if the phone has been rebooted since the entry task?

For example if I have

code:
From 0:00 to 08:00  
   > Bluetooth Off  
   < Bluetooth On

From 06:00
   > Reboot
Would it turn Bluetooth back on?

As long as it's still between 0:00 and 8:00 (which it is), the profile should switch itself on when the phone reboots, and exit properly at 8:00. If you'd set it up stupidly and had like [Bluetooth off at 0:00, wait 8 hours, turn Bluetooth on], then it probably wouldn't work. As long as Tasker loads up during that time interval, everything should be fine.

Spatule
Mar 18, 2003
Could I use tasker (and maybe additional software) to change the alarm time in the morning according to traffic conditions ? Delay of more than 10 minutes on my way to work -> ring now if it's after 6.30AM for example.

tater_salad
Sep 15, 2007


Spatule posted:

Could I use tasker (and maybe additional software) to change the alarm time in the morning according to traffic conditions ? Delay of more than 10 minutes on my way to work -> ring now if it's after 6.30AM for example.

Tasker is meant for phone states so you really can't have it check external sources like traffic to adjust things.

Brightman
Feb 24, 2005

I've seen fun you people wouldn't believe.
Tiki torches on fire off the summit of Kilauea.
I watched disco balls glitter in the dark near the Brandenburg Gate.
All those moments will be lost in time, like crowds in rain.

Time to sleep.

Spatule posted:

Could I use tasker (and maybe additional software) to change the alarm time in the morning according to traffic conditions ? Delay of more than 10 minutes on my way to work -> ring now if it's after 6.30AM for example.

If you could find something that would text you if traffic was bad then Tasker could do this. I don't think there are any third party plug-ins that involve traffic, but I haven't really messed with that. If you could get a text though, Tasker could activate a profile or task based on the number that sent the text or the content of the message even.

Kameleon
Jan 11, 2006

gay for johnny deLOL BAT COUNTRY

So amongst all the other stuff I have Tasker doing, I have two profiles that are conflicting.

One (Screen On) turns wifi/data on when the screen is unlocked, along with setting a variable to tell Tasker that the screen is on. The other (Screen Off) clears the variable and turns the keyguard off, then waits for 15 seconds before checking if the variable is still off and if it is, disconnecting wifi/data and re-enabling the keyguard.

If I turn the screen off and then back on again within this 15 second window, when the 15 seconds are up the screen locks and wifi/data blip as they are momentarily disconnected. I've tried setting the Screen On profile with a higher priority but what am I missing to make the two profiles coexist?

MeKeV
Aug 10, 2010

Kameleon posted:

So amongst all the other stuff I have Tasker doing, I have two profiles that are conflicting.

One (Screen On) turns wifi/data on when the screen is unlocked, along with setting a variable to tell Tasker that the screen is on. The other (Screen Off) clears the variable and turns the keyguard off, then waits for 15 seconds before checking if the variable is still off and if it is, disconnecting wifi/data and re-enabling the keyguard.

If I turn the screen off and then back on again within this 15 second window, when the 15 seconds are up the screen locks and wifi/data blip as they are momentarily disconnected. I've tried setting the Screen On profile with a higher priority but what am I missing to make the two profiles coexist?

What you getting from this that you wouldn't from having "Wifi sleep policy" set to when screen off? Or are these part of a bigger pie?

Kameleon
Jan 11, 2006

gay for johnny deLOL BAT COUNTRY

MeKeV posted:

What you getting from this that you wouldn't from having "Wifi sleep policy" set to when screen off? Or are these part of a bigger pie?

It's part of a larger Juice Defender replacement, but these two would work entirely on their own (or not, currently). Also, WiFi sleep policy doesn't apply to mobile data?

[Screen On]
Context:
Display Unlocked

Task:
Variable Set: %SCREENSTATE to ON
WiFi: On (If %USEWIFI ~ YES)
Mobile Data APN: Enable On

[Screen Off]
Context:
Display Off

Task:
Keyguard: Set Off
Variable Clear: %SCREENSTATE
Wait: 15 seconds
Mobile Data APN: Enable Off (If %SCREENSTATE !~ ON)
Keyguard: Set On (If %SCREENSTATE !~ ON)

So if Screen On is started while Screen Off is in its wait cycle, SCREENSTATE doesn't get set to ON even though Screen On has a higher priority.

Kameleon fucked around with this message at 01:33 on Jul 27, 2011

brc64
Mar 21, 2008

I wear my sunglasses at night.
One of these days I need to revisit my "mute while on" profile and see if I can get it to work properly for all conditions.

The idea is that, when the screen is on, I'm actively using my phone, so I don't need it to make loud notification sounds in my hand. That in and of itself is fairly easy to do. The problem becomes how to get it to work properly when I have multiple audio profiles (I have volume set lower when I'm at home). I need to figure out how to save the current volume state and restore that when the screen goes off.

Vykk.Draygo
Jan 17, 2004

I say salesmen and women of the world unite!

brc64 posted:

One of these days I need to revisit my "mute while on" profile and see if I can get it to work properly for all conditions.

The idea is that, when the screen is on, I'm actively using my phone, so I don't need it to make loud notification sounds in my hand. That in and of itself is fairly easy to do. The problem becomes how to get it to work properly when I have multiple audio profiles (I have volume set lower when I'm at home). I need to figure out how to save the current volume state and restore that when the screen goes off.

Wouldn't a simple [when screen on, notification sounds off] with no exit task do this? As far as I know, the default exit task is to go back to however it was previously. If not, your active time or gps profile that says you're at home should take care of it.

Brightman
Feb 24, 2005

I've seen fun you people wouldn't believe.
Tiki torches on fire off the summit of Kilauea.
I watched disco balls glitter in the dark near the Brandenburg Gate.
All those moments will be lost in time, like crowds in rain.

Time to sleep.
Default exit task should do that in theory, but I've had some trouble with this before, but I'm probably not covering all my bases in other profiles. I had thought up a scheme using a volume variable that always gets set when the volume gets changed, but this would need to happen for all the volume controls and would be a tedious mess.

Adbot
ADBOT LOVES YOU

Kameleon
Jan 11, 2006

gay for johnny deLOL BAT COUNTRY

Kameleon posted:

[Screen Off]
Context:
Display Off

Task:
Keyguard: Set Off
Variable Clear: %SCREENSTATE
Wait: 15 seconds
Mobile Data APN: Enable Off (If %SCREENSTATE !~ ON)
Keyguard: Set On (If %SCREENSTATE !~ ON)

So if Screen On is started while Screen Off is in its wait cycle, SCREENSTATE doesn't get set to ON even though Screen On has a higher priority.

If anyone's interested, I worked it out. Display Unlocked doesn't register as an event if the keyguard is off when the screen is unlocked - so the second Screen On never got triggered. I presume I'd need Display On for that which would mean a lot of extra battery usage when the display comes on for random reasons. Oh well, at least I know!

Kameleon fucked around with this message at 01:35 on Jul 27, 2011

  • Locked thread