Hi after struggling for days and hours, I'm taking the time to post my question.
1. I want to have Bluetooth disabled as much as possible during battery drain.
2. I want my phone to start Bluetooth once I connect it to the car power socket (brodit active holder)
The Following is finally working:
At the moment I have this:
Profile 1:
Car Mode
BT Connected to <MAC ADRESS>
Launch Task -> Launches my settings and apps
Exit Task -> Back to normal settings and turn off bluetooth
Profile 2:
Power Any
launch task-> Bluetooth on
exit task -> if Variable BTConnected = 0 -> Bluetooth Off (so when I use the power socket in house and Bluetooth is not connected it will disable Bluetooth again)
Profile 3:
BT Connected
launch task Variable set -> BTConnected= 1
exit task = Variable set -> BTConnected= 0
I hope this makes sense, this way I can pull out the phone off the brodit car holder and the Bluetooth stays active, so in fact, profile 1 stays active -- OK
When car goes off it uses exit task of profile 1 -> turn off Bluetooth --- OK
When putting phone in holder, Bluetooth goes on
cycling with this work great.
Now let's say I am at home charging over the night. Bluetooth stays on because the exit task won't get triggered. So id like to have in profile 2 something that says:
If Power any -> start Bluetooth and if Bluetooth is not connecting in 2 minutes -> Bluetooth go off.
Is there anyone that can help me with this, I know i am close.
Or are there any other best methods for this?
Bluetooth on -> wait 2 minutes -> Bluetooth off, if BTconnected=0
Vagelis1608 said:
Bluetooth on -> wait 2 minutes -> Bluetooth off, if BTconnected=1
Click to expand...
Click to collapse
you mean BTConnected = 0 right? cause 0 defines not connect at my variable?
will try this out tomorrow!
IIIdefconIII said:
you mean BTConnected = 0 right? cause 0 defines not connect at my variable?
will try this out tomorrow!
Click to expand...
Click to collapse
Yes, that's what I mean.
Vagelis1608 said:
Yes, that's what I mean.
Click to expand...
Click to collapse
that worked thanks!
Related
So I've been trying to set tasker to turn on my Bluetooth when I get out of range from my homes WiFi signal.
Problem is I have no idea how to set tasked to do that.
Has anyone done this and possibly shoot me some info.
Sent from my XT1060 using xda app-developers app
I would do something like this:
Profile: BT Off at Home
Context: Wifi Connected [SSID:<YourSSID>]
Enter:
Bluetooth Off
Exit:
Bluetooth On
The exit task isn't really necessary if the Bluetooth was on before you connected to your home Wifi, but it ensures that you get the results you're looking for regardless of the Bluetooth state before the profile activates.
UncleMike said:
I would do something like this:
Profile: BT Off at Home
Context: Wifi Connected [SSID:<YourSSID>]
Enter:
Bluetooth Off
Exit:
Bluetooth On
The exit task isn't really necessary if the Bluetooth was on before you connected to your home Wifi, but it ensures that you get the results you're looking for regardless of the Bluetooth state before the profile activates.
Click to expand...
Click to collapse
I have a similar tasker situation setup on mine where if I'm not on WiFi my phone turned BT on and enables BT tethering. It is a bit more complicated than that though. Let me know if you'd like me to post it.
titanshadow said:
I have a similar tasker situation setup on mine where if I'm not on WiFi my phone turned BT on and enables BT tethering. It is a bit more complicated than that though. Let me know if you'd like me to post it.
Click to expand...
Click to collapse
I would definitely appreciate if you posted it
Sent from my iPad using Tapatalk
I use 2 profiles.
Enable BT Tether 1 is triggered when not connected to WiFi and executes "Enable Bluetooth Tethering" on entry and "Disable Bluetooth Tethering" on exit.
Enable BT Tether 2 is triggered when BT is turned when Bluetooth is on and does the same as above.
I use 2 profiles so that if Bluetooth is turned off when WiFi is also off, tethering enables itself again once BT comes back on. This also requites the use of an app called "Secure Settings" which can turn tethering on and off. When you turn tethering on if you're running a stock OS for your device it will check with your carrier (the OS does it, not Secure Settings) to see if you have that feature. This does not work if you use a 3rd party app to do tethering outside of the native OS method. If you are on CyanogenMod it does not check.
Enable Bluetooth Tether:
Code:
Profile Status BT Tether 1 ON
Profile Status BT Tether 2 ON
Secure Settings BT Tether Enabled if %WIFII !~ *CONNECTION*
Disable Bluetooth Tether:
Code:
Profile Status BT Tether 2 OFF
Secure Settings BT Tether Disabled
Now, I also have a much more complicated tasker series set up on my tablet to make sure my tablet always connects when wifi fails, but it took a lot more work to not waste battery power.
Auto Tether is triggered when not connected to WiFi and executes "Tether to Phone" on entry and "Disconnect from Phone" on exit.
Please note that where it says "Secure Settings Connect to Phone" the Secure Settings action used is "BT Connection" and you select your already paired device from the dropdown list. You can also set Secure Settings to toggle Bluetooth to ON if it is off, I don't have it say that way but it could be handy. I also found myself getting a lot of errors popping up as Toast notifications, but they were meaningless as the connection was established. Thus, I didn't worry about them and ended up disabling all notifications from Secure Settings.
Tether to Phone:
Code:
If %PhoneConnected = 0
Profile Status Monitoring Phone Connection ON
Secure Settings Connect to Phone
Profile Status Tether Search ON
Else
Profile Status Tether Search OFF
End If
Monitoring Phone Connection is triggered when the phone is connected via Bluetooth and executes "Phone Connected" on entry and "Phone Disconnected" on Exit.
Phone Connected:
Code:
Wait 1 Second
HTTP Get www.google.com:80
If %HTTPR=200
Variable Set %PhoneFailed to 0
Variable Set %PhoneConnected to 1
Profile Tether Search OFF
Else
Variable Set %PhoneFailed to 1
Variable Set %PhoneConnected to 0
End If
PhoneDisconnected:
Code:
Variable Set %PhoneConnected to 0
If %WIFII !~ *connection*
Profile Status Tether Search ON
Perform Task Tether to Phone if %PhoneFailed=0
End If
Tether Search is triggered every 5 minutes and executes Tether to Phone and has no exit.
I basically had to set it up this way because there is no way to have the tablet aware that it is connected to the phone at any given time, it'll execute an event but unlike WiFi there is no tasker variable for what devices are connected via Bluetooth using %PhoneConnected to manage this works very well. Using %PhoneFailed allows the script to be able to tell that a connection was attempted but unsuccessful, without this the tablet gets stuck in a loop always trying to reconnect once the phone goes out of range. I found this happening a lot when I would go to the grocery store and leave the tablet in the car after school. The battery drain wasn't extreme but it was there.
It is a little complicated, which kind of annoys me. One of these days I may get into Android programming and just make an app. But for now, this works. If the phone or tablet disconnect and are out of range, every 5 minutes a connection is attempted. If the connection drops, it does try once right away to reconnect, but then trips the Failed variable which prevents the tablet from going hardcore at trying to reconnect.
hi all
need some help with Tasker/NFC to run bluetooth in my car...here is what i have set up:
-Trigger set to run Tasker task (turn bluetooth on+set variable)
-Tasker profile to switch off bluetooth once disconnected from car bluetooth (wait 5 secs+turn off bluetooth+variable cleared)
the NFC trigger works flawlessly...its the exit task which doesnt! any suggestions/ideas??
thanks!
PS: Moderators please feel free to move this to another forum if posted incorrectly
When you say "exit task" do you actually mean exit task? Because that wouldn't make sense. An exit task is what is triggered when the context in the profile is no longer true and not part of a profile on its own.
Perhaps share some screenshots of your profiles
to clarify, its not an exit task but a separate profile...sorry for the misleading context.
have been playing around a bit with my setup..i noticed the following: when i place my phone on the nfc tag, Trigger launches the Tasker task of switching on bluetooth, the bluetooth indication comes on for about 3 secs and then disappears. during this time, the bluetooth off Tasker profile stays green (active) although i have a wait command of 20 secs before it should switch off bluetooth if not connected to any device.
hope that helps
kayeng said:
to clarify, its not an exit task but a separate profile...sorry for the misleading context.
have been playing around a bit with my setup..i noticed the following: when i place my phone on the nfc tag, Trigger launches the Tasker task of switching on bluetooth, the bluetooth indication comes on for about 3 secs and then disappears. during this time, the bluetooth off Tasker profile stays green (active) although i have a wait command of 20 secs before it should switch off bluetooth if not connected to any device.
hope that helps
Click to expand...
Click to collapse
I haven't got any nfc so can't test. What I'd recommend though is disable the off profile for now and make sure your nfc works properly and doesn't turn off after 3 seconds. Once that's done. We can look at the second profile.
For what its worth, I had lots of trouble with Bluetooth profiles.
Things for you to consider are that as soon as you turn on your BT, it will be *disconnected* which will trigger your 2nd profile. So you'll need to put a wait in there for a couple of minutes, THEN you will need to run an "IF" task, that then looks to check it is still disconnected before turning off bluetooth.
I found with BT that unnoticeable disconnections can happen for 1ms that will trigger the 2nd profile. It may be worth setting collision handling up to only run the newest task or the oldest task (whichever you think best)
i think i finally got things to work the way i want them to (well, not really, more on that later on)
1-use Trigger to run Tasker Task when tagged with nfc : Bluetooth on-->variable set (BT)
2-run Tasker Profile when connected to car to set new variable (Car)
3-run Tasker Profile when disconnected from car : wait 15 secs-->Bluetooth off-->variable clear BT and Car
the above setup worked 3 time without error and has me convinced that i have things setup correctly. not really sure if the variables are necessary, but have always used them so continuing with that theme.
the next and final step is to have Bluetooth turn on once sitting in the car without having to use nfc or touching the phone. had experimented with Secure settings and Tasker itself (BT near) but neither worked consistently. any Tasker plugin or separate app that i can use for that purpose? [running a rooted phone on stock 5.1.1 rom]
kayeng said:
i think i finally got things to work the way i want them to (well, not really, more on that later on)
1-use Trigger to run Tasker Task when tagged with nfc : Bluetooth on-->variable set (BT)
2-run Tasker Profile when connected to car to set new variable (Car)
3-run Tasker Profile when disconnected from car : wait 15 secs-->Bluetooth off-->variable clear BT and Car
the above setup worked 3 time without error and has me convinced that i have things setup correctly. not really sure if the variables are necessary, but have always used them so continuing with that theme.
the next and final step is to have Bluetooth turn on once sitting in the car without having to use nfc or touching the phone. had experimented with Secure settings and Tasker itself (BT near) but neither worked consistently. any Tasker plugin or separate app that i can use for that purpose? [running a rooted phone on stock 5.1.1 rom]
Click to expand...
Click to collapse
You can't use a Bluetooth trigger to turn on Bluetooth, because Bluetooth is off so can't be a trigger..
The bluetooth connection to my car stereo behaves strangely: It connects, disconnects and reconnects within 3-4 seconds at startup. After that, everything works.
Sadly this triggers my Tasker profile to switch to on, then off, then on. That means every app I start when entering the profile is often killed (due to exiting the profile) and won't restart in time so that I've to do it manually.
Is there some chance to set the profile to be "connected to device X for at least 5 seconds" or any other trick?
The bluetooth device is sadly always the same, so I can't set it to Trigger to the 2nd connection attempt.
I'm having a similar problem with my Sony car stereo. If I am connected to my Bluetooth hands-free and I switch on the engine the car stereo is trying to connect to my phone. Since the phone is already connected to my hands-free it doesn't allow the connection to the car stereo to become active but tasker has already fired up the profile I have made for when I have my phone connected to my car and had also excited that profile because it sensed the disconnect. A delay like the one you propose would probably be a solution but I have no idea how this could be implemented in a task.
Following this thread for a possible solution.
Στάλθηκε από το HTC One M9 μου χρησιμοποιώντας Tapatalk
Put a delay and then use an if profile active/notactive block within your task. I do this with a few profiles to ensure they have truly started/stopped before running the associated task.
Put a delay and then use an if profile active/notactive block within your task.
Click to expand...
Click to collapse
I could not locate the "if profile active" block but i found a solution:
I've set the Tasks collision handline to "Run both together" and instead of Setting a variable like "InCar" to 1 once the Bluetooth connects, I simply increment it by 1 and all my other Tasks have "if %InCar > 0"...
When the task exits i simply wait for 30 seconds and then subtract 1 from %InCar. That way once I'm in the car the value goes 0 -> 1 -> 2 -> 1 (stays there while in the car) -> (once I Exit it).
I just use something like this at the start of some of my tasks:
Wait 30
If %PACTIVE ~ *,My profile,*
Rest of task
End if
This way the task will not run if the profile was only momentarily triggered.
I do a similar thing with exit tasks exit except I obviously check the profile is not active.
Hi there,
I want to turn on Bluetooth automatically, when I leave a certain area, using the Cell Near state.
I have SecureTask set as the device administrator. AFAIK you have to disable the Lockscreen, to turn on Bluetooth.
When I map the task to a button with bxactions it works and turns on Bluetooth.
When I set it as an Exit Task to my Cell Near State, it only turns off WiFi, but doesn't turn on Bluetooth.
The Exit Task looks like this:
1. Keyguard: Disable (SecureTask)
2. WiFi: Set Off
3. Bluetooth: Set On
4. Keyguard: Enable (SecureTask)
5. Set password: Set password (SecureTask)
The point of this task is to connect to my car, whenever I leave home or office.
Anyone has an idea why this task does not run, when I set it as an Exit Task to a Cell Near profile?
Thanks very much in advance for your ideas!
Greetings from snowy germany!
For testing purposes, pause everything in the exit task except for Bluetooth on. Then see if it works as expected. If it does, then I'd try putting a wait for several seconds between 2 and 3.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Hello All,
Just getting to use tasker for the first time. Though it is not the most user friendly app to use, I want to get the hang of it a bit more.
I want to create 3 tasks.
Task 1:
When disconnected from Bluetooth device CAR
and
When location is within 30m of Home address
do
Turn On Wifi, Turn Off Bluetooth, Turn Off Location
Task 2:
When disconnected from Bluetooth device CAR
and
When location is within 30m of Work address
do
Turn Off Wifi, Turn Off Bluetooth, Turn Off Location
Task 3:
When connected to Bluetooth device CAR
do
Turn On Location
I've got Task 1 and Task 2 configured, but cannot figure out how to configure Task 3.
My dilemma is, if when leaving from home or from work, the all services are turned off (Bluetooth, Wifi, Location), so what can I use as a trigger to Turn On Bluetooth in order to continue the trigger to Turn On Location?
Instead of turning off location you could use battery saving mode?
or if you get off work to your house near certain times add a time profile that turns bluetooth on for like 30 minutes or however long it takes to get to your car?