Related
So you are driving, your phone is connected to your car BT and someone sent you a SMS. Here is how Tasker can read it for you through you car speakers without even looking at your phone. What this Tasker profile will do is
Pause your Music (if any music was playing)
Say who this SMS is from
Read the SMS
Resume the music (if any music was playing before)
To do this, we will need 2 profiles, The first one is needed to do what is listed just above, the second one to monitor if any music was playing (because you don't want to resume your music after a SMS if no music was playing before)
Variables used:
%MTRACK The MTRACK variable is set to the media track name actually playing. If there is no media playing, MTRACK is unset. In this case we don't really care about the real value stored in MTRACK, we only need to know if there is one or not (if there is some music playing or not)
%SMSRN The SMSRN variable is the contact name from the last SMS received
%SMSRB The SMSRB variable is text body from the last SMS received
Instructions:
Profile/task #1:
Open Tasker and go at the profile page
Click the + sign to create a new profile and name it "Read SMS Aloud"
Select the "Event" trigger
in the "Select Event Category" menu, select "Phone"
in the "Select Phone Event" menu, select "Received Text"
In the Event Edit page, Select "Type" to "Any" and leave "Sender" and "Content" blank
Click your back button to exit and save the Even Edit page, this will bring your back to the Profiles page
Select "New Task" and name your task "Read SMS"
In the Task Edit page, click the + sign ---> Task ---> If
In the "Action Edit - If" page, set the Condition to "%MTRACK" and the Condition Operator to "Is Set" then click on your back button to save and go back to the Task Edit page.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click on the + sign ---> Media ---> Media Control
In the "Action Edit - Media Control" page, set the Cmd to "Pause" and deselect "Simulate Media Button" then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Alert ---> Say
In the "Action Edit - Say" page, set Text to "SMS received from %SMSRN" and leave all the other settings by default for now (You'll be able to adjust these settings later if you want) then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Task ---> Wait
In the "Action Edit - Wait" page, set Seconds to "1" then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Alert ---> Say
In the "Action Edit - Say" page, set Text to "%SMSRB" and leave all the other settings by default for now (You'll be able to adjust these settings later if you want) then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Task ---> Wait
In the "Action Edit - Wait" page, set Seconds to "1" then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Media ---> Media Control
In the "Action Edit - Media Control" page, set the Cmd to "Play" and deselect "Simulate Media Button" then click on your back button to save and go back to the Task Edit page
Click on the + sign ---> Task ---> Wait
In the "Action Edit - Wait" page, set Seconds to "2" then click on your back button to save and go back to the Task Edit page.
In the Task Edit page, click the + sign ---> Task ---> Else
In the "Action Edit - Else" page, leave everything default then click on your back button to save and go back to the Task Edit page.
In the "Action Edit - Say" page, set Text to "SMS received from %SMSRN" and leave all the other settings by default for now (You'll be able to adjust these settings later if you want) then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Task ---> Wait
In the "Action Edit - Wait" page, set Seconds to "1" then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Alert ---> Say
In the "Action Edit - Say" page, set Text to "%SMSRB" and leave all the other settings by default for now (You'll be able to adjust these settings later if you want) then click on your back button to save and go back to the Task Edit page.
In the Task Edit page, click the + sign ---> Task ---> End If
In the Task Edit page, click your back button to save the task and go back to the Profile page
On your "Read SMS Aloud" profile, click and hold your "Received Text" trigger, select "Add" ---> State ---> Net ---> BT Connected. Make sure your bluetooth is actually turned ON and that your phone already connected at least once to your car, on the "State Edit - BT Connected" page, click the magnifying glass and select your Car bluetooth Name and Address. Click your back button to go back to the profile page.
Now your task should look like this:
In summary:
Context:
If any SMS received and phone is connected to your car BT
Task:
If there some music playing, pause it, say aloud the name and message from the SMS, resume music. Else (if there is no music playing) don't pause or resume any music, just say aloud the name and message from the SMS.
Note:
If the MTRACK variable is SET (music playing) the "IF" portion of the task is valid (green) and the "ELSE" portion is invalid (red)
If the MTRACK variable is NOT SET (music paused or stopped) the "IF" portion of the task is invalid (red) and the "ELSE" portion is valid (green)
Action #8 (Wait 2 seconds) is needed to give time to the MTRACK variable to be set again and detected by Tasker after resuming the music so the "Else" part stay invalid and that you don't end up with your SMS being read twice. You might need to increase this value depending on your phone.
Profile/task #2:
This profile is needed so the MTRACK variable is monitored. It looks like MTRACK isn't correctly monitored if directly integrated in a task, there must be a profile actively monitoring this variable so it can also be monitored in a task.
In the profiles page, click on the + sign, name your new profile "Monitor %MTRACK"
Select the "Event" trigger ---> Variable --> Variable Set
In the "State Edit - Variable Set" page, set the Variable to "%MTRACK" then hit the back button to go back at the Profiles page.
Select New Task, name your new task "Monitor %MTRACK" Click the + sign ---> Alert ---> Flash
In the Action Edit - Flash" page, set the Text to "%MTRACK"
Hit your back button to save and you're done.
Compatible with:
Google Play Music/Songza
Power Amp
Phantom Music Control Pro
You tell me
Remember that this profile might need some adjustments depending on your phone. It worked fine on my One M7
Profiles/Tasks to restore
Profile: Read SMS Aloud
Code:
<TaskerData sr="" dvi="1" tv="4.8m">
<Profile sr="prof10" ve="2">
<cdate>1450846827049</cdate>
<clp>true</clp>
<edate>1450854667845</edate>
<id>10</id>
<mid0>11</mid0>
<nme>Read SMS Aloud</nme>
<Event sr="con0" ve="2">
<code>7</code>
<pri>0</pri>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
</Event>
<State sr="con1" ve="2">
<code>3</code>
<Str sr="arg0" ve="3">VW BT 2903</Str>
<Str sr="arg1" ve="3">FC:62:B9:28:40:1F</Str>
</State>
</Profile>
<Task sr="task11">
<cdate>1450846870769</cdate>
<edate>1450859956935</edate>
<id>11</id>
<nme>Read SMS</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%MTRACK</lhs>
<op>12</op>
<rhs>0</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act1" ve="7">
<code>443</code>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="0"/>
<App sr="arg2"/>
</Action>
<Action sr="act10" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act11" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">%SMSRB</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act12" ve="7">
<code>38</code>
</Action>
<Action sr="act2" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">SMS received from %SMSRN</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act3" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act4" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">%SMSRB</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act5" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act6" ve="7">
<code>443</code>
<Int sr="arg0" val="5"/>
<Int sr="arg1" val="0"/>
<App sr="arg2"/>
</Action>
<Action sr="act7" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act8" ve="7">
<code>43</code>
</Action>
<Action sr="act9" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">SMS received from %SMSRN</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
</Task>
</TaskerData>
Task: Read SMS
Code:
<TaskerData sr="" dvi="1" tv="4.8m">
<Task sr="task11">
<cdate>1450846870769</cdate>
<edate>1450859956935</edate>
<id>11</id>
<nme>Read SMS</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%MTRACK</lhs>
<op>12</op>
<rhs>0</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act1" ve="7">
<code>443</code>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="0"/>
<App sr="arg2"/>
</Action>
<Action sr="act10" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act11" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">%SMSRB</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act12" ve="7">
<code>38</code>
</Action>
<Action sr="act2" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">SMS received from %SMSRN</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act3" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act4" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">%SMSRB</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act5" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act6" ve="7">
<code>443</code>
<Int sr="arg0" val="5"/>
<Int sr="arg1" val="0"/>
<App sr="arg2"/>
</Action>
<Action sr="act7" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act8" ve="7">
<code>43</code>
</Action>
<Action sr="act9" ve="7">
<code>559</code>
<Str sr="arg0" ve="3">SMS received from %SMSRN</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
<Int sr="arg7" val="0"/>
</Action>
</Task>
</TaskerData>
Profile: Monitor MTRACK
Code:
<TaskerData sr="" dvi="1" tv="4.8m">
<Profile sr="prof14" ve="2">
<cdate>1450850534030</cdate>
<edate>1450856245620</edate>
<id>14</id>
<mid0>15</mid0>
<nme>Monitor %MTRACK</nme>
<Event sr="con0" ve="2">
<code>3050</code>
<pri>0</pri>
<Str sr="arg0" ve="3">%MTRACK</Str>
<Str sr="arg1" ve="3"/>
<Int sr="arg2" val="0"/>
</Event>
</Profile>
<Task sr="task15">
<cdate>1450850560377</cdate>
<edate>1450856245620</edate>
<id>15</id>
<nme>Monitor %MTRACK</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">%MTRACK</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
</TaskerData>
Task: Monitor MTRACK
Code:
<TaskerData sr="" dvi="1" tv="4.8m">
<Task sr="task15">
<cdate>1450850560377</cdate>
<edate>1450856245620</edate>
<id>15</id>
<nme>Monitor %MTRACK</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">%MTRACK</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
</TaskerData>
Thanks
Sent from my SM-G928V using Tapatalk
MANswers said:
Thanks
Sent from my SM-G928V using Tapatalk
Click to expand...
Click to collapse
Or just use "ok google" then "read last messages"
wozn said:
Or just use "ok google" then "read last messages"
Click to expand...
Click to collapse
Which will requires you to take your phone, unlock it and send 3 vocal commands while driving ("ok google", read last message", "yes"). This Tasker profile will do everything for you without having to do anything with your phone. Also have to mention that this is a Tasker forum section, there might be different way to achieve the same result but if its without Tasker then its off topic here but however its a valuable option for ppl without Tasker :good:
This is awesome! I had no idea Tasker could control things to this extent!
Thank you!
Hi, great profile just a question before I try to make it work when my headset is plugged, do I have to "create" the variables you use before I start ? I've never played with variables :s
Envoyé de mon A0001 en utilisant Tapatalk
Awesome work OP. This is a very useful profile!
nicolahaye said:
Hi, great profile just a question before I try to make it work when my headset is plugged, do I have to "create" the variables you use before I start ? I've never played with variables :s
Envoyé de mon A0001 en utilisant Tapatalk
Click to expand...
Click to collapse
No, all 3 variables used in this profile are Global Built-In Variables that are always monitored by Tasker:
Music Track (dynamic,monitored)))
%MTRACK
The current playing music track, supported for:
Tasker actions Music Play and Music Play Dir
Built-in Android music-player, probably not on all devices however
Power AMP
BeyondPod (Tasker v1.2.1+)
Phantom Music Control Pro
Media Utilities
Priority: if both Tasker and one of the other supported apps are playing simultaneously, the non-Tasker track will be shown. If more than one of the other supported apps is playing simultaneuosly, behaviour is unspecified.
Notes:
if you don't have a supported player, you could try Phantom Music Control Pro or Media Utilities, which support a lot of players and should pass the info on to Tasker
pausing a track clears the variable, unpausing sets it again
your music player may need an option enabled in order to broadcast the track information, or the broadcast may only be available in a 'pro' version
Text From/Date/Subject/Time (monitored)
%SMSRF / %SMSRN / %SMSRB / %MMSRS / %SMSRD / %SMSRT
The sender address, name, body, subject, date and time of the last text (SMS or MMS) received.
These variables will be empty until the first time a text is received after they have been referenced because Tasker does not monitor texts unless it's needed.
Name is set to sender address of no contact could be looked up. It's unavailable on Android versions prior to 2.0.
Body (%SMSRB) is only set for SMSs.
Subject (%MMSRS) is only set for MMSs.
DrGreenway said:
Awesome work OP. This is a very useful profile!
Click to expand...
Click to collapse
Thanks for your feedback :good:
wozn said:
Or just use "ok google" then "read last messages"
Click to expand...
Click to collapse
Too long a process whilst driving. If only "read last message" worked with Android wear.
Sent from my SM-G925F using Tapatalk
Hi alray,
Exemplary work Sir, and very impressive. So please don't think of me as nit-picking, but I do have a small suggestion. In the first profile instruction set I noticed what may be an oversight. Perhaps you would consider the following insertion after step 26:
26. In the "Action Edit - Else" page, leave everything default then click on your back button to save and go back to the Task Edit page.
Click on the + sign ---> Alert ---> Say27. In the "Action Edit - Say" page, set Text to "SMS received from %SMSRN" and leave all the other settings by default for now (You'll be able to adjust these settings later if you want) then click on your back button to save and go back to the Task Edit page.
In any case, I understood what you meant and I gave a 'thumbs-up' to your work. It is running on my stock Nexus 6 (MMB29V) without fault, though I'll be reworking it a bit to fit my needs. So again, many thanks!
did it work for someone ? doesn't work on my honda 2015
macpain64 said:
did it work for someone ? doesn't work on my honda 2015
Click to expand...
Click to collapse
from post #1
Remember that this profile might need some adjustments depending on your phone. It worked fine on my One M7
Click to expand...
Click to collapse
so
1- yes its working for some
2- You might need to adapt the profile to your phone. What exactly, hard to tell. The only info you've provided is that you're driving an honda. Might want to share your profile, post some screenshots, phone info, etc...
Hi, this task seems great!
I'm new to tasker, i downloaded it like a week ago, and i'd like to know if it is possibl to do the same with emails...
regards,
Thread is a work in progress. Started the draft on my phone. Please wait a bit before flooding with complaints
Oftentimes I find myself wanting to use Google shopping or Slickdeals. However, AdAway host file often block these links. Although I can whitelist a select # of links, it virtually breaks adblocking everywhere, since many apps and website use the same ad services.
So I created this task that allows me to quickly enable/disable AdAway from quick settings. This is independent from the AdAway app and you don't need to have the AdAway app. It does however, use AdAway online repro to produce the same result.
What is needed:
Root (if you use systemless root, like MagiskSU, ensure that you enable systemless host in the settings)
Tasker
QuickTask
(free app in the play store)
Step 1, create the quick task button: Open QuickTask and create a button called AdAway (self explanatory)
Step 2, create the Tasker task and profile:
Import the XML from the code below or from the attached XML file below
Code:
Code:
<TaskerData sr="" dvi="1" tv="5.0u3m">
<Profile sr="prof9" ve="2">
<cdate>1496602694841</cdate>
<edate>1503239398635</edate>
<id>9</id>
<mid0>11</mid0>
<nme>AdAway QS</nme>
<Event sr="con0" ve="2">
<code>1565789502</code>
<pri>0</pri>
<Bundle sr="arg0">
<Vals sr="val">
<com.balda.quicktask.extra.EVENTS>0</com.balda.quicktask.extra.EVENTS>
<com.balda.quicktask.extra.EVENTS-type>java.lang.Integer</com.balda.quicktask.extra.EVENTS-type>
<com.balda.quicktask.extra.INT_VERSION_CODE>30</com.balda.quicktask.extra.INT_VERSION_CODE>
<com.balda.quicktask.extra.INT_VERSION_CODE-type>java.lang.Integer</com.balda.quicktask.extra.INT_VERSION_CODE-type>
<com.balda.quicktask.extra.OPERATION>0</com.balda.quicktask.extra.OPERATION>
<com.balda.quicktask.extra.OPERATION-type>java.lang.Integer</com.balda.quicktask.extra.OPERATION-type>
<com.balda.quicktask.extra.TILES><StringArrayList sr=""><_arrlst_com.balda.quicktask.extra.TILES0>AdAway</_arrlst_com.balda.quicktask.extra.TILES0></StringArrayList></com.balda.quicktask.extra.TILES>
<com.balda.quicktask.extra.TILES-type>java.util.ArrayList</com.balda.quicktask.extra.TILES-type>
<com.twofortyfouram.locale.intent.extra.BLURB>AdAway</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%qtname
Tile name
Name of tile pressed</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1>%qtevent
Tile name
Event: tap or double tap</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2>%qtstatus
Current tile status
It can be: Enabled, Disabled</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.balda.quicktask</Str>
<Str sr="arg2" ve="3">com.balda.quicktask.ui.QueryTileActivity</Str>
</Event>
</Profile>
<Task sr="task11">
<cdate>1496603118566</cdate>
<edate>1503239398635</edate>
<id>11</id>
<nme>AdAway</nme>
<Action sr="act0" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%qtstatus</lhs>
<op>2</op>
<rhs>Disabled</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act1" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">Enabling AdAway</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act10" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">echo "127.0.0.1 localhost
::1 localhost" >> /etc/hosts</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act11" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">AdAway Disabled</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act12" ve="7">
<code>38</code>
</Action>
<Action sr="act2" ve="7">
<code>508779925</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.balda.quicktask.extra.IMAGE>check_bookmark</com.balda.quicktask.extra.IMAGE>
<com.balda.quicktask.extra.IMAGE-type>java.lang.String</com.balda.quicktask.extra.IMAGE-type>
<com.balda.quicktask.extra.INT_VERSION_CODE>31</com.balda.quicktask.extra.INT_VERSION_CODE>
<com.balda.quicktask.extra.INT_VERSION_CODE-type>java.lang.Integer</com.balda.quicktask.extra.INT_VERSION_CODE-type>
<com.balda.quicktask.extra.OPERATION>3</com.balda.quicktask.extra.OPERATION>
<com.balda.quicktask.extra.OPERATION-type>java.lang.Integer</com.balda.quicktask.extra.OPERATION-type>
<com.balda.quicktask.extra.STATE>0</com.balda.quicktask.extra.STATE>
<com.balda.quicktask.extra.STATE-type>java.lang.Integer</com.balda.quicktask.extra.STATE-type>
<com.balda.quicktask.extra.TILE>AdAway</com.balda.quicktask.extra.TILE>
<com.balda.quicktask.extra.TILE-type>java.lang.String</com.balda.quicktask.extra.TILE-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Change image AdAway</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>com.balda.quicktask.extra.IMAGE</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.balda.quicktask</Str>
<Str sr="arg2" ve="3">com.balda.quicktask.ui.FireTileImageActivity</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act3" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">wget -O /sdcard/tasker/adblock/adaway.txt http://adaway.org/hosts.txt;
wget -O /sdcard/tasker/adblock/mvps.txt http://winhelp2002.mvps.org/hosts.txt;
wget -O /sdcard/tasker/adblock/hphosts.txt http://hosts-file.net/.%5Cad_servers.txt;
wget -O /sdcard/tasker/adblock/yoyos.txt http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext;</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act4" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">sort -u /sdcard/tasker/adblock/*.txt > /etc/hosts</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act5" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">AdAway Enabled</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act6" ve="7">
<code>43</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%qtstatus</lhs>
<op>2</op>
<rhs>Enabled</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act7" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">Disabling AdAway</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act8" ve="7">
<code>508779925</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.balda.quicktask.extra.IMAGE>check_bookmark_black</com.balda.quicktask.extra.IMAGE>
<com.balda.quicktask.extra.IMAGE-type>java.lang.String</com.balda.quicktask.extra.IMAGE-type>
<com.balda.quicktask.extra.INT_VERSION_CODE>31</com.balda.quicktask.extra.INT_VERSION_CODE>
<com.balda.quicktask.extra.INT_VERSION_CODE-type>java.lang.Integer</com.balda.quicktask.extra.INT_VERSION_CODE-type>
<com.balda.quicktask.extra.OPERATION>3</com.balda.quicktask.extra.OPERATION>
<com.balda.quicktask.extra.OPERATION-type>java.lang.Integer</com.balda.quicktask.extra.OPERATION-type>
<com.balda.quicktask.extra.STATE>1</com.balda.quicktask.extra.STATE>
<com.balda.quicktask.extra.STATE-type>java.lang.Integer</com.balda.quicktask.extra.STATE-type>
<com.balda.quicktask.extra.TILE>AdAway</com.balda.quicktask.extra.TILE>
<com.balda.quicktask.extra.TILE-type>java.lang.String</com.balda.quicktask.extra.TILE-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Change image AdAway</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>com.balda.quicktask.extra.IMAGE</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.balda.quicktask</Str>
<Str sr="arg2" ve="3">com.balda.quicktask.ui.FireTileImageActivity</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act9" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">truncate -s0 /etc/hosts</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
</Task>
</TaskerData>
Step 3, enjoy
Great one!
However why use QuickTask when you can use Tasker's integrated QS? Tasker > Preferences to define them.
Im_Mattgame said:
Great one!
However why use QuickTask when you can use Tasker's integrated QS? Tasker > Preferences to define them.
Click to expand...
Click to collapse
I am a newbie when speaking about tasker... I cannot get the integrated QS to work. I mean, I can link the task to the toggle button in the quick setting, but nothing happens.
If I test the task directly in tasker everything works.....
Can someone explain how to do a simple toggle task with the integrated QS? Or point me in a tutorial direction...
Thank you all
Fabio
friboli said:
I am a newbie when speaking about tasker... I cannot get the integrated QS to work. I mean, I can link the task to the toggle button in the quick setting, but nothing happens.
If I test the task directly in tasker everything works.....
Can someone explain how to do a simple toggle task with the integrated QS? Or point me in a tutorial direction...
Thank you all
Fabio
Click to expand...
Click to collapse
Doesn't work for me neither however I already have autonotification, how can I use this with that? Thanks
A step by step tutorial for a complete tasker noob please.
I created the QS tile but couldn't do the tasker part like importing the XML and stuff. Please Help! ?
What do I do with the XML? I am quite new to tasker so can someone please explain how to use the XML!!
PuiPuiTuiPui said:
What do I do with the XML? I am quite new to tasker so can someone please explain how to use the XML!!
Click to expand...
Click to collapse
This is a profile XML so you need to import it under profiles.
To do this, follow these steps:
Starting from the main menu:
Three-dot menu > Preferences > UI > Beginner Mode (disable - untick)
Go back to main menu pressing the back arrow
Long press the "PROFILES" tab
Select "Import"
Navigate to the downloaded XML file
Hey there.
I recently discovered this thread to quickly toggle adaway.
My only problem is that tasker doesn't download the hosts.txt from adaway.org.
The other two files get downloaded correctly but the download from adaway.org sometimes gives me a handshake failure or just nothing, but a hosts.txt never appears in the adblock folder.
Do you got any ideas on that? I already tried HTTP GET instead. But no luck with that, too.
Cheers,
Xerx
#edit: it does work with HTTP GET if I use the https source. Now I have to figure out why MagiskSU doesn't activate the systemless hosts file. ads still pop up...
#edit2: recreated the whole thing manually (without downloading the xml) and now everything works as expected. [Don't ask my why. I'm just happy.]
Thank you for this awesome method to quickly toggle AdAway
Uhh......Wouldn't this require a reboot for changes to take effect?
Xerx3sHipe said:
#edit2: recreated the whole thing manually (without downloading the xml) and now everything works as expected. [Don't ask my why. I'm just happy.]
Thank you for this awesome method to quickly toggle AdAway
Click to expand...
Click to collapse
Does the AdAway hosts file line still look like this?
Code:
wget -O /sdcard/tasker/adblock/adaway.txt https://adaway.org/hosts.txt
I have tried separating the wget commands into their own Actions, and only this still fails with "Error: 1", however the other three are definitely writing (although I'm having this issue with another hosts file I put in myself). It still happens if I put it in its own Task, with no other actions.
---------- Post added at 11:29 PM ---------- Previous post was at 11:23 PM ----------
Stupifier said:
Uhh......Wouldn't this require a reboot for changes to take effect?
Click to expand...
Click to collapse
It doesn't seem like it. I can't get the enabling through the tile to work correctly, but once its disabled like this and I re-enable ad blocking through AdAway, it seems to work after a couple of minutes, but may require restarting apps that already have the ads loaded.
DarkusRattus said:
Does the AdAway hosts file line still look like this?
I have tried separating the wget commands into their own Actions, and only this still fails with "Error: 1", however the other three are definitely writing (although I'm having this issue with another hosts file I put in myself). It still happens if I put it in its own Task, with no other actions.
Click to expand...
Click to collapse
No, I replaced the wget command with http get lines:
Code:
A3: HTTP Get [ Server:Port:[url]https://adaway.org/hosts.txt[/url] Pfad: Attribute: Cookies: User Agent: Timeout:10 MIME Typ: Ausgabe Datei:Tasker/adblock/hosts.txt Trust Any Certificate:Aus ]
A4: HTTP Get [ Server:Port:[url]https://hosts-file.net/ad_servers.txt[/url] Pfad: Attribute: Cookies: User Agent: Timeout:10 MIME Typ: Ausgabe Datei:Tasker/adblock/ad_servers.txt Trust Any Certificate:Aus ]
A5: HTTP Get [ Server:Port:[url]https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext[/url] Pfad: Attribute: Cookies: User Agent: Timeout:10 MIME Typ: Ausgabe Datei:Tasker/adblock/yoyos.txt Trust Any Certificate:Aus ]
DarkusRattus said:
Does the AdAway hosts file line still look like this?
Code:
wget -O /sdcard/tasker/adblock/adaway.txt https://adaway.org/hosts.txt
I have tried separating the wget commands into their own Actions, and only this still fails with "Error: 1", however the other three are definitely writing (although I'm having this issue with another hosts file I put in myself). It still happens if I put it in its own Task, with no other actions.
---------- Post added at 11:29 PM ---------- Previous post was at 11:23 PM ----------
It doesn't seem like it. I can't get the enabling through the tile to work correctly, but once its disabled like this and I re-enable ad blocking through AdAway, it seems to work after a couple of minutes, but may require restarting apps that already have the ads loaded.
Click to expand...
Click to collapse
I have improved the code, my new thread can be found here: https://forum.xda-developers.com/an...appfactory-t3749207/post75557345#post75557345
Xerx3sHipe said:
No, I replaced the wget command with http get lines:
Code:
A3: HTTP Get [ Server:Port:[url]https://adaway.org/hosts.txt[/url] Pfad: Attribute: Cookies: User Agent: Timeout:10 MIME Typ: Ausgabe Datei:Tasker/adblock/hosts.txt Trust Any Certificate:Aus ]
A4: HTTP Get [ Server:Port:[url]https://hosts-file.net/ad_servers.txt[/url] Pfad: Attribute: Cookies: User Agent: Timeout:10 MIME Typ: Ausgabe Datei:Tasker/adblock/ad_servers.txt Trust Any Certificate:Aus ]
A5: HTTP Get [ Server:Port:[url]https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext[/url] Pfad: Attribute: Cookies: User Agent: Timeout:10 MIME Typ: Ausgabe Datei:Tasker/adblock/yoyos.txt Trust Any Certificate:Aus ]
Click to expand...
Click to collapse
Just saw this... I wish I would have seen it before I went breaking my head and figuring this out on my own.
So you need to restart the phone after disabling the adblocker?
This would seem to have been an extremely simple thing and i've even found a place on the wiki where it had a downloadable profile that would do this. The newer versions of Tasker don't allow for import of those profiles it doesn't seem, if it doesn't I am not doing it right. I've made some profiles and tasks to this point, simple stuff, like turn wifi on at home or work, and set display to auto rotate (orientation) for certain apps. I'm still way n00b with tasker. I would like to use tasker to turn off my bluetooth if it goes a period of time without a device connected. Can someone do a noob walk through of how to do this?
Thanks in advance.
Create a profile -> State -> BT Connected (leave everything alone except tic invert)
Create enter task
Task -> Wait (set the delay you want)
Net -> Bluetooth -> Set [Off]
------ edit --------
The above is literally what you asked for. However, assuming the delay is to ensure nothing has connected to BT before shutting it off, you might want to add an IF statement to the final action. Such as:
"%PACTIVE ~ *[Profile name]*
[Profile name] should be replaced with the actual name of this profile. Leave the * in place though.
A final thought is by adding a second context to the profile:
State -> net -> BT status (on)
This profile will be active only when BT is on.
Hi, I think I did the same thing but it didn't work. The Bluetooth just stays On and doesn't disconnect after 20 seconds. The profile in the Tasker app shows green color after turning on the Blutooth.
Pasting the profile from xml. Can you please check if there's any error?
PHP:
<TaskerData sr="" dvi="1" tv="5.0u5m">
<Profile sr="prof41" ve="2">
<cdate>1504900913492</cdate>
<edate>1504902100965</edate>
<id>41</id>
<mid0>42</mid0>
<nme>Bluetooth Auto Off</nme>
<State sr="con0" ve="2">
<code>3</code>
<pin>true</pin>
<Str sr="arg0" ve="3"/>
<Str sr="arg1" ve="3"/>
</State>
<State sr="con1" ve="2">
<code>2</code>
<Int sr="arg0" val="1"/>
</State>
</Profile>
<Task sr="task42">
<cdate>1504900934895</cdate>
<edate>1504902039267</edate>
<id>42</id>
<nme>BT Disconnected</nme>
<Action sr="act0" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="20"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>294</code>
<Int sr="arg0" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%PACTIVE</lhs>
<op>2</op>
<rhs>Bluetooth Auto Off</rhs>
</Condition>
</ConditionList>
</Action>
</Task>
</TaskerData>
How about selecting the profile with a long press, "exporting -> description to clipboard" then pasting that here.
ktmom said:
Create a profile -> State -> BT Connected (leave everything alone except tic invert)
Create enter task
Task -> Wait (set the delay you want)
Net -> Bluetooth -> Set [Off]
------ edit --------
The above is literally what you asked for. However, assuming the delay is to ensure nothing has connected to BT before shutting it off, you might want to add an IF statement to the final action. Such as:
"%PACTIVE ~ *[Profile name]*
[Profile name] should be replaced with the actual name of this profile. Leave the * in place though.
A final thought is by adding a second context to the profile:
State -> net -> BT status (on)
This profile will be active only when BT is on.
Click to expand...
Click to collapse
Awesome, I'll give this a shot in just a bit thank you
ktmom said:
How about selecting the profile with a long press, "exporting -> description to clipboard" then pasting that here.
Click to expand...
Click to collapse
Profile: Bluetooth Auto Off (41)
State: Not BT Connected [ Name:* Address:* ]
State: BT Status [ Statusn ]
Enter: BT Disconnected (42)
A1: Wait [ MS:0 Seconds:20 Minutes:0 Hours:0 Days:0 ]
A2: Bluetooth [ Setff ] If [ %PACTIVE ~ Bluetooth Auto Off ]
Oops, sorry, some texts are converted to emojis.
-----Edit------
Something more; if I manually 'turn off' the Bluetooth, the Tasker automatically 'turns on' it.
ktmom said:
Create a profile -> State -> BT Connected (leave everything alone except tic invert)
Create enter task
Task -> Wait (set the delay you want)
Net -> Bluetooth -> Set [Off]
------ edit --------
The above is literally what you asked for. However, assuming the delay is to ensure nothing has connected to BT before shutting it off, you might want to add an IF statement to the final action. Such as:
"%PACTIVE ~ *[Profile name]*
[Profile name] should be replaced with the actual name of this profile. Leave the * in place though.
A final thought is by adding a second context to the profile:
State -> net -> BT status (on)
This profile will be active only when BT is on.
Click to expand...
Click to collapse
Without the added contexts you mentioned it just turned the Bluetooth off on a timer, even while it was connected and I was talking on the phone. With the two added contexts it seems to work perfect
Correction, it doesn't work at all now it would seem. Hmm. I'll try to make it again tomorrow.
Edit; yeah I've went through it and tried over and over neither seems to work. Even having ticed invert, it basically just turns it off on a timer. No matter what else. Hmm so close. I can post screen shots of how I've done it if you want to see
I agree for some reason this seems to have stopped working.
Had this simple profile that would turn off after a few minutes of disconnecting from my car blue tooth.
Was using a variable once connected to specific bt
Perhaps after the update something changed? Weird
From what I can tell, it is the check for the variable %BLUE ~ "on" is what is causing bluetooth to turn back on. FWIW, I tried making a similar profile that would do the same with WiFi, and that's how I discovered the bug. I'm trying to find a way to trigger a different profile based on an event of bluetooth turning on, and then that would turn on the "Main" profile we had before. I'll update if I figure it out.
Long press on the profile name then hit the gear icon then deselect "restore settings"
ktmom said:
Long press on the profile name then hit the gear icon then deselect "restore settings"
Click to expand...
Click to collapse
This worked like a charm!
ktmom said:
Long press on the profile name then hit the gear icon then deselect "restore settings"
Click to expand...
Click to collapse
I'm here after a google search, thank you! I also had do delete the profile and create it again.
I use this to cycle Bluetooth...XML is:
<TaskerData sr="" dvi="1" tv="5.6">
<Profile sr="prof2" ve="2">
<cdate>1542882243077</cdate>
<edate>1554470940795</edate>
<flags>16</flags>
<id>2</id>
<mid0>3</mid0>
<nme>Cycle Bluetooth</nme>
<Share sr="Share">
<d>Cycle Bluetooth</d>
<t></t>
</Share>
<State sr="con0" ve="2">
<cname>BT On</cname>
<code>3</code>
<pin>true</pin>
<Str sr="arg0" ve="3">Cycle Bluetooth</Str>
<Str sr="arg1" ve="3"/>
</State>
</Profile>
<Task sr="task3">
<cdate>1542882243062</cdate>
<edate>1554470940795</edate>
<id>3</id>
<rty>1</rty>
<Action sr="act0" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%BLUE</lhs>
<op>2</op>
<rhs>Off</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act1" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="5"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act2" ve="7">
<code>294</code>
<Int sr="arg0" val="1"/>
</Action>
<Action sr="act3" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="10"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act4" ve="7">
<code>294</code>
<Int sr="arg0" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%PACTIVE</lhs>
<op>2</op>
<rhs>*Auto Off Unpaired Bluetooth*</rhs>
</Condition>
</ConditionList>
</Action>
</Task>
</TaskerData>
Sent from my Pixel
I really appreciate all your helpful responses to this question but unfortunately it seems not to be working with the current Tasker version. Does anyone have an updated tip to make this work? Forgetting to disable Bluetooth is the bane of my battery
Shezkah said:
I really appreciate all your helpful responses to this question but unfortunately it seems not to be working with the current Tasker version. Does anyone have an updated tip to make this work? Forgetting to disable Bluetooth is the bane of my battery
Click to expand...
Click to collapse
It would be easier to help you troubleshoot your current profile. Please post the description and what tasker version and device/OS. All of these can affect how a task performs.
The problem I was facing is the "check" to see if bluetooth was connected, in which case it is undesirable to disconnect obviously.
For instance I disconnect from car bluetooth and within the wait time I reconnect to it (or another bluetooth device for that matter).
The previous solutions would turn off bluetooth after the timer has finished, regardless if you are connected or not.
EDIT: Here is my new, more elegant solution.
The solution I had before is at the bottom of this post.
Summary
Create a profile that's activated when bluetooth is connected and on.
This triggers a wait time, after which it turns off bluetooth.
It only does this when this profile is active, thus only when nothing is connected to bluetooth.
Detailed steps
Create a profile and call it "BT Disconnected"
Then choose context: State, Net, BT Connected
Leave name and address blank, but check invert
Confirm by using the back button (top left)You're now prompted to select a task, create a new one
Call it "BT Auto Off"
Press the + to add an action
Select action category: Task, Wait
Now fill it with the delay you want
(Note: do not set too short, this will turn bluetooth off before it can connect to anything. I suggest at least a minute or so.)
Confirm by using the back button (top left)Add another task with the plus icon (bottom right)
Select action category: Net, Bluetooth
Leave set to "off" and add an If argument
For the variable, fill in %PACTIVE
Leave operator as Match (~)
As value, type: *,BT Disconnected,*
(Note: use the profile name you chose at the start, between commas and asterisks)
Optionally label the task something like "BT off if not connected"
Confirm by using the back buttonGo back to the tasker main screen, let's add another context.
Click the profile to unfold it and long press the state "Not BT Connected"
Choose add for our second context: State, Net, BT Status
Change status to "on"
Confirm by using the back button (top left)Don't forget to press the check mark at the top of the main screen to confirm the changes and activate them.
Hope this helps someone!
-----------------------------------------------------------------------------------
My previous solution is behind the button below.
I set up a profile which is active when bluetooth is connected and used the exit task to turn off bluetooth.
The steps below walk you through the setup of this profile
Create a profile
Call it "BT Connected"
Then chose: State, Net, BT Connected
Leave everything blank (we want this profile to be active during all bluetooth connections)
Confirm by using the back button.You're now prompted to select a task, create a new one
Call it "Do Nothing"
Press the + to add an action
Select action category: Task, Wait
Then set it to 1 second.
Confirm the action and then the task by using the back button twice.Now you're back at the main screen, long press the "-> Do Nothing" and add an exit task.
Call it "BT Auto Off"
Press the + to add an action
Select action category: Task, Wait
Now fill it with the delay you want
I suggest at least a minute or so to allow a lost connection to reconnect. Can also be much more, I have mine set to 10min.Confirm the wait time and add another action.
Select action category: Net, Bluetooth
Set "off" and add an If argument.
For the variable, fill in %PACTIVE
For operator choose Doesn't match (!~)
For argument use *,BT Connected,*
Note: use the profile we are creating, between asterisks and commas.Confirm by using the back button.Now all you need to do is press the check mark at the top of the main screen to confirm the changes and activate them.
What it does, explained
The new profile (BT Connected) is activated when you connect to any BT device.
Once activated it runs the entry task which is "Do Nothing". That is because we don't want it to do anything but we do need this profile to be active while connected.
When the bluetooth connection is lost, the exit task runs. That is waiting for the delay time you set and after that turning off bluetooth.
The if-statement is to ensure we don't turn off bluetooth if it is connected to anything after the delay has passed. Since the profile will be activated once again when bluetooth is connected again.
I found this way the easiest since there is no variable to test if bluetooth is connected directly.
markvvaals said:
Hope this helps someone!
Click to expand...
Click to collapse
It most certainly did. Thanks so much. Though, it only seemed to work for me when I removed the asterisks and commas from BT Connected.
biscuitroller said:
It most certainly did. Thanks so much. Though, it only seemed to work for me when I removed the asterisks and commas from BT Connected.
Click to expand...
Click to collapse
From my understanding PACTIVE checks a comma separated list of profile names. In my testing it does not work when only the profile name is entered, thus without asterisks and comma's. The comma's are there to make sure you check the full name of the profile, preventing a false positive.
Note that it's the comma's surround the profile name, and starting and ending with an asterisk.
Here is what I am using
Code:
<TaskerData sr="" dvi="1" tv="5.10">
<Profile sr="prof2" ve="2">
<cdate>1602032723274</cdate>
<clp>true</clp>
<edate>1602033015010</edate>
<flags>8</flags>
<id>2</id>
<mid0>3</mid0>
<nme>Turn Off BT</nme>
<State sr="con0" ve="2">
<code>3</code>
<pin>true</pin>
<Str sr="arg0" ve="3"/>
<Str sr="arg1" ve="3"/>
</State>
<State sr="con1" ve="2">
<code>2</code>
<Int sr="arg0" val="1"/>
</State>
</Profile>
<Task sr="task3">
<cdate>1602032744159</cdate>
<edate>1602032794555</edate>
<id>3</id>
<nme>Turn Off BT</nme>
<Action sr="act0" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="5"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>294</code>
<Int sr="arg0" val="0"/>
</Action>
</Task>
</TaskerData>
markvvaals said:
...
The steps below walk you through the setup of this profile
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi all, I downloaded tasker today. I wanna use it to switch between 4 wifi networks in my home. I have two 2.4GHz networks and two 5GHz networks. I have followed this video to a T (except at the end where he adds his network I added 4 total instead of 2).
It was very helpful. One addition I'd like to make to his task is a time qualifier. If the signal falls below a certain level for 60 or 90 seconds THEN the switching occurs. I attempted to do this by adding a "and %qtime > 75 with his stop command at the 14:00min - 15:00 min. It doesn't seem to be working.
The label is activating by location through the cell tower near my house. I can provide the log if anyone needs it to help. Here are some screenshots of what I have though.
Here is the overall switching task and the single line goto command that I'm having trouble with. Again, I can provide the XML export of the whole task if it helps.
Your stop action doesn't trigger correctly because you're asking for it to check %qtime and stop only if it matches 60. If %qtime is at 59 or 61, the conditional fails. Additionally, you don't want to use "matches" (~) in a conditional for a number. Use equals (eq) or greater than (>).
You could just use %qtime > 60. The problem with this is that the task running time can be variable due to interference from other tasks. If you're ok with that, then this should be fine.
Otherwise, you could put a 60 sec wait action before the stop then add a variable (e.g. %retest - all lower case since it won't be used outside of this task). Set %retest to TRUE (or something) to mark that this is the second time through. Then Goto action 1 and test again. The GoTo should have an IF condition that executes only if %retest is not set. That will prevent a loop.
You don't need to clear the %retest variable since it's a local variable (lowercase), it won't last beyond the execution of the task.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
ktmom said:
Your stop action doesn't trigger correctly because you're asking for it to check %qtime and stop only if it matches 60. If %qtime is at 59 or 61, the conditional fails. Additionally, you don't want to use "matches" (~) in a conditional for a number. Use equals (eq) or greater than (>).
You could just use %qtime > 60. The problem with this is that the task running time can be variable due to interference from other tasks. If you're ok with that, then this should be fine.
Otherwise, you could put a 60 sec wait action before the stop then add a variable (e.g. %retest - all lower case since it won't be used outside of this task). Set %retest to TRUE (or something) to mark that this is the second time through. Then Goto action 1 and test again. The GoTo should have an IF condition that executes only if %retest is not set. That will prevent a loop.
You don't need to clear the %retest variable since it's a local variable (lowercase), it won't last beyond the execution of the task.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse
Thanks. I'm gonna try what you said and repost, but I need some more info. How do I do a local wait command? From my searches I thought that's what %qtime was. That's what I was after. Nice quote at the end too from will rogers. Here's a link I was looking at and wondering if I need to use any of this %rssi stuff.
https://groups.google.com/forum/m/#!topic/tasker/ydqAgf6iqpI
What are your thoughts?
EDIT: I added the wait command (I used 45 seconds). I am lost on how to add the retest variable. Does it need to be its own line? Do I need to define it or is it a known tasker variable? What's its function?
That discussing on the Tasker group page looks like a clean trigger for the wifi signal strength. I'll admit that I didn't really look at the video that you linked to so I don't have an opinion which is better.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
I edited my post while you replied. Please take a look.
Do I add this as a separate line right after the wait command before the stop?
Idk what to put in the "data" line.
I also don't like that this is ran through a profile. The minimum time the profile can run is every 2 mins. I want it scanning every 45 sec basically. With the 2 min profile doesn't that mean I'm effectively only checking every 2min 45 seconds?
Sorry, it's a "variable add" action. So it's -> variable -> variable add.
You might have to tap the "crossed arrows" to get a text field for the TRUE value. Or you could just leave it set as the number 1 as is default. What it's set to doesn't really matter.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
ktmom said:
Sorry, it's a "variable add" action. So it's -> variable -> variable add.
You might have to tap the "crossed arrows" to get a text field for the TRUE value. Or you could just leave it set as the number 1 as is default. What it's set to doesn't really matter.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse
How should I trigger the event? Should I use the system wifi thing mentioned in that second link I posted? I don't like running it every 2 minutes. It MAY be working now, but it's too slow.
I also don't think I have my task properly set up to switch to the STRONGEST network. I just tell it to switch when the signal falls.
I had some mistakes and tried fixing em here but it still doesn't work
Things to ponder as you are looking to tweak this;
There are some settings in preferences that may impact what you're doing. Use reliable alarms - I always leave that set to "always". Also on the monitor tab, there are different settings for scan checks with the screen on vs off. Decreasing the time between scan checks will impact your battery. You'll next to determine what works best for you.
I'm not at home, and I have only one router so I can't test this, but using the "wifi near" state as a profile context with a signal strength defined might be another approach to switching between routers.
A easier and more complete way to share your profile for troubleshooting would be to long press the profile name (highlights) -> 3-dot menu -> export -> description to clipboard. Then you can paste that into a post.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Here's my task XML export. It's started with a wifi near context. Once the task is running correctly will I be able to trigger out with auto voice be through Google assistant?
I forgot to actually attach the task XML.
<TaskerData sr="" dvi="1" tv="5.0u7m">
<Task sr="task2">
<cdate>1512926092376</cdate>
<edate>1513167780556</edate>
<id>2</id>
<nme>Wifi switch</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>410</code>
<Str sr="arg0" ve="3">tasker/SSID.txt</Str>
<Str sr="arg1" ve="3">%WIFII</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="1"/>
</Action>
<Action sr="act1" ve="7">
<code>415</code>
<Str sr="arg0" ve="3">tasker/SSID.txt</Str>
<Str sr="arg1" ve="3">5</Str>
<Str sr="arg2" ve="3">%signum</Str>
</Action>
<Action sr="act10" ve="7">
<code>1698386443</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.twofortyfouram.locale.intent.extra.BLURB>"Linksys02149"</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>true</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>java.lang.Boolean</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>"Linksys02149"</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>java.lang.String</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">jp.meridiani.apps.wificonnect</Str>
<Str sr="arg2" ve="3">jp.meridiani.apps.wificonnect.activity.EditActivity</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act11" ve="7">
<code>1698386443</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.twofortyfouram.locale.intent.extra.BLURB>"UBER Schroeder Homestead"</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>true</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>java.lang.Boolean</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>"UBER Schroeder Homestead"</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>java.lang.String</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">jp.meridiani.apps.wificonnect</Str>
<Str sr="arg2" ve="3">jp.meridiani.apps.wificonnect.activity.EditActivity</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act12" ve="7">
<code>1698386443</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.twofortyfouram.locale.intent.extra.BLURB>"TP-LINK_AP_137E"</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>true</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>java.lang.Boolean</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>"TP-LINK_AP_137E"</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>java.lang.String</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">jp.meridiani.apps.wificonnect</Str>
<Str sr="arg2" ve="3">jp.meridiani.apps.wificonnect.activity.EditActivity</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="7">
<code>590</code>
<Str sr="arg0" ve="3">%signum</Str>
<Str sr="arg1" ve="3"/>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act3" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%SigStrength</Str>
<Str sr="arg1" ve="3">%signum2</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act4" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="45"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act5" ve="7">
<code>888</code>
<Str sr="arg0" ve="3">%retest</Str>
<Int sr="arg1">
<var>%true</var>
</Int>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act6" ve="7">
<code>137</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
<ConditionList sr="if">
<bool0>Or</bool0>
<Condition sr="c0" ve="3">
<lhs>%SigStrength</lhs>
<op>6</op>
<rhs>5</rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%SigStrength</lhs>
<op>0</op>
<rhs>5</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act7" ve="7">
<code>135</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3"/>
<ConditionList sr="if">
<bool0>Or</bool0>
<Condition sr="c0" ve="3">
<lhs>%WIFII</lhs>
<op>2</op>
<rhs>*Schroeder Homestead*</rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%WIFII</lhs>
<op>2</op>
<rhs>*2149*</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act8" ve="7">
<code>1698386443</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.twofortyfouram.locale.intent.extra.BLURB>"Schroeder Homestead"</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>true</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>java.lang.Boolean</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>"Schroeder Homestead"</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>java.lang.String</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">jp.meridiani.apps.wificonnect</Str>
<Str sr="arg2" ve="3">jp.meridiani.apps.wificonnect.activity.EditActivity</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act9" ve="7">
<code>1698386443</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.twofortyfouram.locale.intent.extra.BLURB>"Linksys02149_5GHz"</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>true</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST>
<jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>java.lang.Boolean</jp.meridiani.apps.wificonnect.extra.BOOLEAN_SHOWTOAST-type>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>"Linksys02149_5GHz"</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>java.lang.String</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">jp.meridiani.apps.wificonnect</Str>
<Str sr="arg2" ve="3">jp.meridiani.apps.wificonnect.activity.EditActivity</Str>
<Int sr="arg3" val="0"/>
</Action>
</Task>
</TaskerData>
Can anyone assist? Are there any tasker gurus here?
It would be more helpful to post the description, not the xml.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
I apologize. I didn't realize you could do that. Here's the description.
EDIT: idk if anyone is gonna notice this, but I had to put a space on either side of the "eek" commands or it made an emoji I the post. Typically tasker actually formats the ":" tight against the "eek".
Wifi switch (2)
A1: Write File [ File:tasker/SSID.txt Text:%WIFII Append: eek :ff Add Newline: eek :n ]
A2: Read Line [ File:tasker/SSID.txt Line:5 To Var:%signum ]
A3: Variable Split [ Name:%signum Splitter: Delete Base: eek :ff ]
A4: Variable Set [ Name:%SigStrength To:%signum2 Recurse Variables: eek :ff Do Maths: eek :ff Append: eek :ff ]
A5: Wait [ MS:0 Seconds:45 Minutes:0 Hours:0 Days:0 ]
A6: Variable Add [ Name:%retest Value:%true Wrap Around:0 ]
A7: Stop [ With Error: eek :ff Task: ] If [ %SigStrength < 5 | %SigStrength eq 5 ]
A8: Goto [ Type:Action Number Number:1 Label: ] If [ %WIFII ~ *Schroeder Homestead* | %WIFII ~ *2149* ]
A9: WiFi Connect [ Configuration:"Schroeder Homestead" Timeout (Seconds):0 ]
A10: WiFi Connect [ Configuration:"Linksys02149_5GHz" Timeout (Seconds):0 ]
A11: WiFi Connect [ Configuration:"Linksys02149" Timeout (Seconds):0 ]
A12: WiFi Connect [ Configuration:"UBER Schroeder Homestead" Timeout (Seconds):0 ]
A13: WiFi Connect [ Configuration:"TP-LINK_AP_137E" Timeout (Seconds):0 ]
Anyone have any input? I can't imagine I'm the first person to ever want something like this
Can anyone help me by getting this to activate with intent received actions? This seems like the best way to go. I'm not skilled enough to figure it out myself. Here is a Google post where people outline it briefly, but they don't see it through to the end.
https://groups.google.com/forum/m/#!topic/tasker/AzvDs3yLMFQ
Will this method work with wifi scanning and the actual wifi off? That would be awesome. If there is a way that Android is detecting wifi through it's system, a way that we can't see in settings, that will allow the task to trigger and turn in wifi when Android detects one of my 5 home networks, that would be PERFECT. I want to leave the wifi and wifi scanning off as a means to save battery.
In a perfect world I would like this task to trigger when my phone detects one of my 5 home networks. It'd turn in wifi and start looking for the best of the 5 networks and switching accordingly. For example, I get home from work, get out of my car, and this awesome task would get to work. I want location, data, and wifi off (if possible) to make this happen.
Still desperately trying to figure this out. Can this be modified to switch between 5 networks? Could I modify this so that in the 2 lines where he tells tasker to switch to the other network (mitson2 or mitson3b in the video) by adding all my networks separated by a "/" ?
So the task would say if on W switch to X/Y/Z. The next line would then say else if on X/Y/Z switch to W with the same initial condition saying that signal strength was less than -75. What do you think?
I think there is an easier way to choose amongst multiple networks. Try using SSID Selector in the task to make the choice which network to connect to. You can set it to connect to the best, configured network. The app has a "1 day" refund policy so you can have some time to test it out.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thanks. I emailed the developer with my situation description and already what he thought. A day isn't much time. Hopefully he responds. I see that app hasn't been updated in years, so hopefully he'll still help.
Hi
I was hoping i could get some help from someone with a profile i'd like to setup to forward my calls when conntected to my home wifi
This i can setup, but i also need to make sure tasker only runs the call forward dial code **21*+44.... after 5 minutes of connecting to the wifi and doesn't run the cancel code ##21# unless the wifi has been disconnected for more than 5 mins.
If call forwading was active and the wifi was disconnected i want to make sure the cancel option is stopped if wifi is restored within the 5 mins and vice versa.
Has anyone setup something like this before that i could replicate?
The basic idea would be a profile context, WiFi connected.
Enter task has a 5 minute wait action then the call action with the forward code and then a variable set %Forward to true. The call action should have an if statement set such; %Forward does not match true. This will prevent a second forward code being sent if the cancel code has not been sent.
Exit task has a 5 minute wait action then a call action with the cancel code and finally a clear variable for %FORWARD. In the call action, use an if statement; %WIFII does not match *CONNECTION*xxxxx* (where xxxxx is the SSID of the WiFi network that is in the profile context) around the final 2 actions so they don't run if the WiFi is reconnected.
If you flash the %WIFII variable, when connected you see information stating that WiFi is connected (CONNECTION) and what network it's connected to. If WiFi is not connected the %WIFII variable will return SCAN and all of the networks available. So the exit task will only run if the WiFi had not reconnected.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Wifi Call Forwarding
Hi,
Thanks for your help, based on your instructions i created the following profile but i may have made a mistake because even if the wifi is reconnected (i set it to 20 secs for testing) before 20 seconds the erasure code for call forwarding still runs and then the call forward code runs along with it if the wifi was restored.
Can you please have a look and let me know what i did wrong.
<TaskerData sr="" dvi="1" tv="5.2.bf1">
<Profile sr="prof29" ve="2">
<cdate>1531430225115</cdate>
<edate>1532630932692</edate>
<flags>16</flags>
<id>29</id>
<limit>true</limit>
<mid0>27</mid0>
<mid1>28</mid1>
<nme>Call Forward</nme>
<State sr="con0" ve="2">
<code>160</code>
<Str sr="arg0" ve="3">wg-OFFICE</Str>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Int sr="arg3" val="0"/>
</State>
</Profile>
<Task sr="task27">
<cdate>1531429517251</cdate>
<edate>1532623660702</edate>
<id>27</id>
<nme>1</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="20"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>90</code>
<Str sr="arg0" ve="3">**21*+447953222222#</Str>
<Int sr="arg1" val="1"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%Forward</lhs>
<op>3</op>
<rhs>%TRUE</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act2" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%Forward</Str>
<Str sr="arg1" ve="3">%TRUE</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
</Task>
<Task sr="task28">
<cdate>1531429582522</cdate>
<edate>1532623613278</edate>
<id>28</id>
<nme>2</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="20"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>90</code>
<Str sr="arg0" ve="3">##21#</Str>
<Int sr="arg1" val="1"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%WIFII</lhs>
<op>3</op>
<rhs>wg-OFFICE</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act2" ve="7">
<code>549</code>
<Str sr="arg0" ve="3">%Forward</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
</Action>
</Task>
</TaskerData>
ktmom said:
The basic idea would be a profile context, WiFi connected.
Enter task has a 5 minute wait action then the call action with the forward code and then a variable set %Forward to true. The call lactose should have an if statement set such; %Forward does not match true. This will prevent a second forward code being sent if the cancel code has not been sent.
Exit task has a 5 minute wait action then a call action with the cancel code and finally a clear variable for %FORWARD. In the call action, use an if statement; %WIFII does not match *CONNECTION*xxxxx* (where xxxxx is the SSID of the WiFi network that is in the profile context) around the final 2 actions so they don't run if the WiFi is reconnected.
If you flash the %WIFII variable, when connected you see information stating that WiFi is connected (CONNECTION) and what network it's connected to. If WiFi is not connected the %WIFII variable will return SCAN and all of the networks available. So the exit task will only run if the WiFi had not reconnected.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse
Go to the 3-dot menu and select export -> Description to Clipboard (not XML). Then you'll be able to paste it.
Be aware, it easier to use pastebin then link to a post here. If you paste in a post here, the forum software will convert all semicolons with characters after, typically "on" and "off" to emoticons making it very hard to read.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Wifi Call Forwarding
Sure, please see below. Since I havn't posted 10 times yet i can't post urls
pastebin/p4Ne08bu
Thanks!
ktmom said:
Go to the 3-dot menu and select export -> Description to Clipboard (not XML). Then you'll be able to paste it.
Be aware, it easier to use pastebin then link to a post here. If you paste in a post here, the forum software will convert all semicolons with characters after, typically "on" and "off" to emoticons making it very hard to read.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse
There are three things that need to be addressed.
Long press the profile name so it’s highlighted, then tap the gear icon at the top. Check the box for “enforce order”. That is checked by default so somewhere along the line it was toggled off. The “i” next to the box will explain what it does.
In the entry task, action 3 sets the variable “%Forward” to another variable “%TRUE” (which is probably uninitialized e.g. not set) . Remove the % from the “TRUE” so “%Forward” is set to a value. Then fix the same problem in action 2.
In the exit task, action 2 the If statement for dialing the cancel code you have as “%WIFII !~ wg-OFFICE”. If you look at %WIFII when connected and disconnected but proximate to the AP, you’ll see that the SSID “wg-OFFICE” is present in both cases. To view the value of %WIFII, in a blank task, create an alert->flash with %WIFII as the text. Then just play the task when connected to the wifi network and again when disconnected.
There is also other text in the variable “%WIFII” in both cases. Since matches (~) or does not match (! ~) is not the same as contains, you have to allow for the additional text plus, ensure that it matches only when actually connected. That’s why my original post recommended the comparison be to “*CONNECTION*xxxxx* (where xxxxx is the SSID of the WiFi network”. So, in your case, this should be “*CONNECTION*wg-OFFICE*”. The asterisks are wildcards so this pattern ensures the match occurs only when there is a connection to the wg-Office AP.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thanks! I'll give this a try.