I need some help, if possible, please?
I’m testing a TTS Notification from NodeRed to the HomeAssistant Android app and I’ve hit a brick wall, so thought I’d ask here and see if anyone else can see what I’m doing wrong… or if its a NodeRed bug? I’m really hoping that I did something wrong and someone can correct me?
The top flow works fine, passing a message into “notify” as JSON.
(see top “success” message in debug log. It does the TTS on phone fine)
The bottom flow fails, trying to pass the same message into “notify” as an object (from the JSON).
(see the other debug messages below it)
I’d assume that both should work the same… what am I missing / doing wrong?
…and how can I fix it?
The flow nodes:
[{"id":"1c6c87c31901de88","type":"inject","z":"e7f4496eefd20d50","name":"Send Object to Phone","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":3700,"wires":[["f480831a0f4cb048"]]},{"id":"95994c3181675c81","type":"api-call-service","z":"e7f4496eefd20d50","name":"","server":"c4befa2f.dc8018","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_sm_g975f","areaId":[],"deviceId":[],"entityId":[],"data":"{{msg.paypload}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":3700,"wires":[["57f79fbf45ce78d1"]]},{"id":"57f79fbf45ce78d1","type":"debug","z":"e7f4496eefd20d50","name":"Debug:NMAO","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1180,"y":3700,"wires":[]},{"id":"f480831a0f4cb048","type":"function","z":"e7f4496eefd20d50","name":"Create JSON","func":"msg.payload = \"Your current position is test\";\nmsg.payload = \"{\\\"title\\\":\\\"\" + msg.payload + \"\\\",\\\"message\\\":\\\"TTS\\\",\\\"data\\\":{\\\"priority\\\":\\\"high\\\"}}\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":3700,"wires":[["1e3e7c6c4ddbdf7b","729ff3f37a906bae"]]},{"id":"1f6663d3accc1278","type":"debug","z":"e7f4496eefd20d50","name":"Debug:CTO","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":3760,"wires":[]},{"id":"1e3e7c6c4ddbdf7b","type":"function","z":"e7f4496eefd20d50","name":"Convert to Object","func":"msg.payload = JSON.parse(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":3700,"wires":[["95994c3181675c81","1f6663d3accc1278","58cf158ddfbdab0e"]]},{"id":"729ff3f37a906bae","type":"debug","z":"e7f4496eefd20d50","name":"Debug:CJ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":620,"y":3760,"wires":[]},{"id":"5a1df2408ca6cf6d","type":"inject","z":"e7f4496eefd20d50","name":"Send JSON to Phone","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":3560,"wires":[["bbb04e266d82e308"]]},{"id":"bbb04e266d82e308","type":"api-call-service","z":"e7f4496eefd20d50","name":"","server":"c4befa2f.dc8018","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_sm_g975f","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\":\"Your current position is test\",\"message\":\"TTS\",\"data\":{\"priority\":\"high\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":3560,"wires":[["9159a17de0b4743a"]]},{"id":"9159a17de0b4743a","type":"debug","z":"e7f4496eefd20d50","name":"Debug:NMAJ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1170,"y":3560,"wires":[]},{"id":"58cf158ddfbdab0e","type":"function","z":"e7f4496eefd20d50","name":"Convert back to JSON (test)","func":"msg.payload = JSON.stringify(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":920,"y":3640,"wires":[["a4f506aa6cf49ef9"]]},{"id":"a4f506aa6cf49ef9","type":"debug","z":"e7f4496eefd20d50","name":"Debug:CBTJ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1170,"y":3640,"wires":[]},{"id":"c4befa2f.dc8018","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"}]