[SOLVED]How to set volume when phone is vibrate?

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
tetsugami
Posts: 7
Joined: 30 Jul 2017 15:59

[SOLVED]How to set volume when phone is vibrate?

Post by tetsugami » 10 Aug 2017 02:41

Hi,,

I want to ask one question, i make one flow to speak when the power is connected, the problem is when i set my phone is vibrate or silent, the action is running but i cant hear a sound of google tts, and i fix it with action "Set volume", but when the flow is end the volume is not turn back into the value before i set. Did you know how to restore the volume value before action Set Volume?

Code: Select all

Ex : 
My phone is vibrate
Music volume value is 1
I connect the power
Flow is running
Action Set volume music is 10
Google tts speak "Power is connected"
##i want to set value before the flow is running, Use Action restore volume not work##
The flow is end..
Last edited by tetsugami on 11 Aug 2017 09:44, edited 1 time in total.

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

Re: [ASK] How to set volume when phone is vibrate?

Post by Desmanto » 10 Aug 2017 03:39

You need to store the volume first, set the volume, speech, then restore.

If you want it to speak out even when vibrate/silent, just use alarm stream in the speech action. Of course, your alarm volume should be set to the level you want. I usually don't change alarm volume, thus no need additional ritual for store/set/restore volume.

And we are #automagicmasterrace 8-) , please make use of the variable. If it is just to speak out "Power is Connected", I think some phone can do it. My flow speak out "Before charging, {battery_level} %". After unplugged, "After charging, {battery_level} %".

Hehehe, just kidding. :D Use the one that you need.
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.

tetsugami
Posts: 7
Joined: 30 Jul 2017 15:59

Re: [ASK] How to set volume when phone is vibrate?

Post by tetsugami » 11 Aug 2017 09:43

Thanks for answering desmanto, i read your trhead on kaskus and i modify it. Are your thread active until right now?? I want to borkmark it for some references..

I attach my successfull flow. Do you have idea to make the flow be one flow?
Attachments
flow_group_Battery_20170811_163816.xml
(18.41 KiB) Downloaded 945 times

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

Re: [SOLVED]How to set volume when phone is vibrate?

Post by Desmanto » 11 Aug 2017 15:48

I think your flow is too overkill. Mine is just simple, 3 elements per flow. :D See at kaskus. Later on, I combine both flow into single flow with two triggers. And check add a condition to check which trigger, connected/disconnected will give different speech output. I still maintain the thread, but of course it will be quite quiet there. Since most user probably haunted by the steep learning that tasker set several years ago. They should have tried automagic first.

I used to be the same like you, wanna use a very long phrase for the speech output. But after using for a while, it is not practical. I am waiting too long to hear the battery percentage. That's why I reduced it to very simple statement. In most of the time, keep it simple is the best solution, unless there is a special need.

First lets see the ringer mode vibrate and silent. If you wanna check for those 2 condition, if either is true then store the volume; it is better you just use Ringer Mode Normal and reverse the branch. So, false will store the volume. It is essentially the same, but only using one conditions.
Vibrate True OR Silent True == Normal False.
If the phone now is in vibrate OR silent, the condition will become false, then store the volume. If it is normal, then condition true, skip the store volume action.

But still, you don't have to store the alarm volume. Do you change the alarm volume frequently in a day? If not, no need to store (or restore) the volume, just choosing the stream alarm in the speech output is enough. You can save many elements already if you remove out those above.

Move to Power Connected flow, that Battery level 100% now becomes redundant, since there is no need to restore the volume already. You can still keep the condition higher than 96%, if you want it to speak out every percent from 97% - 100%. But I still think it is redundant, since our smartphone nowadays are very well protected from overcharged. I even prefere to plug my phone whole day if it is possible. If you read my other thread (troubleshooting) at kaskus, you can get more information about the power management, battery, charging and etc.

Power disconnected flow is the same, you can remove the store volume action elements, keeping only the higher than 96% group. Battery Level Check flow will be quite annoying if you really use it. The phone will speak out the battery change for every percent. That means if you charge it and it is up for 30% in 30 minutes, you will get speech output every minute. If you can handle it, then just remove the store volume elements as well.

To combine the Power Connected and Disconnected flow, you can just take all the action from one and copy to another (except the trigger). Add the other trigger, so the trigger now have Power Connected and Power Disconnected. Break the first connection to trigger, and add a new condition to check which trigger, Condition Power Source Connected. The True branch will execute all action block from Power Connected flow, and False branch execute all action from Power Disconnected flow. You can then delete the other redundant flow. Probably i need to update the example at the kaskus there to give the big picture.

As for the battery check level, it can't be combined, since it is a seperated trigger which doesn't toggle well if combined with power connected and disconnected. It is more efficient by keeping it in seperate flow, and then disable/enable it by this combined Power Connected/disconnected flow. Thus removing the Power connected condition at the middle. But still need your confirmation whether you still wanna use it.
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.

Post Reply