Notification trigger (filters)

Itsme_jack

New member
Dear reader,

When using the notification trigger it is possible to add filters, narrowing the trigger to specific notifications.
The last option in the filter section is called 'notification sound' and has the options 'every sound, has sound, has no sound'
I tried to use this option to trigger only WhatsApp-notifications who have a notification sound (and ignoring silent notifications) but that doesn't seem to work. As soon the option is set from 'every sound' to 'has sound' the trigger does not fire anymore.

Who knows what the options mean and if it is possible to ignore silent WhatsApp notifications (this way or another).

Thanx in advance,
Jack.
 

tanutanu

Well-known member
I'm not sure but it might work with another filter such as string pattern match. Did you try with them?
 

Itsme_jack

New member
Hi tanutanu,
Thanks for your reply. I indeed considered filtering by string pattern match. Disadvantage is that WhatsApp groups (can) have very general names (for example 'funny'). Filtering on such general terms would lead to many 'false positives'

Therefor i prefer the 'has sound' filter. I tried that but it doesn't work as expected. I'm still curious how this filter works.
Anyone who knows please share your knowledge.

Thanks in advance,
Jack.
 

tanutanu

Well-known member
Hi tanutanu,
Thanks for your reply. I indeed considered filtering by string pattern match. Disadvantage is that WhatsApp groups (can) have very general names (for example 'funny'). Filtering on such general terms would lead to many 'false positives'

Therefor i prefer the 'has sound' filter. I tried that but it doesn't work as expected. I'm still curious how this filter works.
Anyone who knows please share your knowledge.

Thanks in advance,
Jack.
Yeah, I read the string works correctly for you but no make sense in your cases at the begging. I meant how the result is when you combine the string and sound.
I use regex pattern for string only, always setting the last option as any sound, so I'm also interested in this behavior.
 

Itsme_jack

New member
Unfortunately nobody seems to know how this notification filter exactly works. For the time being i just keep it on the default value.

Kind regards,
Jack.
 

Dm114

Well-known member
Unfortunately nobody seems to know how this notification filter exactly works. For the time being i just keep it on the default value.

Kind regards,
Jack.
I'm afraid it's not possible to filter a notification by the kind of sound because MD cannot know which sound is currently playing.

The only way to solve your problem would be to have as many triggers as groups (if you don't have to many of them) and filter by text with the name of each group.
 

420

Active member
Hi tanutanu,
Thanks for your reply. I indeed considered filtering by string pattern match. Disadvantage is that WhatsApp groups (can) have very general names (for example 'funny'). Filtering on such general terms would lead to many 'false positives'

Therefor i prefer the 'has sound' filter. I tried that but it doesn't work as expected. I'm still curious how this filter works.
Anyone who knows please share your knowledge.

Thanks in advance,
Jack.
I'm not 100% sure about this but i believe whatsapp notifications always have the group/contact name as the notification title, so instead of putting a filter on the trigger you could try setting it to any, and then "filter" only the title as in the screenshot below.

Edit: Some of my groups starting chatting, so i know i was correct in thinking it always puts the group name in the title, you should use contains (or does not contain) "group name" instead of = "group name" in the if clause though, because it also adds the amount of unread messages and the name of the person that send the message to the notification title.
 

Attachments

  • Screenshot_20210927-164657.png
    Screenshot_20210927-164657.png
    147.3 KB · Views: 23
Last edited:

tanutanu

Well-known member
I'm not 100% sure about this but i believe whatsapp notifications always have the group/contact name as the notification title, so instead of putting a filter on the trigger you could try setting it to any, and then "filter" only the title as in the screenshot below.
The regexp (and also any other strings) of the trigger works pretty sure with any notification sound option. However, sorry, I'm not sure with has sound/has not sound option because the pattern string is enough to identity for me.
I guess the sound option works when I set a sound file as notification sound or not. It doesn't mean the sound volume itself even if muted.
 

Dm114

Well-known member
I'm not 100% sure about this but i believe whatsapp notifications always have the group/contact name as the notification title, so instead of putting a filter on the trigger you could try setting it to any, and then "filter" only the title as in the screenshot below.
Filter in notification trigger works on notification text itself (Magic text [notification]) as well as on notification title ([not_title]). So, if group names are not too long or complex you can use Regex filter with '|' (OR) operator
 

420

Active member
Filter in notification trigger works on notification text itself (Magic text [notification]) as well as on notification title ([not_title]). So, if group names are not too long or complex you can use Regex filter with '|' (OR) operator
That the trigger works on the title aswell as the text is exactly his "problem", like he said if there is a group named "funny" the trigger will also fire everytime a message contains the word "funny", so what i suggested should solve this problem.
 

Dm114

Well-known member
That the trigger works on the title aswell as the text is exactly his "problem", like he said if there is a group named "funny" the trigger will also fire everytime a message contains the word "funny", so what i suggested should solve this problem.
You're right! I misread and didn't notice that.
 

tanutanu

Well-known member
That the trigger works on the title aswell as the text is exactly his "problem", like he said if there is a group named "funny" the trigger will also fire everytime a message contains the word "funny", so what i suggested should solve this problem.
To detect the group name, we have some methods, text content filter in the trigger, attached constraint on the trigger and if conditions after starting actions as you wrote.
We don't know how difficult it is coz we know only one sample word 'funny.'
If All groups named without any unique keywords, most of his groups had truly generic name, it wound be very hard to do with any methods.
I have no experience to make/join such generic groups, so I'm not sure it helps him. Normally, checking inside actions field is very powerful and flexible coz we can use much varieties of actions as you know:) I hope it helps him.
 

MacroDroidDev

Administrator
Staff member
The "has sound" option is meant to restrict the macro to only fire when the notification has a sound set. This was created some time ago so it's possible that this has been broken on the latest Android versions but I've never had a single bug report about this before (but perhaps no one uses this slightly obscure option).
 
Top