been spending hours trying to work this out!

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

been spending hours trying to work this out!

Post by Autumn-Leigh » 22 Mar 2018 15:51

Got a question< been spending hours trying to work it out.
so i have a flow, bluetooth enabled, connect to bt speakers, play music.

Now, i would LIKE bluetooth to turn of when no screen on, Unless this flow is working, if it is working (it is connected up, and playing music) its stay on, even with screen off, if it isnt connected to speakers and not playing music, turns it off.

is this possible please?
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know :)

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

Re: been spending hours trying to work this out!

Post by Wibbly » 22 Mar 2018 16:22

I have a similar (?) flow. Its intent is to look for Bluetooth being disconnected for over 5 mins, the phone being left alone, on battery power and, if so, disable Bluetooth. The flow is set to stop executing existing instance and execute afterwards if it's retriggered. So it's doesn't (and I'm not sure you can) test for music actually being played.

But if you control the music player via a flow too, you can of course tell when you have stopped the music.

Image

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

Re: been spending hours trying to work this out!

Post by Desmanto » 22 Mar 2018 17:22

When Screen off >> Trigger Display state off.

Only when not connected to bluetooth and not playing music >> condition bluetooth connected false and Music Active false.

No need to check for the flow is running.

==========
Trigger : Display off
Condition 1 : Bluetooth Device Connected : Any
false >> Condition 2 : Music Active
false >> Action : Set Bluetooth State : Off
==========

If you turn off you display frequently and think this flow consume more (actually almost nothing), you can add an extra flow with trigger Bluetooth State On, and enable this flow. At the main flow, add additional set flow, disable itself after set bluetooth state off.
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.

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

Re: been spending hours trying to work this out!

Post by Wibbly » 22 Mar 2018 17:46

Ah ha! Music Active condition is something useful I'd not spotted before :-)

User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

Re: been spending hours trying to work this out!

Post by Autumn-Leigh » 22 Mar 2018 19:02

Desmanto wrote:When Screen off >> Trigger Display state off.

Only when not connected to bluetooth and not playing music >> condition bluetooth connected false and Music Active false.

No need to check for the flow is running.

==========
Trigger : Display off
Condition 1 : Bluetooth Device Connected : Any
false >> Condition 2 : Music Active
false >> Action : Set Bluetooth State : Off
==========

If you turn off you display frequently and think this flow consume more (actually almost nothing), you can add an extra flow with trigger Bluetooth State On, and enable this flow. At the main flow, add additional set flow, disable itself after set bluetooth state off.
Your a legend! and my hero! Thank you :D
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know :)

User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

Re: been spending hours trying to work this out!

Post by Autumn-Leigh » 22 Mar 2018 19:04

Wibbly wrote:Ah ha! Music Active condition is something useful I'd not spotted before :-)
im so excited for this new condition haha :lol:
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know :)

User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

Re: been spending hours trying to work this out!

Post by Autumn-Leigh » 22 Mar 2018 19:19

Wibbly wrote:I have a similar (?) flow. Its intent is to look for Bluetooth being disconnected for over 5 mins, the phone being left alone, on battery power and, if so, disable Bluetooth. The flow is set to stop executing existing instance and execute afterwards if it's retriggered. So it's doesn't (and I'm not sure you can) test for music actually being played.

But if you control the music player via a flow too, you can of course tell when you have stopped the music.

Image
Thank you, this will come in use to me too :D
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know :)

Post Reply