Some help on Android Notifications & NodeRED

Oooh… good idea… will look into that

Also, seems the channel doesnt come through if you send it to a group of phones as opposed to an individual one

Urgh… Can disable DND but doesnt seem to be a command for silent… :frowning:
Think I’ll just use the Alertify app

service: notify.mobile_app_andreas
data:
  message: command_dnd
  data:
    command: alarms_only

?

Sorry, I mean it’ll trun off the DND, but not the silent

So only the bottom one goes off
image

And without both being off it doesn’t let the notification through still

This:

service: notify.mobile_app_andreas
data:
  message: command_dnd
  data:
    command: "off"

or this:

Notification Commands | Home Assistant Companion Docs (home-assistant.io)

That’s what I’m using - it only turns off one of them
Not to worry - I guess it’s just a foible of MiUI :frowning:

Did you try what I linked to?

Oh apologies - link just looked like the general documentation link!

That’s the ticket :slight_smile: Thank you!

Is there any way to grab the current state of those items?
EDIT: Answering my own question… just need to enable the sensors in the app

Amazingly managed to work out myself how to store and use variables…!

I came across a couple of foibles which may help others in the future if they’re searching

  1. If you don’t add a delay, the statuses will switch back before the notification has had chance to enact the sound
  2. It seems that if you try and send a silent command after the DND command it doesn’t do anything… the other way around works fine. No idea why (as I can set them in that order in the UI), but nevermind

I’d love to think of a way to do this without an arbitrary delay, but for now I think it does the job!

Now just to make it a subflow and allow me to send the message / title / device via a different flow :slight_smile:

Is there any way to use msg.payload as part of the entity check?

EDIT:
Well, I’ve sort of found a way! Seems {{ phone }} in the entity name can work :slight_smile:


No idea if this is the correct way to do it but seems to be working!

We can’t possibly help from a picture alone.

I wasn’t actually looking for help - I was trying to offer help for others who might want to do this in the future… I have it working with the msg. image

However, I am now looking for help…

I’m trying to utilise the environment variables set in the subflow (rather than the msg. ) - I’d like to set a variable called phone in the Subflow
image

and utilise that value to set the notifcation / sensor channel etc in the same vein as above

Been reading through here: Using environment variables : Node-RED (nodered.org)

but can’t seen to call it with any of those - i’ve tried a template node and a function node as well as trying to use directly but don’t seem to get what I want

Ideally I’d be able to set a few variables which can then be used to form any kind of alert I want in the future

Again. Pictures is not a good way to ask for help.
Post the sequence/flow/subflow instead and we can help.

I’m sorry, I don’t know what you mean…
To me the flow / subflow is visual - that’s a picture surely? I specifically went out of my way to try and describe what I’m trying to do textually above based on your “no pictures” comment…

Just a few hours ago you imported one of my exports of a sequence

If you export your sequence/flow/subflow then we can see what you have done.
A picture of a function node doesn’t say much, there can be hundreds of lines of code in those.

Okay - I understand now… apologies - I’d only every imported and the export function never crossed my mind as I’ve never used it!

I think I’ve just worked it out anyway! (well at least a way, likely not the best)

Here you go - I think that imports the subflow as well…
Would love any feedback if there are better ways to do this! (esp the delay, would be great to simply get confirmation that the notification had completed)

