Kumpulan Node-Red Flow

1. Random Value Generator

Node ini berupa funtion yang akan menghasilkan bilangan acak

[{"id":"a4fdb5a5.dd1ee8","type":"function","z":"9bc41499.32eb78","name":"generator","func":"msg.payload.number=Math.random()*1000000;\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":80,"wires":[[]]}]

2. Node-Red Dashboard Hello World

[{"id":"ab563b90.8fc7c8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"da686647.a1d978","type":"debug","z":"ab563b90.8fc7c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":950,"y":1480,"wires":[]},{"id":"8a5f21dc.a57e6","type":"modbus-getter","z":"ab563b90.8fc7c8","name":"PM","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"7","dataType":"HoldingRegister","adr":"0","quantity":"29","server":"42ce8ce6.d53fd4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":540,"y":1480,"wires":[[],["da686647.a1d978"]]},{"id":"ca5e2d35.0826f","type":"inject","z":"ab563b90.8fc7c8","name":"","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":1480,"wires":[["8a5f21dc.a57e6"]]},{"id":"78fff522.fa232c","type":"ui_text","z":"ab563b90.8fc7c8","group":"e1744a7.75736b8","order":0,"width":0,"height":0,"name":"Hello World","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":610,"y":300,"wires":[]},{"id":"3bfe54c0.38152c","type":"inject","z":"ab563b90.8fc7c8","name":"","topic":"","payload":"Hello World","payloadType":"str","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":300,"wires":[["78fff522.fa232c"]]},{"id":"42ce8ce6.d53fd4","type":"modbus-client","z":"","name":"Voltage","clienttype":"tcp","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.0.25","tcpPort":"502","tcpType":"DEFAULT","serialPort":"COM4","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"1","unit_id":"5","commandDelay":"500","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":false},{"id":"e1744a7.75736b8","type":"ui_group","z":"","name":"Group2","tab":"79d639a3.78d118","disp":false,"width":"10","collapse":false},{"id":"79d639a3.78d118","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

3. Node-Red: Menampilkan Value pada dashboard gauge

[{"id":"ab563b90.8fc7c8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"da686647.a1d978","type":"debug","z":"ab563b90.8fc7c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":950,"y":1480,"wires":[]},{"id":"8a5f21dc.a57e6","type":"modbus-getter","z":"ab563b90.8fc7c8","name":"PM","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"7","dataType":"HoldingRegister","adr":"0","quantity":"29","server":"42ce8ce6.d53fd4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":540,"y":1480,"wires":[[],["da686647.a1d978"]]},{"id":"ca5e2d35.0826f","type":"inject","z":"ab563b90.8fc7c8","name":"","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":1480,"wires":[["8a5f21dc.a57e6"]]},{"id":"f296c947.73beb8","type":"inject","z":"ab563b90.8fc7c8","name":"Injector","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":220,"wires":[["b323c268.e4397"]]},{"id":"b323c268.e4397","type":"random","z":"ab563b90.8fc7c8","name":"Random Number","low":"1","high":"10000","inte":"true","property":"payload","x":450,"y":220,"wires":[["eebf5ba9.a2d2b8","395d26f4.1a5f0a"]]},{"id":"eebf5ba9.a2d2b8","type":"debug","z":"ab563b90.8fc7c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":700,"y":220,"wires":[]},{"id":"395d26f4.1a5f0a","type":"ui_gauge","z":"ab563b90.8fc7c8","name":"","group":"d025c192.ed41a","order":1,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"10000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":670,"y":280,"wires":[]},{"id":"42ce8ce6.d53fd4","type":"modbus-client","z":"","name":"Voltage","clienttype":"tcp","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.0.25","tcpPort":"502","tcpType":"DEFAULT","serialPort":"COM4","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"1","unit_id":"5","commandDelay":"500","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":false},{"id":"d025c192.ed41a","type":"ui_group","z":"","name":"Group 1","tab":"fd0d0d58.30f0e","order":1,"disp":false,"width":"9","collapse":false},{"id":"fd0d0d58.30f0e","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

3. Node-Red: Simple MQTT

[{"id":"ab563b90.8fc7c8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"da686647.a1d978","type":"debug","z":"ab563b90.8fc7c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":950,"y":1480,"wires":[]},{"id":"8a5f21dc.a57e6","type":"modbus-getter","z":"ab563b90.8fc7c8","name":"PM","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"unitid":"7","dataType":"HoldingRegister","adr":"0","quantity":"29","server":"42ce8ce6.d53fd4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":540,"y":1480,"wires":[[],["da686647.a1d978"]]},{"id":"ca5e2d35.0826f","type":"inject","z":"ab563b90.8fc7c8","name":"","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":1480,"wires":[["8a5f21dc.a57e6"]]},{"id":"c45697a7.bceca8","type":"mosca in","z":"ab563b90.8fc7c8","mqtt_port":1883,"mqtt_ws_port":8080,"name":"","username":"rdd_user","password":"rdd_password","dburl":"","x":270,"y":80,"wires":[["1509e182.b483ee"]]},{"id":"1509e182.b483ee","type":"debug","z":"ab563b90.8fc7c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":520,"y":80,"wires":[]},{"id":"f296c947.73beb8","type":"inject","z":"ab563b90.8fc7c8","name":"Injector","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":220,"wires":[["b323c268.e4397"]]},{"id":"b323c268.e4397","type":"random","z":"ab563b90.8fc7c8","name":"Random Number","low":"1","high":"10000","inte":"true","property":"payload","x":450,"y":220,"wires":[["eebf5ba9.a2d2b8"]]},{"id":"eebf5ba9.a2d2b8","type":"debug","z":"ab563b90.8fc7c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":700,"y":220,"wires":[]},{"id":"395d26f4.1a5f0a","type":"ui_gauge","z":"ab563b90.8fc7c8","name":"","group":"d025c192.ed41a","order":1,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"10000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":670,"y":460,"wires":[]},{"id":"3afb2eb9.d17e72","type":"mqtt in","z":"ab563b90.8fc7c8","name":"","topic":"RDD/RoomTemp","qos":"2","datatype":"auto","broker":"d0846b3e.b21f98","x":420,"y":400,"wires":[["1526f3c1.45e24c","395d26f4.1a5f0a","fb9e578f.f5acd8"]]},{"id":"1526f3c1.45e24c","type":"debug","z":"ab563b90.8fc7c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":380,"wires":[]},{"id":"fb9e578f.f5acd8","type":"function","z":"ab563b90.8fc7c8","name":"","func":"msg.object = msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":560,"wires":[["8e1b8365.8f909"]]},{"id":"8e1b8365.8f909","type":"debug","z":"ab563b90.8fc7c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":880,"y":560,"wires":[]},{"id":"42ce8ce6.d53fd4","type":"modbus-client","z":"","name":"Voltage","clienttype":"tcp","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.0.25","tcpPort":"502","tcpType":"DEFAULT","serialPort":"COM4","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"1","unit_id":"5","commandDelay":"500","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":false},{"id":"d025c192.ed41a","type":"ui_group","z":"","name":"Group 1","tab":"fd0d0d58.30f0e","order":1,"disp":false,"width":"9","collapse":false},{"id":"d0846b3e.b21f98","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.19","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"fd0d0d58.30f0e","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Was this article helpful?

Related Articles

Leave A Comment?