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.
Related
Hi All,
I've done a quick search and cant find anything relating to this. It may seem like an odd request but i like things to be automated
I have a broadit active cradle in my car for charging the kaiser, and a parrot car kit. Ideally what i am trying to achieve is when i dock the phone in the active cradle, an automatic profile kicks in and turns bluetooth on for the while its in the cradle only, and then turns it off once its undocked/disconnected from the car.
At the moment, i cannot get it to pick up when its in the cradle. SPB automatic profile does not change. If i put bluetooth on manually, it will switch over to Car. When i turn the car off, the parrot deactivates and the phone switches back to normal and turns bluetooth off.
Does anyone know of any other automatic profile apps which detect when the phone is on charge only (i.e. no data), or if it is possible in SPB at all?
Thanks
DC
PhoneAlarm is quite good for this I think. I currently have it, and it toggles profiles based on time and appointment categories really well. How I use it:
07:00 switches to 'work' profile vibrate only, bluetooth off
07:30 switches to 'bus' profile, similar to work, but activates WiFi (and internet explorer, you can chose 1 program to be activated per profile if you wish) since the bus I commute on has free Wifi on board)
8:40 back to 'work', auto deactivates WiFi
17:15 back to 'bus'
18:20 back to 'work' as I get a local bus at this time without Wifi
19:00 'Home' profile, all sounds on, and bluetooth
23:00 'night' profile, as per home, but the back light dims
and start again the next morning.
On weekends, it auto switches between day (07:00) and night (23:00)
If I have an appointment scheduled under the meeting category, it sets itself as per the 'work' profile, switches off the phone, auto activates Word. At the appointment end time, it goes back to whatever profile it was in before hand.
There are also settings to auto switch profiles based on activesync, external power (but no activesync), headset connection, appointment category, and geographical location (based on the cellsite ID that your connected to, both entering and leaving). Apart from the appointment category switch, I haven't tried these, but if they work aswell as the time and appointment options, it sounds like the power no activesync option could be exactly what your after? And I bet you will spend hours playing with all the different options to totally tailor profiles to every minute of your day!
Fantastic! That worked really well. The app seems to take 15 seconds to pick up that its on power without activesync, but it works really well!! Excellent app.
There are so many options too!!! That appeals to me
The fact that it actually does the profile switching makes it a killer for me. Several others I tried seemed to forget to do things.
The options, yeah, there seems to be thousands. I'm not even sure what half of them do! I think this is the profile tool to end all profile tools. Oh, and you can navigate the today plugin with your d-pad. Just click on the bluetooth, Wifi, data connection icons to toggle on/off. If the you like options, I think I was correct that you'll be playing with it for hours! Almost a shame your limited to about 7 profiles really...
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..
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!
I have a profile that sets my phone in silent mode when I'm at work.
It is set up with 3 states: wifi near, NOT Bt connected (my car) and NOT headset plugged (any)
The task is simply all volume set to 0. (With the use of tasker plug-in Sound Mode.)
Then have a profile that changes the sound mode to Vibrate Mode when I connect my Samsung Galaxy Buds+ to the phone (Samsung Galaxy S8.)
BUT how do I get tasker to go back to the last profile that was activated when I disconnect my buds?
I have a separate Volumes Task that I run when say, BT connected/disconnected. In that Task, I have Actions set for the various situations.
You could also have a Profile set to watch for another Profiles Active status.
Sent from my Note8
cableghost said:
I have a separate Volumes Task that I run when say, BT connected/disconnected. In that Task, I have Actions set for the various situations.
You could also have a Profile set to watch for another Profiles Active status.
Sent from my Note8
Click to expand...
Click to collapse
Ok. But what I want if that if I'm at work and my work profile is enabled and I connect my BT headset, the profile changes to my BT profile, and that's as it should. But when a disconnect my BT headset I want tasker to go back to the previous set profile, in this case my work profile. I don't know how to do that in tasker.
You could use variables. You could set a certain variable when work Profile active, and when you disconnect the BT, check for that variable to set work Profile as Active again.
Personally, I wouldn't set your BT headset as a Profile. Instead, just use simple Tasks that would auto-adjust your volume, display brightness, display timeout, lock, etc. And set your Profiles as Home, Work, etc. and make them all auto, based on anything, i.e. near a certain wifi.
Sent from my Note8
cableghost said:
You could use variables. You could set a certain variable when work Profile active, and when you disconnect the BT, check for that variable to set work Profile as Active again.
Personally, I wouldn't set your BT headset as a Profile. Instead, just use simple Tasks that would auto-adjust your volume, display brightness, display timeout, lock, etc. And set your Profiles as Home, Work, etc. and make them all auto, based on anything, i.e. near a certain wifi.
Sent from my Note8
Click to expand...
Click to collapse