Page 1 of 1
Limiting repeating notifications
Posted: 16 Mar 2019 11:34
by Varaloba
Having just joined the forum, I am learning quickly about Automagic.
I have manages to set up a repeating (sound) notification for WhatsApp, as below, which can be the basis for other notification apps.
But what I want to do, is to limit the number of repetitions before stopping (instead of continuously repeating until opened), so for example I could choose, 2 or 3 or 10 etc.
Have looked on the forum, but so far have not found the answer, so hoping someone will help.
Flow 1 : Trigger Notification on Statusbar Displayed, select WhatsApp. Action only one, enable flow 3
Flow 2 : Trigger Notification on Statusbar Removed, same package name as flow 1. Condition Notification on Statusbar Displayed (similar to trigger but this one check for state, not event), same package name. False : flow pattern list, disable flow 3.
Flow 3 : Periodic Timer, 5 Minute (or whatever). Action sound. Note: ticked “like alarm clock”
Re: Limiting repeating notifications
Posted: 16 Mar 2019 13:30
by Desmanto
At flow 3, add condition execution count, 3, after the action sound. True, branch to action set flow state, flow 3 - disable. This mean, after 3 executions, the periodic timer flow automatically disable itself.
Make sure you uncheck the default name at the Execution count. As the value persist for the same condition name. Change the default name to something else, example Execution Count: 3 times notif
Re: Limiting repeating notifications
Posted: 17 Mar 2019 07:41
by Varaloba
Thank you for that excellent reply, very much appreciated.
One other question I would like to ask ….
In addition to WhatsApp, I would like to add other notification apps, but with different notification sounds and times.
Of course Flow 3 will be different for each, but is it possible to incorporate these into Flows 1 & 2, or is it better to have a new set for each one.
Re: Limiting repeating notifications
Posted: 17 Mar 2019 12:50
by Desmanto
You can use multiple app notification in flow 1 and 2. Just add them to the notification trigger, tick all the apps you need. But for the timer (flow 3), since it is possible to have multiple running instance (example, you have whatsapp, calendar, colornote notification at the same time), you should make as many flows copy as the apps you need. So maybe you have flow 3 copies as : "Whatsapp Reminder", "Calendar Reminder", "ColorNote Reminder". All these flows have its own timer, different sound, different execution count.
At flow 1 and flow 2, you can add script, create a map object to separate the trigger app.
Code: Select all
db = newMapFromValues(
"Whatsapp", "Whatsapp Reminder",
"Calendar", "Calendar Reminder",
"ColorNote", "ColorNote Reminder" );
Later at the set flow state, use
{db[app_name]} in the flow field. If the notification comes from calendar, then passing the value to the map, you will get "Calendar Reminder" in the set flow state.
Add the map entry and flow 3 copy as many as you need.
Pro Tip : You can combine flow 1 and 2 by using both triggers in the flow, and split the trigger by using multiple parallel expression. You can look at the example on how I split the trigger at my flow sharings, i.e :
viewtopic.php?f=3&t=7858
Re: Limiting repeating notifications
Posted: 17 Mar 2019 13:41
by Varaloba
Hi Desmanto
As a new user, it is great to have someone of your experience to help out and guide, as there is clearly a lot to learn - I will digest your latest post and implement - thanks again
Re: Limiting repeating notifications
Posted: 18 Mar 2019 14:06
by Varaloba
I have tried to implement what you said, but the notification sounds for the two apps are merging, set up Whatsapp with one sound and Bluemail with another, perhaps you could check out the flows to see if they are correct ....
Flow 1:
Notification on statusbar displayed, package names: me.bluemail.mail,com.whatsapp LINKED TO ..
Script
db = newMapFromValues(
"Whatsapp", "WhatsappReminder",
"Bluemail", "BluemailReminder",
"ColorNote", "ColorNote Reminder" ); LINKED TO ..
Set flow state, enable, flow pattern list: WhatsappReminder,BluemailReminder
Flow 2:
Notification on statusbar removed, package names: me.bluemail.mail,com.whatsapp LINKED TO ..
Script
db = newMapFromValues(
"Whatsapp", "WhatsappReminder",
"Bluemail", "BluemailReminder",
"ColorNote", "ColorNote Reminder" ); LINKED TO ..
Notification on statusbar displayed, package names: me,bluemail.mail,com.whatsapp LINKED TO ..
Set flow state, disable, flow pattern list: WhatsappReminder,BluemailReminder
Whatsapp or Bluemail reminders ..
Periodic timer, every xx seconds, LINKED TO ..
Time range, between 08.00 and 22.00, LINKED TO ..
Sound (notification sound), LINKED TO ..
Execution count, x times, LINKED TO ..
Set flow state, disable, flow pattern list - either WhatsappReminder or BluemailReminder
Many thanks in advance
Re: Limiting repeating notifications
Posted: 20 Mar 2019 15:29
by Desmanto
All your Set Flow State use the incorrect value, it enable every flow reminder at once. You can check this by looking at the flow state of all reminder after any of the notification arrived.
Flow pattern list in flow 1 and 2 should be : {db[app_name]}
While in the flow 3 copies, it should disable only itself. So WhatsappReminder flow only disable WhatsappReminder, and BluemailReminder only disable BluemailReminder