Wifi Connected/Disconnected=Bluetooth on/off

2,800 views
Skip to first unread message

Shan

unread,
Aug 15, 2012, 7:33:22 AM8/15/12
to tas...@googlegroups.com
Hi,
 
I have two profiles that turn on/off bluetooth while connected/disconneted to multiple wifi. I think there is a simpler way to do this using variables, instead of having two profiles.
 
Please someone can show me how to do this.
 
Btw what are my options to automatically turn on my cell phone bluetooth when I am in the car. Is gesture or shake is also useable for that purpose.
 
Is tasker able to enable/disable a  widget "Made by tasker" on a certain context.
 
Thank you for your help.
 
 

Matt R

unread,
Aug 15, 2012, 11:40:44 AM8/15/12
to tas...@googlegroups.com
Your question density is quite high!  Let's see...
 
I have two profiles that turn on/off bluetooth while connected/disconneted to multiple wifi. I think there is a simpler way to do this using variables, instead of having two profiles.  
 
Use a single WiFi Connected context (State -> Net -> WiFi Connected) and then put the SSID's of the various WiFi access points in the SSID field, separated by slashes (e.g. MyHomeWiFi/WorkWiFi/SSID3).  For the task, just put bluetooth on (Net -> Bluetooth and change the Set pulldown to On).  When the WiFi disconnects, bluetooth will automatically turn off (assuming it was off before you connected to bluetooth).
 
 
Btw what are my options to automatically turn on my cell phone bluetooth when I am in the car. Is gesture or shake is also useable for that purpose.
 
Not quite sure what you are asking.  You can use any context you want.  If you're asking for suggestions, if you have an actual car dock, you should use the Docked Car context.  If not, you could use a combination of plugged in, orientation (left/right side), bluetooth (if you connect to your car with bluetooth), magnetic field, NFC tags.  There are a variety of options.  You could use gesture or shake if you want (just shake your phone every time you enter/exit your car to run whatever tasks).  Could be fairly battery-draining if it is enabled all the time, so you could combine it with one of the other contexts (e.g. plugged in).  To add a second (or third, fourth, etc.) context, just long-press one that already exists and it will allow you to add another.
 
 
Is tasker able to enable/disable a  widget "Made by tasker" on a certain context.
 
