NodeRED Lesson: Inject & Debug

August 17th, 2019  Posted at   Lesson NodeRED
arrow   |   No Commentsarrow

Node-RED inject adalah untuk menghantar mesej dan Node-RED debug adalah untuk memaparkan mesej.

Berikut adalah video demo nya.

Node-RED Flow

[{"id":"de377476.2ddbb8","type":"debug","z":"2cd0b7f8.ac84b8","name":"","active":true,"tosidebar":true,"console":false, "tostatus":false,"complete":"payload","targetType":"msg","x":610,"y":260,"wires":[]},{"id":"f53009c5.d86da8","type":"inject","z":"2cd0b7f8.ac84b8","name":"","topic":"","payload":"","payloadType":"date", "repeat":"1","crontab":"","once":false,"onceDelay":"","x":210,"y":260,"wires":[["b4e82d40.29a23"]]},{"id":"b4e82d40.29a23","type":"function","z":"2cd0b7f8.ac84b8","name":"Format timestamp","func":"// Create a Date object from the payload\nvar date = new Date(msg.payload);\n// Change the payload to be a formatted Date string\nmsg.payload = date.toString();\n// Return the message so it can be sent on\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":260,"wires":[["de377476.2ddbb8"]]}]

Leave a Reply

What is 6 + 8 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)