Car Bluetooth connection priority over other BT connections

Post your questions and help other users.

Moderator: Martin

Post Reply
Nirm
Posts: 3
Joined: 03 Jan 2015 09:56

Car Bluetooth connection priority over other BT connections

Post by Nirm » 03 Jan 2015 11:56

Hello... I used to "program" 20+ years ago, so Automagic was a great find for me after trying the likes of Trigger and Automateit which are restrictive for the "simple" task I want to automate! I have perused example flows but I am already having difficulty with my first flow... my skills are obviously very rusty!

I have Bluetooth Ford SYNC in my car and a Sony Smartband Talk (SWR30) which I wear most of the time. This means my Smartband is connected (via Bluetooth) to my mobile most of the time and remains so when I step in to the car. Unless I switch off the Smartband (or disable the HCP profile which then disables the talk features in the band) it is not possible for the car system to connect to my mobile (which is preferable and more safe than using the Smartband in the car).

My basic flow to disconnect the SWR30 and connect SYNC is:

TRIGGER: Bluetooth Device Disconnected: SYNC (I am assuming I can start a flow like this?)
CONDITION: Bluetooth Device Connected: SWR30 ... if TRUE
ACTION: Disconnect Bluetooth Device: SWR30
ACTION: Connect Bluetooth Device: SYNC

Flow works fine, but I have 4 questions:

1) When I leave the car I want to disconnect from SYNC and reconnect to SWR30

Can I add a FALSE CONDITION (that my SYNC is no longer connected), followed by a connect ACTION ? If so, where in the above flow do I insert as I am having no success? If not, do I have to create another flow?

2) If I have to create a 2nd flow, do I have to execute from within the 1st flow? Sorry, I am not clear how flows execute and in which order!

3) Do flows run all the time or when are they executed? In truth I would like Automagic to flow / "sense" when in car (is that possible?) and flow again when leaving the car... this would save on battery consumption (I think!)


4) Finally, more of a wish at this stage: Trigger (by Egomotion) allows to drill down to Bluetooth profile settings therefore being able to switch off/ on Bluetooth profiles. This is very actually useful as it allows more than one Bluetooth connection to coexist in a mobile phone (eg SYNC uses A2DP and HCP, SWR30 uses HCP only... this means I can switch off HCP Phone Audio in the Smartband, and SYNC HCP can take over without me losing basic Bluetooth functions between mobile and the Smartband)


I would be very grateful of a helping hand... and my wife would get my attention back :D

Thanks, N

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Car Bluetooth connection priority over other BT connecti

Post by Martin » 05 Jan 2015 20:03

Hi,

Automagic respectively a trigger executes a flow when the trigger detects an event in the phone/device. Most triggers in Automagic are quite passive and only wait for the system to generate some form of event (e.g. Power Source connected). Such triggers should not drain the battery at all.
There also exist triggers that are actively doing something like trigger Sound Level that records audio all the time or trigger Shake that reads the sensor data all the time. Such triggers can drain the battery fairly fast.

A condition in general is something passive. It's only executed/tested at the moment when the flow reaches the condition. You can also see this by creating a flow without trigger, a condition of your choice and an action on the true-branch of the condition and another action on the false-branch of the condition and then use menu->Execute to manually start the flow. The condition or action that's highlighted in red is executed at the moment. All other components within the flow are not doing anything.

Regular flows with a trigger and some actions are usually executing for a short amount of time but you can also create loops in flows so that the flow keeps executing for a long time. Creating such flows is often not desirable and could drain the battery when the loop does not contain an action like 'Sleep' that can let the device fall into standby mode.

To detect when you leave the car, you could create a second flow with trigger Bluetooth Device Disconnected: SYNC and use an action to reconnect the SWR30.
Automagic also allows to select some bluetooth profiles to connect/disconnect but this area of Android is quite unofficial so problems have to be expected.

Regards,
Martin

Nirm
Posts: 3
Joined: 03 Jan 2015 09:56

Re: Car Bluetooth connection priority over other BT connecti

Post by Nirm » 11 Jan 2015 08:13

Many thanks for your clarification, Martin.

Some times simple is best and, as suggested, a second flow (instead of trying to include it in one flow) was the solution!

When flows execute, I understand the "flow execution policy", but is there any way to ensure that eg Flow 1 always starts before Flow 2 without using "Set Flow State"?

Btw, I have recommended your app here, eg http://talk.sonymobile.com/t5/SmartBand ... 72#U912172

Thanks again.

N :)

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Car Bluetooth connection priority over other BT connecti

Post by MURTUMA » 11 Jan 2015 16:36

Nirm wrote:is there any way to ensure that eg Flow 1 always starts before Flow 2 without using "Set Flow State"?
Leave the flow2's trigger empty. Then, at the end of flow1, put an action Execute flows: flow2. If you use trigger provided variables in flow two, you'll need some extra actions/conditions to initialize those now as the trigger is empty.

Nirm
Posts: 3
Joined: 03 Jan 2015 09:56

Re: Car Bluetooth connection priority over other BT connecti

Post by Nirm » 11 Jan 2015 16:50

MURTUMA wrote:
Nirm wrote:is there any way to ensure that eg Flow 1 always starts before Flow 2 without using "Set Flow State"?
Leave the flow2's trigger empty. Then, at the end of flow1, put an action Execute flows: flow2. If you use trigger provided variables in flow two, you'll need some extra actions/conditions to initialize those now as the trigger is empty.
Thanks for that MURTUMA ... now I feel a bit silly asking this question, how do I leave the trigger empty, is there a "trigger type"? Or do I start a flow without a trigger, if that is possible? N :oops:

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Car Bluetooth connection priority over other BT connecti

Post by MURTUMA » 11 Jan 2015 18:38

Nirm wrote:how do I leave the trigger empty
Just like that, leaving it empty when you're making a new flow. Or if you have a trigger selected already, simply un-select it from the same menu.

birgir
Posts: 1
Joined: 13 Nov 2015 13:42

Re: Car Bluetooth connection priority over other BT connecti

Post by birgir » 13 Nov 2015 13:56

can some one show a picture of these 2 flows for other to understand please.

Regards
Birgirbirgisson@gmail.com

Post Reply