Tasker to change volume based on speed

913 views
Skip to first unread message

Robert Longshore

unread,
Jan 27, 2015, 4:49:58 PM1/27/15
to tas...@googlegroups.com
Hey, so I've spent upwards of 30 combined hours looking for a way to set tasker up to change my volume based on speed.

More specifically, what I want is for tasker to turn my media volume down when I'm below, say, 10 MPH and then turn back up when I'm above 10 MPH. I've tried everythING I've found to no success.

As of right now I have it set so that I plug in the AUX cord, it starts my play music app (android) and then it checks my speed and sets volume accordingly, but I want it to do that continuously, not just on plug in.

Any and all help is greatly appreciated!

Rich D

unread,
Jan 27, 2015, 5:33:14 PM1/27/15
to Tasker Google Groups Post


> Hey, so I've spent upwards of 30 combined hours looking for a way to set tasker up to change my volume based on speed.

Where exactly are you stuck?  Can you post what you have so far?

Seems it would start with a 'get location' :keep tracking. On action then a loop to keep testing the speed and set the volume accordingly.  It will get more complex then that but do you at least have that working? 

Rich D

unread,
Jan 27, 2015, 5:35:01 PM1/27/15
to Tasker Google Groups Post


To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

Robert Longshore

unread,
Jan 27, 2015, 5:42:52 PM1/27/15
to tas...@googlegroups.com
Music (9)
A1: Launch App [ App:Play Music Data: Exclude From Recent Apps:Off ] 
A2: Get Location [ Source:GPS Timeout (Seconds):100 Continue Task Immediately:On Keep Tracking:On ] 
A3: Variable Set [ Name:%Convert_LOCSPD_MPH To:%LOCSPD* 2.23693629 Do Maths:On Append:Off ] 
A4: Media Volume [ Level:15 Display:Off Sound:Off ] If [ %LOCSPD > 1 ]
A5: Get Location [ Source:GPS Timeout (Seconds):% Continue Task Immediately:On Keep Tracking:On ] 
A6: Media Volume [ Level:8 Display:Off Sound:Off ] If [ %LOCSPD < 1 ]

Hope that worked lol. First time doing a bunch of this, but I know Ive screwed this up somewhere. 
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/vqi57fr4VAE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

easiuser

unread,
Jan 27, 2015, 6:02:13 PM1/27/15
to tas...@googlegroups.com
From the users guide:

Keep Tracking: don't stop tracking the location source(s) when a value is returned This will use more power but enables faster fixes after the first one. When using this option, tracking can be stopped by the action Stop Location or doing Get Location without the option checked.
It will stop automatically if at any time no tasks are left to execute or the Get Location times out.


In other words you need to have the task below continuously looping to keep your location updating.

One way would be if a profile named AUX_plugged is used to call this task, add A7 goto A3 if %PACTIVE ~ *,AUX_plugged,*

BTW you can delete A5.  The location and speed are continuously updated as long as the task is running. 

Also, I would add a wait inside the loop, just to give other tasks some time to run if needed.
To unsubscribe from this group and all its topics, send an email to tasker+unsubscribe@googlegroups.com.

Robert Longshore

unread,
Jan 27, 2015, 6:19:20 PM1/27/15
to tas...@googlegroups.com
So it should look like this then?

Music (9)
A1: Launch App [ App:Play Music Data: Exclude From Recent Apps:Off ]
A2: Get Location [ Source:GPS Timeout (Seconds):100 Continue Task Immediately:On Keep Tracking:On ]
A3: Variable Set [ Name:%Convert_LOCSPD_MPH To:%LOCSPD* 2.23693629 Do Maths:On Append:Off ]
A4: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A5: Media Volume [ Level:15 Display:Off Sound:Off ] If [ %LOCSPD > 1 ]
A6: Media Volume [ Level:8 Display:Off Sound:Off ] If [ %LOCSPD < 1 ]
A7: Goto [ Type:Action Number Number:3 Label: ] If [ %PACTIVE ~ *,AUX_plugged,* ]

Rich D

unread,
Jan 27, 2015, 7:24:56 PM1/27/15
to Tasker Google Groups Post


>
> So it should look like this then?

Looks like a good start.  That should work. You can probably get away with a 2 second wait to make things more responsive. Now you should be able to use your converted speed and set your volumes to whatever speed you like..



>

Robert Longshore

unread,
Jan 27, 2015, 11:45:52 PM1/27/15
to tas...@googlegroups.com
It isn't working... I tried changing the name of the goto from PACTIVE~*,AUX_plugged,* to *,Headset_Plugged_Any,* and it still didn't work. Next question there I guess is this:
when I make the goto up, do the "*, ,*" have to be included or are those just for descriptions such as these? (Note, I put them in the actual goto so if they don't belong, that's probably why it isn't working haha)

easiuser

unread,
Jan 28, 2015, 9:38:04 AM1/28/15
to tas...@googlegroups.com
Chances are the profile Headset Plugged Any isn't named.  Tasker will assign an identifier that can be mistaken for a name.  Only named profiles show up in the %PACTIVE list.

To name the profile, long press on the profile, tap the "A" at the top, and give it a name.

Yes, you need the *, and ,* around the name because %PACTIVE is a list of active profiles.  ie ",profile1,profile2,AUX_plugged,profile3,".  Check out pattern matching in the users guide.


On Tuesday, January 27, 2015 at 10:45:52 PM UTC-6, Robert Longshore wrote:

Robert Longshore

unread,
Jan 28, 2015, 9:49:22 AM1/28/15
to tas...@googlegroups.com
Thanks! Just got to class when I saw this, gonna be going for some chipotle later and I'll try it out then! :D
Reply all
Reply to author
Forward
0 new messages