Hi,
I'm trying to create a trigger that will execute a flow only when my phone receives 3 SMS messages within 5 seconds.
At the moment I have a trigger of SMS received followed by a script action which increments a global variable by 1 and a separate branch that sleeps for 5 seconds and resets the variable to 0. I have an expression branching from the script action which checks if the variable equals to 3 and then performs my flow actions.
I don't think this is ideal because the flow seems to wait for 5 seconds before executing the rest of the flow even if my phone receives 3 SMS messages within the first second.
Could someone please advise on a better way to achieve this? I basically just need the flow to execute only if I receive x amount of SMS messages within y amount of seconds.
Thanks!
Gen.
Successive SMS received trigger
Moderator: Martin
Re: Successive SMS received trigger
Use condition execution count, 3 times, tick timed, use 5s. True, go to your main branch of the flow. False, do nothing
This execution count will act as buffer to protect your main flow. It will only continue after it has been executed 3 times within 5 seconds. It reset after the time (5s), so the count reset to 0.
This execution count will act as buffer to protect your main flow. It will only continue after it has been executed 3 times within 5 seconds. It reset after the time (5s), so the count reset to 0.
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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Successive SMS received trigger
Perfect, thanks!
Didn't know there was such a condition
Didn't know there was such a condition