Hello folks,
The below node red flow has been working for years but I haven’t paid attention to which update and caused it doesn’t work anymore. There is no error regarding the flow in node red add-on log. Can anyone shed some lights on it?
Below flow is simplified as a demonstration of error. Whenever the condition matches the time it sends the payload.msg to TTS call service node.
I have put a debug node after Format Time node and it is showing time format correctly (say 12:59:59 AM, string) but when the time hit the condition of Announce node, the msg.payload isn’t sent out to link out node, which is actually linked to TTS call service node for some reason.
[{"id":"b115909b207738ff","type":"inject","z":"8977f8fd.87a5b8","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":470,"y":460,"wires":[["6c39e1d9.a4ab1"]]},{"id":"6c39e1d9.a4ab1","type":"function","z":"8977f8fd.87a5b8","name":"Format Time","func":"function gethour() {\n var time = new Date().toLocaleTimeString();\n return time;\n}\n\nvar time = gethour();\nreturn { payload : time };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":420,"wires":[["844ff42f6bc70c37"]]},{"id":"844ff42f6bc70c37","type":"function","z":"8977f8fd.87a5b8","name":"Annouce","func":"//12:00 AM\nif (msg.payload == \"11:59:59 PM\")\n{\n msg.payload = { \n \"data\":{ \"message\":\"Twelve O Clock\" }\n }\n return msg;\n }\n\n//12:30AM\nif (msg.payload == \"12:29:59 AM\")\n{\n msg.payload = { \n \"data\": { \"message\": \"Twelve Thirty\" }\n }\n return msg;\n }\n\n//01:00AM\nif (msg.payload == \"12:59:59 AM\")\n{\n msg.payload = { \n \"data\": { \"message\": \"One O Clock\" }\n }\n return msg;\n }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":360,"wires":[["1e890454.9f15bc"]]},{"id":"1e890454.9f15bc","type":"link out","z":"8977f8fd.87a5b8","name":"Time TTS Out-Link","links":["3d4e0170.853a4e"],"x":975,"y":420,"wires":[]}]