[{"id":"90d98b4d2b4bc1ba","type":"subflow","name":"[ALERT] High Priority","info":"","category":"","in":[{"x":180,"y":320,"wires":[{"id":"20c96928772da5cf"}]}],"out":[],"env":[{"name":"phone","type":"str","value":"","ui":{"label":{"en-US":"Phone ID"},"type":"input","opts":{"types":["str"]}}},{"name":"title","type":"str","value":"","ui":{"label":{"en-US":"Message Title"},"type":"input","opts":{"types":["str"]}}},{"name":"message","type":"str","value":"","ui":{"label":{"en-US":"Message Body"},"type":"input","opts":{"types":["str"]}}}],"meta":{},"color":"#DDAA99"},{"id":"9b15e4a6f63f4e40","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"Silent Off","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_ringer_mode\",\t    \"data\": {\t        \"command\": \"normal\"\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":460,"wires":[["c3cec822e718581f"]]},{"id":"50992e6afa4ac9e5","type":"api-current-state","z":"90d98b4d2b4bc1ba","name":"Poll DND State","server":"3aa13fed.bf745","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.{{ phone }}_do_not_disturb_sensor","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":460,"y":420,"wires":[["643d4b7627f355e7"]]},{"id":"273fa7aba182dbc5","type":"api-current-state","z":"90d98b4d2b4bc1ba","name":"Poll Silent State","server":"3aa13fed.bf745","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.{{ phone }}_ringer_mode","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":460,"y":460,"wires":[["49170592dec1e87f"]]},{"id":"753fdde957764b3f","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"DND Off","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_dnd\",\t    \"data\": {\t        \"command\": \"off\"\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":420,"wires":[["273fa7aba182dbc5"]]},{"id":"643d4b7627f355e7","type":"function","z":"90d98b4d2b4bc1ba","name":"Grab OriginalDNDState","func":"flow.set('OriginalDNDState',msg.payload)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":420,"wires":[["753fdde957764b3f"]]},{"id":"49170592dec1e87f","type":"function","z":"90d98b4d2b4bc1ba","name":"Grab OriginalSilentState","func":"flow.set('OriginalSilentState',msg.payload)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":460,"wires":[["9b15e4a6f63f4e40"]]},{"id":"d409a4a0d663f60b","type":"change","z":"90d98b4d2b4bc1ba","name":"Put OriginalDNDState","rules":[{"t":"set","p":"payload","pt":"msg","to":"OriginalDNDState","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":560,"wires":[["f4717216506d5592"]]},{"id":"619277245eba1ff0","type":"change","z":"90d98b4d2b4bc1ba","name":"Put OriginalSilentState","rules":[{"t":"set","p":"payload","pt":"msg","to":"OriginalSilentState","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":560,"wires":[["5f7a07be07b1056a"]]},{"id":"f4717216506d5592","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"DND Revert","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_dnd\",\t    \"data\": {\t        \"command\": msg.payload\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1270,"y":560,"wires":[[]]},{"id":"5f7a07be07b1056a","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"Silent Revert","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_ringer_mode\",\t    \"data\": {\t        \"command\": msg.payload\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":730,"y":560,"wires":[["49c38da33aa443af"]]},{"id":"0f55dc0e443d80f2","type":"delay","z":"90d98b4d2b4bc1ba","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":320,"y":560,"wires":[["619277245eba1ff0"]]},{"id":"49c38da33aa443af","type":"delay","z":"90d98b4d2b4bc1ba","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":900,"y":560,"wires":[["d409a4a0d663f60b"]]},{"id":"c3cec822e718581f","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"High Priority Notification","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": msg.noti_msg,\t    \"title\": msg.noti_title,\t    \"data\": {\t        \"ttl\": 0,\t        \"priority\": \"high\",\t        \"media_stream\": \"alarm_stream\",\t        \"channel\": \"Important_Alerts\"\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1130,"y":460,"wires":[["0f55dc0e443d80f2"]]},{"id":"20c96928772da5cf","type":"function","z":"90d98b4d2b4bc1ba","name":"function 1","func":"msg.payload = env.get('phone');\nmsg.phone = env.get('phone');\nmsg.noti_title = env.get('title');\nmsg.noti_msg = env.get('message');\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":420,"wires":[["50992e6afa4ac9e5"]]},{"id":"3aa13fed.bf745","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"a306ba3d5545e0e2","type":"subflow:90d98b4d2b4bc1ba","z":"ba3db5c75cc127f8","name":"Flood Alert (High Priority) ","env":[{"name":"phone","value":"pocox3","type":"str"},{"name":"title","value":"WARNING! FLOOD DETECTED","type":"str"},{"name":"message","value":"A FLOOD HAS BEEN DETECTED - DO SOMETHING!!!","type":"str"},{"name":"Message Body","value":"A FLOOD HAS BEEN DETECTED - DO SOMETHING!!!","type":"str"},{"name":"PHONE","value":"pocox3","type":"str"}],"x":490,"y":460,"wires":[]},{"id":"10be9b55e82f63e9","type":"inject","z":"ba3db5c75cc127f8","name":"TEST","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":460,"wires":[["a306ba3d5545e0e2"]]}]
1 Like

This is untested, but this is how I would have done it.
I would not use the subflow variables, I would use the message since it’s easier to make dynamic.

I would use the event that a message has been received instead of the delay.

And instead of function nodes setting flow variables I would do that directly in the current state node.

[{"id":"90d98b4d2b4bc1ba","type":"subflow","name":"[ALERT] High Priority","info":"","category":"","in":[{"x":280,"y":420,"wires":[{"id":"50992e6afa4ac9e5"}]}],"out":[],"env":[],"meta":{},"color":"#DDAA99"},{"id":"9b15e4a6f63f4e40","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"Silent Off","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_ringer_mode\",\t    \"data\": {\t        \"command\": \"normal\"\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":460,"wires":[["c3cec822e718581f"]]},{"id":"50992e6afa4ac9e5","type":"api-current-state","z":"90d98b4d2b4bc1ba","name":"Poll DND State","server":"3aa13fed.bf745","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.{{ phone }}_do_not_disturb_sensor","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"OriginalDNDState","propertyType":"flow","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":460,"y":420,"wires":[["753fdde957764b3f"]]},{"id":"273fa7aba182dbc5","type":"api-current-state","z":"90d98b4d2b4bc1ba","name":"Poll Silent State","server":"3aa13fed.bf745","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.{{ phone }}_ringer_mode","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"OriginalSilentState","propertyType":"flow","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":460,"y":460,"wires":[["9b15e4a6f63f4e40"]]},{"id":"753fdde957764b3f","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"DND Off","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_dnd\",\t    \"data\": {\t        \"command\": \"off\"\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":420,"wires":[["273fa7aba182dbc5"]]},{"id":"f4717216506d5592","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"DND Revert","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_dnd\",\t    \"data\": {\t        \"command\": flow.OriginalDNDState\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":970,"y":560,"wires":[[]]},{"id":"5f7a07be07b1056a","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"Silent Revert","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": \"command_ringer_mode\",\t    \"data\": {\t        \"command\": flow.OriginalSilentState\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":560,"wires":[["49c38da33aa443af"]]},{"id":"49c38da33aa443af","type":"delay","z":"90d98b4d2b4bc1ba","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":800,"y":560,"wires":[["f4717216506d5592"]]},{"id":"c3cec822e718581f","type":"api-call-service","z":"90d98b4d2b4bc1ba","name":"High Priority Notification","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_{{ phone }}","areaId":[],"deviceId":[],"entityId":[],"data":"{\t    \"message\": msg.noti_msg,\t    \"title\": msg.noti_title,\t    \"data\": {\t        \"ttl\": 0,\t        \"priority\": \"high\",\t        \"media_stream\": \"alarm_stream\",\t        \"channel\": \"Important_Alerts\"\t    }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":460,"wires":[[]]},{"id":"8d9941560cb8e338","type":"server-events","z":"90d98b4d2b4bc1ba","name":"","server":"4bbca37b.1700ec","version":1,"event_type":"mobile_app_notification_received","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":200,"y":560,"wires":[["fa84543be440029c"]]},{"id":"fa84543be440029c","type":"switch","z":"90d98b4d2b4bc1ba","name":"","property":"payload.event.message","propertyType":"msg","rules":[{"t":"eq","v":"Message","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":560,"wires":[["5f7a07be07b1056a"]]},{"id":"3aa13fed.bf745","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"4bbca37b.1700ec","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"a306ba3d5545e0e2","type":"subflow:90d98b4d2b4bc1ba","z":"ad594fb84fe6d294","name":"Flood Alert (High Priority) ","env":[{"name":"phone","value":"pocox3","type":"str"},{"name":"title","value":"WARNING! FLOOD DETECTED","type":"str"},{"name":"message","value":"A FLOOD HAS BEEN DETECTED - DO SOMETHING!!!","type":"str"},{"name":"Message Body","value":"A FLOOD HAS BEEN DETECTED - DO SOMETHING!!!","type":"str"},{"name":"PHONE","value":"pocox3","type":"str"}],"x":750,"y":520,"wires":[]},{"id":"6e43862785362fee","type":"function","z":"ad594fb84fe6d294","name":"function 2","func":"msg.phone = \"pocox3\";\nmsg.noti_title = \"WARNING! FLOOD DETECTED\";\nmsg.noti_msg = \"A FLOOD HAS BEEN DETECTED - DO SOMETHING!!!\";\n\nflow.set('Message', msg.noti_msg)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":520,"wires":[["a306ba3d5545e0e2"]]},{"id":"10be9b55e82f63e9","type":"inject","z":"ad594fb84fe6d294","name":"TEST","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":370,"y":520,"wires":[["6e43862785362fee"]]}]

Thank you - that’s really helpful. Feel like I’m starting to get into the weeds of my NodeRed understanding now!

So couple of thoughts/questions as I review…

  1. It seems that you’ve moved an additional function node outside of the subflow instead of using the variables that can be passed in via the subflow ui - is there a particular advantage to this or simply a preference? It seems to actually require more code each time I want to pass things in?

1a. Related to this (and something I still haven’t quite got my head around) - how do the msg. objects traverse? My initial assumption was that they simply pass on to the next node, but experience with this testing shows that they seem to traverse all connected nodes unless overwritten - is that the case?
e.g. if I set a msg.test outside the sublow passing to input it will pass right the way to the output of the subflow if not overwritten?

  1. Awesome on the above picture (see pictures can be useful :wink: :stuck_out_tongue:) - I did not realise that you could set a flow variable in the output properties so that definitely removed the need for those function nodes!

  2. events.mobile_app_notification_received in the subflow
    a. will this trigger after the notification has been received
    b. will this only trigger if the subflow is in ‘flow’? Otherwise wouldn’t that respond to every notification? I suspect this is what the code in the card is doing but could you explain a little bit more what is occuring there?
    c. What does the little red triangle mean? I’ve seen it before but never found out what it means (just assumed an error but may be wrong) image

I have never used subflow variables like that. I could not find any documentations about it during my 5-6 seconds of searching for it.
So I reverted to what I know, message variables work exactly as you say, they follow the message and only when overwritten do they change.
That is why I added the function node outside the subflow as a “placeholder” for other code that could generate these variables.

Yes they are kept until overwritten.
I generally try and keep msg.payload clean from variables as I did there with current state nodes.
That way it’s easy to get back to old values from previously in the sequence.

:slight_smile:

Yes that is what it should do.

Yes it will trigger on any notification on any phone.
But the switch node after filters so that it only allows “this” message to continue since we compare against the flow message body.
You could include phone using some of the context variables. But since I don’t know these from your setup I couldn’t include them.
But add a debug to the event node.

That is correct, it means something is wrong.
Do you have updated HA and companion app, this event was included a few versions ago.

1 Like

Thanks!

Two final questions…

  1. I note you set flow.set('Message', msg.noti_msg) in the function node outside of the subflow - any reason this isn’t just set in the Output Properties of the notify service call (to simplify the inputs?)

  2. Finally on the mobile_app_notification_received, my traditional way of looking at such things would be using a trigger state and then an ==, but it seems this doesnt actually change a state (it doesn’t show in my list - I am on the latest app but maybe there is a specific sensor I need active?)
    Either way, with the way you’ve done it I’m not quite sure how to specific which phone received the notification (it seems broad any notification, any device?)
    I see you are checking with that the message matches that set above, but I’m also not clear why the setting of the topic to $outputData("eventData").event_type is for - I don’t see that used… maybe related to question here?

Thanks!

I assume you mean here:

in the function node before the subflow.
My thought is that the red are set/created somewhere, perhaps in a function node, perhaps a template node. Something…
And since I don’t know how you are going to use it then I left it this way.
Then the blue is just because I could do it here anyways.
This could be a change node if you want:

What I did before the subflow is just an example to get it to work. You can do this however you want.

When you set a debug node like this with complete message:

You get the message body (in my case I just sent “test”) and other notification variables.
When we open the switch node we see this:

So we compare the event notification received to what the flow variable message is… hmm… I just realize I set that variable in before the subflow.
You need to change the position of that. This flow.set message thing from # 1 needs to be moved to the subflow either in a change node or a function node.
The flow variable stays in the flow, and because that is set in the previous flow then this switch node wont work.
In case you didn’t know, flow variables can be seen here:
image

Ok… back to where we were.
After changing the position of the flow set then the switch node should compare the flow variable with the event notification received, if they are the same then pass the message through.

On a image above I also underlined device_id and some context variables. Some of them should be specific for the phone.
I think you need to more or less hard code this. So if flow.phone == “phone1” then this variable should be “something”, if you find the need for it to just trigger on the specific phone receiving the notification.
But since the message body needs to be the same as the sent message, then it either is a broadcast or it is the same notification as I see it.