What do you mean by enable/disable?  You can prevent the widget from performing its task if a specified profile is active.  Just add a Stop action at the top and check the "If" box and add %PACTIVE on the left, matches (~) in the middle box, and *,NameOfProfileThatDisablesWidget,* on the right (surround the profile name with commas and asterisks).  Read up in the userguide (especially the pattern matching and variables sections) to understand why this works (menu button -> Info -> Userguide or online at http://tasker.dinglisch.net/userguide/en/).  If you want to show/hide the widget, you could set the icon to no image and remove the label, but I believe you can still press it so you still need something like the Stop action at the top so the widget wouldn't appear to do anything.
 
Matt

leopheard

unread,
Aug 15, 2012, 12:45:57 PM8/15/12
to tas...@googlegroups.com
I wouldn't bother with a guesture or shake to enable the bluetooth, as Tasker should be able to start it without any input from yourself.

I have made two profiles for this - one to turn on bluetooth when I'm not at home, the other to automatically turn it off if it's not connected within a certain time. You may be able to combine these into one complete profile/task, but I'm not at the level where I can do this yet.

The BT on when not at home does the following:

State: wifi NOT near - specific MAC address of router
Task: Bluetooth on

I've used the wifi not near state rather than wifi not connected as we all know wifi, and it will disconnect whenever it wants to, therefore turning on the BT when not needed. I assume it would consider this specific wifi being connected and also near at the same time?

The other profile - BT auto off when not connected or @ home:

State: variable value BT - matches - value: ON
State: BT not connected
State: wifi not connected
Task: wait 40 seconds
Task: Bluetooth set to off if not connected within the above time

I've done it this way to give it enough time, that is to say the wifi would still most probably be on when I'm turning the corner at the end of my road, therefore the radio is ready to accept the BT of the phone by the time Android realises it's not connected.

I'd like to be able to add an IF condition to the last task i.e. turn off BT if not connected to the car radio (Android refers to it as 'KENWOOD RADIO'), but I don't know how to refer to this name via Tasker.

Files attached. Any tips appreciated.
BT_auto_off_when_not_connected_or___home.prf.xml
BT_on_when_not___home.prf.xml

easiuser

unread,
Aug 15, 2012, 1:01:54 PM8/15/12
to tas...@googlegroups.com
I'd like to be able to add an IF condition to the last task i.e. turn off BT if not connected to the car radio (Android refers to it as 'KENWOOD RADIO'), but I don't know how to refer to this name via Tasker.

If you edit State:BT not connected and tap the magnifying glass it should list your BT devices
Message has been deleted

Shan

unread,
Aug 15, 2012, 3:17:24 PM8/15/12
to tas...@googlegroups.com

On Wednesday, August 15, 2012 11:40:44 AM UTC-4, Matt R wrote:
Your question density is quite high!  Let's see...
 
I have two profiles that turn on/off bluetooth while connected/disconneted to multiple wifi. I think there is a simpler way to do this using variables, instead of having two profiles.  
 Use a single WiFi Connected context (State -> Net -> WiFi Connected) and then put the SSID's of the various WiFi access points in the SSID field, separated by slashes (e.g. MyHomeWiFi/WorkWiFi/SSID3).  For the task, just put bluetooth on (Net -> Bluetooth and change the Set pulldown to On).  When the WiFi disconnects, bluetooth will automatically turn off (assuming it was off before you connected to bluetooth).
 
 

"I was using state-net- wifi-connected then bluetooth off and second profile for the Not wifi-connected then bluetooth on. so I really did not needed the second profile. I knew it could be simple and you showed it that one profile can take care of it. thanks."

 
 
Is tasker able to enable/disable a  widget "Made by tasker" on a certain context.
 
What do you mean by enable/disable?  You can prevent the widget from performing its task if a specified profile is active.  Just add a Stop action at the top and check the "If" box and add %PACTIVE on the left, matches (~) in the middle box, and *,NameOfProfileThatDisablesWidget,* on the right (surround the profile name with commas and asterisks).  Read up in the userguide (especially the pattern matching and variables sections) to understand why this works (menu button -> Info -> Userguide or online at http://tasker.dinglisch.net/userguide/en/).  If you want to show/hide the widget, you could set the icon to no image and remove the label, but I believe you can still press it so you still need something like the Stop action at the top so the widget wouldn't appear to do anything.
 
Matt
 

I meant to say that when i press on a widget it toggles between two tasks. Can I make tasker to toggle the widget for me. Please excuse me if I sound too stupid or not making any sense. I am new and not very good at logic." Thanks for your help

 
 

easiuser

unread,
Aug 15, 2012, 3:29:02 PM8/15/12
to tas...@googlegroups.com
 

I meant to say that when i press on a widget it toggles between two tasks. Can I make tasker to toggle the widget for me. Please excuse me if I sound too stupid or not making any sense. I am new and not very good at logic." Thanks for your help


By "toggle widget" if you mean change the icon or label, then yes.  Use the action Tasker->Set Widget Icon and Tasker->Set Widget Label.  You can toggle them back and forth based on some condition.

Shan

unread,
Aug 15, 2012, 5:13:09 PM8/15/12
to tas...@googlegroups.com
 

On Wednesday, August 15, 2012 3:29:02 PM UTC-4, easiuser wrote:
 

I meant to say that when i press on a widget it toggles between two tasks. Can I make tasker to toggle the widget for me. Please excuse me if I sound too stupid or not making any sense. I am new and not very good at logic." Thanks for your help


By "toggle widget" if you mean change the icon or label, then yes.  Use the action Tasker->Set Widget Icon and Tasker->Set Widget Label.  You can toggle them back and forth based on some condition.
 
i already have that. Tasker should be able to run the widget instead of I am manually turning on/off  by touchcing it . I mean if tasker can press/or lanuch the widget for me to on/off.

easiuser

unread,
Aug 15, 2012, 5:50:24 PM8/15/12
to tas...@googlegroups.com
I am really lost, but I'll give it a shot.
 
It sounds like you just want a widget that displays a certian state but does not actually do anything.  That is simple.  Create a task with one action, STOP.  Assign an icon to it, and create the widget from your home screen.
 
If you want Tasker to modify the widget when your profile becomes active, then add the widget icon/label actions in your entry task.  If you want it to happen when your profile becomes inactive then add widget icon/label actions to something different in the exit task.

Shan

unread,
Aug 15, 2012, 6:41:27 PM8/15/12
to tas...@googlegroups.com
Thank you I will try these profiles.

Shan

unread,
Aug 16, 2012, 7:12:25 AM8/16/12
to tas...@googlegroups.com
Use a single WiFi Connected context (State -> Net -> WiFi Connected) and then put the SSID's of the various WiFi access points in the SSID field, separated by slashes (e.g. MyHomeWiFi/WorkWiFi/SSID3).  For the task, just put bluetooth on (Net -> Bluetooth and change the Set pulldown to On).  When the WiFi disconnects, bluetooth will automatically turn off (assuming it was off before you connected to bluetooth). 

Hi Matt, I test this and this does not turn on bluetooth as you expected, hence needing a second profile. My Bluetooth was off when I made the profile and when Wi-Fi was not connected it should have turn on the Bluetooth while driving. I needed not connected to Wi-Fi it's turns Bluetooth on. My profile is state>Wi-Fi connected> Bluetooth off.

Shan

unread,
Aug 16, 2012, 7:39:26 AM8/16/12
to tas...@googlegroups.com
Nevermind I was able to make it work. I turnoff the Wi-Fi and made this profile. Not wifi connected and then say turn on Bluetooth and Bluetooth is off, it will turn on Bluetooth and will turn off when wifi connected. When connected to Wi-Fi and I say turn off and bluetooth is already off it will not turn on Bluetooth when not connected to Wi-Fi. It is not doing because blutooth was already off and it met that requirement.


Matt R

unread,
Aug 16, 2012, 1:34:45 PM8/16/12
to tas...@googlegroups.com
Glad you got it working!

Matt

Shan

unread,
Aug 21, 2012, 11:01:15 AM8/21/12
to tas...@googlegroups.com
Use a single WiFi Connected context (State -> Net -> WiFi Connected) and then put the SSID's of the various WiFi access points in the SSID field, separated by slashes (e.g. MyHomeWiFi/WorkWiFi/SSID3).  For the task, just put bluetooth on (Net -> Bluetooth and change the Set pulldown to On).  When the WiFi disconnects, bluetooth will automatically turn off (assuming it was off before you connected to bluetooth).  

I am using the above and able turn off on my Bluetooth when not connected but turn off Bluetooth does not happen because display is off and phone is not connected to network. I have to make sure that display is on for it to connect to Wi-Fi and turn off Bluetooth. What I need to do to make it work. Thanks.

Shan

unread,
Aug 21, 2012, 11:12:26 AM8/21/12
to tas...@googlegroups.com
Typo error first line
" I am using the above and able turn on my Bluetooth"

Matt R

unread,
Aug 21, 2012, 12:25:00 PM8/21/12
to tas...@googlegroups.com
You could change your WiFi sleep policy to stay on when the display is off (set sleep to never, I believe).
 
Matt

Shan

unread,
Aug 21, 2012, 3:48:13 PM8/21/12
to tas...@googlegroups.com
That's what I have set to. Galaxy S3. I have noticed sometime it does connect to Wi-Fi when coming off sleep eventhough it should not.

Matt R

unread,
Aug 21, 2012, 3:57:05 PM8/21/12
to tas...@googlegroups.com
So you're saying that your WiFi sometimes disconnects when the screen is off even though your WiFi sleep policy is set to never?  Is that right?  Sounds like an issue with your phone.  You could work around it for this bluetooth toggling profile with Tasker, but you might just want to see if you can fix the WiFi disconnection problem.
 
Matt

Scott Miller

unread,
Aug 21, 2012, 4:04:03 PM8/21/12
to tas...@googlegroups.com
On Tue, Aug 21, 2012 at 3:48 PM, Shan wrote:
That's what I have set to. Galaxy S3. I have noticed sometime it does  connect to Wi-Fi when coming off sleep eventhough it should not.


There is a WiFi power saving mode on the Galaxy S3 that is on by default, and cannot be changed through the normal settings menu. I was having a lot of trouble with my WiFi states until I learned how to change this. Unfortunately, this is a change that must be done manually, and must be done every time the phone is restarted.

Using the phone dialer, dial *#0011# then press the menu key, then from the popup menu, select WiFi. You will see a button to turn off the power save mode. It will stay off until the phone is restarted, and this should allow control by Tasker to be more consistent. Press the back button repeatedly to get out of these screens.

Scott



Shan

unread,
Aug 21, 2012, 4:57:44 PM8/21/12
to tas...@googlegroups.com
I have three settings for to keep Wi-Fi on during sleep
1. Always
2. Only while plugged in
3. Never (increases data usage)

I have selected Always so it stays on while sleeping also. I have also used the service mode and turned off Wi-Fi power saver mode. BTW turning off power saver mode is changing my display timeout. Phone display timeout 15 sec does not work when power saver mode is off. Thanks

baudi

unread,
Aug 22, 2012, 9:30:00 AM8/22/12
to tas...@googlegroups.com
Scott, 

I just copied your post to the XDA SynergyROM forum to see if anybody else knows more about this setting. Do you know what effect this setting has?

Scott Miller

unread,
Aug 22, 2012, 10:27:23 AM8/22/12
to tas...@googlegroups.com
On Wed, Aug 22, 2012 at 9:30 AM, baudi wrote:
I just copied your post to the XDA SynergyROM forum to see if anybody else knows more about this setting. Do you know what effect this setting has?

When the WiFi signal was not real strong, as seems to almost always be the case for me except when I am literally standing next to an access point, the phone would switch to 3G/4G for a few seconds, then back to WiFi and reconnect. This happened often, even when the screen was on sometimes. I noticed it most of the time as I was turning the screen on after having it off for a while. And it didn't seem to matter how long it was off. It was as if the WiFi radio did not honor the always on setting that is typically used for this purpose. Turning off the power saving mode stabilized the WiFi and enabled it to stay connected even with the screen off, which was my objective.

I believe this is a well known problem with no other solution at this time. I read about it in an article from one of the tech sites, not sure which one at this point. But I suspect that article got its information from somewhere within XDA. I've been using Drippler to keep on top of things with the SGS3, that's why I'm not sure where it came from. I've seen one or two others post here on the Tasker forum about this, so I'm not the only one here that is using it.

That's about all I know about it. I also found how to disable the WiFi popup notification and the persistent notification around the same time, but I think that was a different article.

I just remembered I saved the article in Evernote. Here's a link: http://galaxys3reviews.net/samsung-galaxy-s3-wifi-problem-fix

Scott

baudi

unread,
Aug 22, 2012, 11:02:58 AM8/22/12
to tas...@googlegroups.com
Thank you. Maybe the SynergyROM developers will take heed.

Shan

unread,
Aug 23, 2012, 10:02:09 AM8/23/12
to tas...@googlegroups.com
Hi
 
I have this setup wifi connected>bluetooth off exist task bluetooth on. It works fine for turning on the bluetooth but not for turning off the bluetooth. I have to wake up the phone so it can connect to wifi then it turns off the bluetooth. How can I make it so it turns off the bluetooth automatically when connected to wifi. I have my Keep wifi on while sleep policy set to Always. Thanks.
Reply all
Reply to author
Forward
0 new messages