Thanks to all for responses.
Good to know. However, that still won’t solve the problem – since I wasn’t sure, I’ve already been testing both ways.
Good advice. But I think I’ve covered that. I’m using a One Plus. Battery Saver is off and app is set to Don’t optimize.
No good reason. Is that really the #1 question? Anyway, as pointed out I can eliminate the line with ‘notify’ so everything will be in double-quotes.
SUMMARY OF ACTUAL RESULTS
If I clean up my original code like this and send it to {"message":"{{payload}}"}
it works, but is still sometimes delayed until I turn on the phone screen (no different than where I started).
msg.payload = {
data: {
"message":"Front Door Bell",
"title":"Front Door Bell",
"data":
{
"channel":"Front Doorbell",
"priority":"high",
"ttl": 0,
}
}
}
return msg;
If I send the Hellis81 or Andrew Jones code to {"message":"{{payload}}"}
I get the error
"Call-service error. extra keys not allowed @ data['channel']"
If I send the Hellis81 or Andrew Jones code to {{payload}}
I get the error
"Call-service error. extra keys not allowed @ data['0']"
Maybe Node Red doesn’t automatically add the ‘data:’ part. I don’t know.
Here are the nodes if anyone wants to look
[{"id":"6cc3ee53.4cd89","type":"inject","z":"786db0c1.8b55b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":920,"y":1280,"wires":[["a421aeda10488a62"]]},{"id":"b1bf4f9d19e8063a","type":"api-call-service","z":"786db0c1.8b55b","name":"Notify M:P","server":"2bcf671a.f2b3c8","version":3,"debugenabled":false,"service_domain":"notify","service":"mobile_app_dad_1_8","entityId":"","data":"{\"message\":\"{{payload}}\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":1160,"wires":[["8ff5f6df3bdc7f6e"]]},{"id":"a421aeda10488a62","type":"function","z":"786db0c1.8b55b","name":"Jones","func":"msg.payload = \n{\n \"message\": \"Front Door Bell\",\n \"title\": \"Front Door Bell\",\n \"data\": {\n \"channel\": \"Front Doorbell\",\n \"priority\": \"high\",\n \"ttl\": 0\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1110,"y":1280,"wires":[["4a0be93a8a8c2fa5","b1bf4f9d19e8063a"]]},{"id":"8ff5f6df3bdc7f6e","type":"debug","z":"786db0c1.8b55b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1630,"y":1200,"wires":[]},{"id":"4a0be93a8a8c2fa5","type":"api-call-service","z":"786db0c1.8b55b","name":"Notify P","server":"2bcf671a.f2b3c8","version":3,"debugenabled":false,"service_domain":"notify","service":"mobile_app_dad_1_8","entityId":"","data":"{{ payload }}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1380,"y":1240,"wires":[["8ff5f6df3bdc7f6e"]]},{"id":"5da0dd93d351e61a","type":"function","z":"786db0c1.8b55b","name":"Hellis81","func":"msg.payload = {\n \"message\":\"Front Door Bell\",\n \"title\":\"Front Door Bell\",\n \"data\":\n {\n \"channel\":\"Front Doorbell\",\n \"importance\":\"high\",\n \"ttl\": 0,\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1120,"y":1220,"wires":[["4a0be93a8a8c2fa5","b1bf4f9d19e8063a"]]},{"id":"26eebe2b513dde4e","type":"inject","z":"786db0c1.8b55b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":920,"y":1220,"wires":[["5da0dd93d351e61a"]]},{"id":"1f8e0407654559d6","type":"function","z":"786db0c1.8b55b","name":"Front Door Bell","func":"msg.payload = {\n data: {\n \"message\":\"Front Door Bell\",\n \"title\":\"Front Door Bell\",\n \"data\":\n {\n \"channel\":\"Front Doorbell\",\n \"priority\":\"high\",\n \"ttl\": 0,\n }\n }\n}\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1140,"y":1160,"wires":[["b1bf4f9d19e8063a","4a0be93a8a8c2fa5"]]},{"id":"5092d5dd26aad1b6","type":"inject","z":"786db0c1.8b55b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":920,"y":1160,"wires":[["1f8e0407654559d6"]]},{"id":"2bcf671a.f2b3c8","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}]