Later Note String Input


#1

Hello,

I have a template node which outputs the required scheduled time from the Dashboard, say "07:30", then I have a simple function node that feeds into a later node with a string which reads "at 07:30". However, the light comes on immediately and the later node seems to ignore the future action request.

Can anybody please advise where I have gone wrong please?

Glenn


#2

is something showing in the debug node right away?
Do you need to add 'AM' or 'PM' to the string?


#3

Hello,

No need for AM or PM. If I copy the output debug message (without speech marks) and paste in the schedule field in the later node and start with an inject node it works perfectly.


#4

can you provide your flow (put three backtic'sd before and after it)


#5

My guess is that the string you create in the function node is invalid which is why the msg gets passed on right away

If no schedule is supplied the msg is sent straight out. In the case where the schedule is invalid, node.warn() will be called with the offending schedule and the processing continues as if there was no schedule.


#6

[{"id":"eff33769.aa8b18","type":"change","z":"d46a3013.43b55","name":"Set on 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":80,"wires":[["ce2dbc01.a23e6"]]},{"id":"ce2dbc01.a23e6","type":"mqtt out","z":"d46a3013.43b55","name":"","topic":"tasmota/SonoffDual/cmnd/Power1","qos":"2","retain":"true","broker":"2134f509.e7ef2a","x":780,"y":80,"wires":[]},{"id":"d6915f57.5179e","type":"ui_template","z":"d46a3013.43b55","group":"13fe3331.06cf5d","name":"","order":0,"width":"6","height":"2","format":"<div>\n <input type=\"time\" ng-model=\"usr_time\">\n <button ng-click=\"settime()\">Confirm</button>\n <p id=\"new_time\">{{usr_time | date:'HH:mm'}}</p>\n </div>\n\n<script>\n(function($scope) {\n var now = new Date();\n $scope.usr_time = new Date(1970, 0, 1, now.getHours(), now.getMinutes(), 0);\n\n $scope.settime = function() {\n var time = document.getElementById(\"new_time\");\n $scope.send({payload: time.innerText});\n };\n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":100,"y":140,"wires":[["6fd5dc85.6164c4","3d642840.a42c08"]]},{"id":"4d4c882e.b45618","type":"debug","z":"d46a3013.43b55","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":40,"wires":[]},{"id":"9603f351.e3c78","type":"inject","z":"d46a3013.43b55","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":80,"wires":[["aa9ec361.b381c"]]},{"id":"aa9ec361.b381c","type":"later","z":"d46a3013.43b55","name":"","schedule":"","x":410,"y":80,"wires":[["eff33769.aa8b18","4d4c882e.b45618"]]},{"id":"6fd5dc85.6164c4","type":"debug","z":"d46a3013.43b55","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":200,"wires":[]},{"id":"3d642840.a42c08","type":"function","z":"d46a3013.43b55","name":"","func":"msg.payload ='at ' + msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":240,"y":120,"wires":[["aa9ec361.b381c"]]},{"id":"2134f509.e7ef2a","type":"mqtt-broker","z":"","name":"192.168.0.62","broker":"192.168.0.62","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"13fe3331.06cf5d","type":"ui_group","z":"","name":"Schedule","tab":"1919913d.9cde4f","disp":true,"width":"6","collapse":false},{"id":"1919913d.9cde4f","type":"ui_tab","z":"","name":"Schedule","icon":"dashboard"}]