Help With Automation for Android App Notifications in Node Red

Tags: #<Tag:0x00007fc417b5db18>

I am trying to send a notification via node red to my android app.

I can send a notification as a message. eg…
{“message”: “The printer ink is low”}

However I have 4 different inks and I want to identify the color of the ink and the level percentage.

From the sensor, the % of ink left is from the msg.payload. I can identify the color from the entity_id and set the msg.topic to the color via the change node. So lets say the black in goes below 10% (which I can do) I want it to send a notification to my phone that says “The black is at 9%”

How would I format the data in the call service node to say “The (msg.topic) is at (msg.payload)%”? I’ve tried different configurations and tried to read but cannot solve this.

Drop a function node in with

msg.payload = "The "+msg.topic+" is at "+msg.payload+"%";
return msg;

Then do a notify with Data set to

{ "message" : "{{payload}}" }
2 Likes

Thanks - that works! I was trying to do it in the data set and - blah. I am slowly learning learning the power of the function node.

I tried the data set first and gave up too :slight_smile:

I can’t seem to figure out how to send a notification. I’m using the call service node with the domain set to notify. Then selecting mobile_phone but I can’t seem to find the entity id for the app on my phone. The mobile app works great and I can send a notification in the developer tool but can’t figure out that final step.

Here’s my notify_me node:


Where did I find the device name? I looked up my trackers and used the friendly name with no caps and underscores for spaces:

That’s the trick. Thanks for the info. I never would have guessed to leave the entity id blank.

One more thing. Is there a way to make this notification text to speech? I would love the hear that payload in voice.

Yes it’s explained in the companion app documentation.

Trying to leverage this for a bunch of leak sensors around the house. Could you expand on how to do the change node possibly to grab the sensor that is alerting and what might need to be included in the function to say xxx sensor is wet? I know I can do one to one pretty easily but trying to pass all sensors to one change function and one function then output to devices as needed. Unless I am off on how it all works. Thanks in advance.