SMS Received - Wait, Volume, Duplicate

Post your questions and help other users.

Moderator: Martin

Post Reply
jarid
Posts: 21
Joined: 10 Aug 2015 06:45

SMS Received - Wait, Volume, Duplicate

Post by jarid » 16 Aug 2015 17:49

Hi--new to this and thought I would create an incoming SMS announcement. I need assistance adding the following to my flow:
  1. If I am on a call, I would like the flow to wait until I am off and then proceed with the flow.
  2. I would like to save the current volume level, increase to max, and then return to previous volume level.
  3. I would like this to trigger only once every 10 seconds...this way I do not receive multiple announcements during a rapid-fire SMS session.
  4. If I am in the stock Messenger program, I do not need the announcement. Is the App Task Running condition the best way to trap this?
Thank you in advance.
2015-08-16 17.24.13.png
2015-08-16 17.24.13.png (85.57 KiB) Viewed 12938 times

sparkingspirit
Posts: 6
Joined: 06 Aug 2015 06:00

Re: SMS Received - Wait, Volume, Duplicate

Post by sparkingspirit » 17 Aug 2015 02:23

jarid wrote:1. If I am on a call, I would like the flow to wait until I am off and then proceed with the flow.
Consider adding a 30 seconds delay when condition "Call State" is false.
01.PNG
(1)
01.PNG (31.63 KiB) Viewed 12929 times
jarid wrote:2. I would like to save the current volume level, increase to max, and then return to previous volume level.
You can store your volume using the action "Store Audio Volumes" and restore using "Restore Audio Volumes".
02.PNG
(2)
02.PNG (23.68 KiB) Viewed 12929 times
jarid wrote:3. I would like this to trigger only once every 10 seconds...this way I do not receive multiple announcements during a rapid-fire SMS session.
None that I can think of, but maybe you can set the flow execution policy to "Wait until the currently executing instance has finished" and add a 10 second delay to the end of your flow.

jarid wrote:If I am in the stock Messenger program, I do not need the announcement. Is the App Task Running condition the best way to trap this?
4. Maybe create 2 additional flows to enable / disable your flow? Use App Task Started / App Task Ended as the triggers.
EDIT: Umm... Wrong action in this flow. Should be "Set Flow State: Disable Your Flow", but I think you should get the idea anyway. :lol:
04.png
(4)
04.png (59.47 KiB) Viewed 12929 times

jarid
Posts: 21
Joined: 10 Aug 2015 06:45

Re: SMS Received - Wait, Volume, Duplicate

Post by jarid » 17 Aug 2015 04:13

Thank you.

I incorporated your suggestions and made further modifications to the flow. Everything seems to work.

Any additional suggestions or flow improvements?
2015-08-17 04.12.41.png
2015-08-17 04.12.41.png (86.6 KiB) Viewed 12926 times

sparkingspirit
Posts: 6
Joined: 06 Aug 2015 06:00

Re: SMS Received - Wait, Volume, Duplicate

Post by sparkingspirit » 17 Aug 2015 06:30

If it's working then it's probably good to go.

I noticed you opted to store audio volumes before checking for headsets. Since you are not going to change the volume if the headset is currently being used, you may consider to store audio volume right before speech output. Even though your flow will have one more action, it runs slightly more efficiently as it do not have to store / restore volume if headset is plugged in.
05.PNG
An example, check of BT headphone skipped
05.PNG (39.61 KiB) Viewed 12924 times
Also, you have an action that disables the flow. You have another flow that enables this one, right?

jarid
Posts: 21
Joined: 10 Aug 2015 06:45

Re: SMS Received - Wait, Volume, Duplicate

Post by jarid » 17 Aug 2015 15:34

Good catch on the volume set. I moved the flow around and added a variable to track if the volume was stored. This way I trigger the volume restore only if needed.

I do NOT have another flow triggering this flow. I will run some checks, but my belief is after forcing the flow to stop (because SMS is already open or the phone is face down), another received SMS would trigger the flow again (after the 30 second delay). Is this not correct?
2015-08-17 15.28.54.png
2015-08-17 15.28.54.png (83.23 KiB) Viewed 12915 times

sparkingspirit
Posts: 6
Joined: 06 Aug 2015 06:00

Re: SMS Received - Wait, Volume, Duplicate

Post by sparkingspirit » 18 Aug 2015 03:13

sparkingspirit wrote:Also, you have an action that disables the flow. You have another flow that enables this one, right?
jarid wrote:I do NOT have another flow triggering this flow. I will run some checks, but my belief is after forcing the flow to stop (because SMS is already open or the phone is face down), another received SMS would trigger the flow again (after the 30 second delay). Is this not correct?
The "Set Flow State: Disable" action (the one right beside the trigger) disables the flow specified in the action. A disabled flow will never execute until re-enabled.

The action "Stop Flows" should be used to stop a flow. However, there is no need to stop a flow if it's going to end naturally anyway.

To temporary disable announcement of SMS message when the SMS app is opened, you may create 2 more flows to enable / disable this flow.
11.PNG
11.PNG (32.43 KiB) Viewed 12911 times

Post Reply