Flow actions not executing correctly after condition met

Post your questions and help other users.

Moderator: Martin

Post Reply
Alohamora
Posts: 2
Joined: 23 Jun 2019 15:27

Flow actions not executing correctly after condition met

Post by Alohamora » 24 Jun 2019 02:11

I have a flow that, when a device is connected OR disconnected from Bluetooth, checks some conditions and executes based on the results. Of those shown in the attached image, all conditions work perfectly EXCEPT for the True condition of the second "Bluetooth device connected--any" check. In particular, the audio stream volume doesn't set to the desired level, and instead sets itself to the maximum volume level like the final step in the HandsFreeLink Connected > True set of actions.

I added a sleep to the check in the hopes it would cause it to actually slow down and execute correctly, but no dice. I'm at a loss as to what I'm doing wrong, especially since the other two are working. Any help would be appreciated.

Thanks!
Attachments
Screenshot_20190623-084751__01.jpg
Screenshot_20190623-084751__01.jpg (110.8 KiB) Viewed 7579 times

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Flow actions not executing correctly after condition met

Post by Wibbly » 24 Jun 2019 07:43

What is the situation when you are expecting the second condition to return true - it looks like the case when HandsFreeLink is disconnected and another device is still connected? Are you sure that another device is indeed still connected?

Perhaps insert a Debug condition after the first Bluetooth device Connected condition - False to pause the flow and see what devices are actually still connected?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Flow actions not executing correctly after condition met

Post by Desmanto » 24 Jun 2019 18:03

The second condition should execute properly if you connect any bluetooth device that is not HandsFreelink. Try to connect any other BT device and watch how the flow execute.

The typical usage of the condition with 2 level check is to go from the general then specific. So it is recommended to have the first condition as bluetooth connected any, then if true, check again if bluetooth connected is HandsFreelink.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Alohamora
Posts: 2
Joined: 23 Jun 2019 15:27

Re: Flow actions not executing correctly after condition met

Post by Alohamora » 25 Jun 2019 02:03

Wibbly wrote:
24 Jun 2019 07:43
What is the situation when you are expecting the second condition to return true - it looks like the case when HandsFreeLink is disconnected and another device is still connected? Are you sure that another device is indeed still connected?

Perhaps insert a Debug condition after the first Bluetooth device Connected condition - False to pause the flow and see what devices are actually still connected?
So a little context: the initial check in the flow is to see if the bluetooth device that was just connected is my car bluetooth (handsfreelink). If not, THEN check if any OTHER Bluetooth device is connected. What's currently not working are the actions if the second condition returns true. The flow just blasts through the the actions without executing any of them-- but curiously, it ends by re-setting the volume to maximum level, which is the last step of the HandsFreeLink step.
Desmanto wrote:
24 Jun 2019 18:03
The second condition should execute properly if you connect any bluetooth device that is not HandsFreelink. Try to connect any other BT device and watch how the flow execute.

The typical usage of the condition with 2 level check is to go from the general then specific. So it is recommended to have the first condition as bluetooth connected any, then if true, check again if bluetooth connected is HandsFreelink.
If I connect another BT device (in this case my headphones, which is the only other Bluetooth device I use), it performs as I described to Wibbly above. But now that you've mentioned it, I'll try swapping the flow from general to specific to see if that helps.

Post Reply