Senin, 27 Februari 2023

ESP32

 

#define RXD2 16
#define TXD2 17
void setup() {
// Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin);
Serial.begin(115200);
//Serial1.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial.println("Serial Txd is on pin: "+String(TX));
Serial.println("Serial Rxd is on pin: "+String(RX));
}
void loop() { //Choose Serial1 or Serial2 as required
while (Serial2.available()) {
Serial.print(char(Serial2.read()));
}
}
/* Baud-rates available: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200, 256000, 512000, 962100
*
* Protocols available:
* SERIAL_5N1 5-bit No parity 1 stop bit
* SERIAL_6N1 6-bit No parity 1 stop bit
* SERIAL_7N1 7-bit No parity 1 stop bit
* SERIAL_8N1 (the default) 8-bit No parity 1 stop bit
* SERIAL_5N2 5-bit No parity 2 stop bits
* SERIAL_6N2 6-bit No parity 2 stop bits
* SERIAL_7N2 7-bit No parity 2 stop bits
* SERIAL_8N2 8-bit No parity 2 stop bits
* SERIAL_5E1 5-bit Even parity 1 stop bit
* SERIAL_6E1 6-bit Even parity 1 stop bit
* SERIAL_7E1 7-bit Even parity 1 stop bit
* SERIAL_8E1 8-bit Even parity 1 stop bit
* SERIAL_5E2 5-bit Even parity 2 stop bit
* SERIAL_6E2 6-bit Even parity 2 stop bit
* SERIAL_7E2 7-bit Even parity 2 stop bit
* SERIAL_8E2 8-bit Even parity 2 stop bit
* SERIAL_5O1 5-bit Odd parity 1 stop bit
* SERIAL_6O1 6-bit Odd parity 1 stop bit
* SERIAL_7O1 7-bit Odd parity 1 stop bit
* SERIAL_8O1 8-bit Odd parity 1 stop bit
* SERIAL_5O2 5-bit Odd parity 2 stop bit
* SERIAL_6O2 6-bit Odd parity 2 stop bit
* SERIAL_7O2 7-bit Odd parity 2 stop bit
* SERIAL_8O2 8-bit Odd parity 2 stop bit
*/

Training SCADA berbasis Internet Of Things

Workshop SCADA & IIOT for Industrial Automation

 




















Selasa, 21 Februari 2023

cara uninstall node red


 


run command promt

ketik : npm uninstall -g node-red

kemudian enter

modbus to telegram


 


[{"id":"36e36aae.e8b2b6","type":"modbus-read","z":"ab7b4939.3fe1c8","name":"SIMONE 1-16","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"0","quantity":"16","rate":"500","rateUnit":"ms","delayOnStart":false,"startDelayTime":"","server":"5c3514b5.bfc0ec","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":110,"y":220,"wires":[["b06814eb.267de8"],[]]},{"id":"94da68de.b5ea68","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":180,"wires":[["ce0255e.a60bfa8"]]},{"id":"ce0255e.a60bfa8","type":"function","z":"ab7b4939.3fe1c8","name":"DI1","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI1 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":180,"wires":[["84677639.3687c8"]]},{"id":"84677639.3687c8","type":"telegram sender","z":"ab7b4939.3fe1c8","name":"SIMONE","bot":"d9fee841.88f6e8","haserroroutput":false,"outputs":1,"x":960,"y":380,"wires":[[]]},{"id":"b06814eb.267de8","type":"Input Split","z":"ab7b4939.3fe1c8","name":"","inputProps":["payload.0","payload.1","payload.2","payload.3","payload.4","payload.5","payload.6","payload.7","payload.8","payload.9","payload.10","payload.11","payload.12","payload.13","payload.14","payload.15"],"outputs":16,"x":300,"y":300,"wires":[["94da68de.b5ea68"],["5d55410d.40d53"],["16ca90ea.bea01f"],["127192ff.4ffc7d"],["10344f9.f5923b"],["b2b6349d.c32198"],["8a391ede.cac81"],["bb040a77.0ade08"],["61196ba.0714294"],["15c73a55.33f906"],["94df7e99.a36c8"],["83732533.7498f8"],["b7acbeb1.29eb4"],["d04c8ca0.3c7a7"],["b58d5f28.06db1"],["83515df5.b5067"]]},{"id":"406d8d48.3e83e4","type":"function","z":"ab7b4939.3fe1c8","name":"DI2","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI2 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":220,"wires":[["84677639.3687c8"]]},{"id":"5d55410d.40d53","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":220,"wires":[["406d8d48.3e83e4"]]},{"id":"127192ff.4ffc7d","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":300,"wires":[["70518647.d9ee18"]]},{"id":"70518647.d9ee18","type":"function","z":"ab7b4939.3fe1c8","name":"DI4","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI4 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":300,"wires":[["84677639.3687c8"]]},{"id":"16ca90ea.bea01f","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":260,"wires":[["8c864dd.9dba0b"]]},{"id":"8c864dd.9dba0b","type":"function","z":"ab7b4939.3fe1c8","name":"DI3","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI3 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":260,"wires":[["84677639.3687c8"]]},{"id":"10344f9.f5923b","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":340,"wires":[["cedc2e85.706e3"]]},{"id":"cedc2e85.706e3","type":"function","z":"ab7b4939.3fe1c8","name":"DI5","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI5 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":340,"wires":[["84677639.3687c8"]]},{"id":"32d08ffa.ec342","type":"function","z":"ab7b4939.3fe1c8","name":"DI6","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI6 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":380,"wires":[["84677639.3687c8"]]},{"id":"b2b6349d.c32198","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":380,"wires":[["32d08ffa.ec342"]]},{"id":"bb040a77.0ade08","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":460,"wires":[["5e17e6af.eda178"]]},{"id":"5e17e6af.eda178","type":"function","z":"ab7b4939.3fe1c8","name":"DI8","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI8 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":460,"wires":[["84677639.3687c8"]]},{"id":"8a391ede.cac81","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":420,"wires":[["95c7bc84.3c95c"]]},{"id":"95c7bc84.3c95c","type":"function","z":"ab7b4939.3fe1c8","name":"DI7","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI7 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":420,"wires":[["84677639.3687c8"]]},{"id":"61196ba.0714294","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":500,"wires":[["302bd1f3.a540be"]]},{"id":"302bd1f3.a540be","type":"function","z":"ab7b4939.3fe1c8","name":"DI9","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI9 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":500,"wires":[["84677639.3687c8"]]},{"id":"fc81474.d4c83b8","type":"function","z":"ab7b4939.3fe1c8","name":"DI10","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI10 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":540,"wires":[["84677639.3687c8"]]},{"id":"15c73a55.33f906","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":540,"wires":[["fc81474.d4c83b8"]]},{"id":"83732533.7498f8","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":620,"wires":[["5b30119b.ad5af"]]},{"id":"5b30119b.ad5af","type":"function","z":"ab7b4939.3fe1c8","name":"DI12","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI12 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":620,"wires":[["84677639.3687c8"]]},{"id":"94df7e99.a36c8","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":580,"wires":[["9e20b0a4.01503"]]},{"id":"9e20b0a4.01503","type":"function","z":"ab7b4939.3fe1c8","name":"DI11","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI11 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":580,"wires":[["84677639.3687c8"]]},{"id":"b7acbeb1.29eb4","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":660,"wires":[["29cb6947.034d36"]]},{"id":"29cb6947.034d36","type":"function","z":"ab7b4939.3fe1c8","name":"DI13","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI13 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":660,"wires":[["84677639.3687c8"]]},{"id":"a981c670.233b78","type":"function","z":"ab7b4939.3fe1c8","name":"DI14","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI14 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":700,"wires":[["84677639.3687c8"]]},{"id":"d04c8ca0.3c7a7","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":700,"wires":[["a981c670.233b78"]]},{"id":"83515df5.b5067","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":780,"wires":[["a50225ec.9ab7f8"]]},{"id":"a50225ec.9ab7f8","type":"function","z":"ab7b4939.3fe1c8","name":"DI16","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI16 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":780,"wires":[["84677639.3687c8"]]},{"id":"b58d5f28.06db1","type":"rbe","z":"ab7b4939.3fe1c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":570,"y":740,"wires":[["dd4183b.a90118"]]},{"id":"dd4183b.a90118","type":"function","z":"ab7b4939.3fe1c8","name":"DI15","func":"var cb = Number(msg.payload)\nvar d = new Date();\nvar t = new Date();\nvar date = d.toLocaleDateString();\nvar time = t.toLocaleTimeString();\nvar a;\n\nif(cb>0)\n{\n   \n    msg.payload = {}\n    msg.payload.chatId = -580326211\n    msg.payload.type = \"message\";\n    msg.payload.content = \"DI15 ON \" + time + \" \" + date;\n  \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":740,"wires":[["84677639.3687c8"]]},{"id":"5c3514b5.bfc0ec","type":"modbus-client","d":true,"name":"SIMONE","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.4.10","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"d9fee841.88f6e8","type":"telegram bot","botname":"simornodered_bot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false,"credentials":{"token":""}}]

spreadsheet di node red

 


[{"id":"4dc8e823.4bf4f8","type":"comment","z":"f7e38b71.5811d8","name":"How to configure Google sheets ","info":"# Install extra nodes\n\nFrom the manage palette, install node-red-contrib-viseo-google-authentication and\nnode-red-contrib-viseo-google-spreadsheet.\n\n# Set up a Google service account and enable Google sheets API\nGo to [https://console.developers.google.com/project](https://console.developers.google.com/project) and sign in to your Google/Gmail account.\n\nOnce signed in, you'll see a list of existing projects (if there are any) or you can click Create Project to create a new one.\n\nOn the New Project page, enter a name for your project, select an organization and then click Create.\n\n# Enable the Drive API\n\nMake sure you are logged into the Developers Console and your project is selected as the current project.\n\nFrom the navigation menu, hover over APIs and Services and select Library.\n\nSearch for and click the Google Drive API tile.\n\nClick enable.\n\n# Enable the Sheets API\n\nMake sure your project is still selected as the current project.\n\nFrom the navigation menu, hover over APIs and Services and select Library.\nSearch for and click the Google Sheets API tile.\n\nClick Enable.\n\n# Download Service Account Credentials\n\nTo create credentials, from the navigation menu, hover over APIs and Services and select click Credentials. On the Credentials page, click Create credentials and select the Service account key option.\n\nSet the Service account dropdown to New service account. Then enter the Name and select a Role for your service account.\n\nCopy the Service account ID which is an email address starting with your service account name.\n\nClick Create to generate a certificate file and download it as json.\n\nClick on the pen to the right of the Credentials in the node, copy and paste the information in the json file in the field for JSON.\n\n# Create a new Google spread sheet from Google Drive. \n\nTake the ID part from the https link to the spread sheet.\n\nThe link looks similar to this: https://docs.google.com/spreadsheets/d/1C_F7--lWjn1Q3dzkNIcU66NoalhSXL3HPvsIxEUFXo0/edit#gid=0\n\nHere the ID is 1C_F7--lWjn1Q3dzkNIcU66NoalhSXL3HPvsIxEUFXo0 which should be copied to the ID field in the node configuration.\n\nWhen you have the Google sheet open click on the share button in the upper right corner. In the people field put in the email address that you copied from Service account ID and click ready.\n\nNow you should be able to read and write to the Google sheet.\n\nThere is an ERROR message \"Missing VISEO Bot Maker key - Read the documentation.\". \nThis will not stop the flow from working.","x":150,"y":40,"wires":[]},{"id":"35db33a7.fb635c","type":"comment","z":"f7e38b71.5811d8","name":"(double click to read the instruction or look at the info panel to the right)","info":"","x":270,"y":80,"wires":[]},{"id":"ce25ff9b.d59ae","type":"function","z":"f7e38b71.5811d8","name":"","func":"msg.payload=Number(msg.payload)/100\nmsg.payload = parseFloat ( msg.payload.toFixed(1))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":380,"wires":[["7776eee5.c896a"]]},{"id":"7776eee5.c896a","type":"GSheet","z":"f7e38b71.5811d8","creds":"281a99af.2108f6","method":"get","action":"","sheet":"1u7Q7evwp3GfVBvjlpxqn50TZ54k7-48RZlA9_cFuH1Y","cells":"Sheet1!B2:B3","flatten":false,"name":"modbus","x":440,"y":380,"wires":[["87241d3b.0f4ee"]]},{"id":"87241d3b.0f4ee","type":"ui_artlessgauge","z":"f7e38b71.5811d8","group":"a9b5c519.89b948","order":20,"width":27,"height":9,"name":"","icon":"fa-bolt","label":"TEST","unit":"","layout":"radial","decimals":0,"differential":false,"minmax":false,"colorTrack":"#555555","style":"","colorFromTheme":true,"property":"payload","secondary":"secondary","inline":false,"animate":true,"sectors":[{"val":0,"col":"#ff9900","t":"min","dot":0},{"val":10,"col":"#ff9900","t":"max","dot":0}],"lineWidth":3,"bgcolorFromTheme":true,"diffCenter":"","x":620,"y":380,"wires":[]},{"id":"adae7cec.29ce9","type":"comment","z":"f7e38b71.5811d8","name":"Modbus to Node Red and save Googlespreadsheet","info":"","x":210,"y":140,"wires":[]},{"id":"302173bf.2377dc","type":"comment","z":"f7e38b71.5811d8","name":"Googlespreadsheet To Node red","info":"GOOGLE","x":150,"y":320,"wires":[]},{"id":"4adfae99.93ff","type":"inject","z":"f7e38b71.5811d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":380,"wires":[["ce25ff9b.d59ae"]]},{"id":"d16ca2ab.17888","type":"function","z":"f7e38b71.5811d8","name":"","func":"msg.payload=Number(msg.payload)/100\nmsg.payload = parseFloat ( msg.payload.toFixed(1))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":200,"wires":[["163567f4.cac448"]]},{"id":"c48b2883.571dd8","type":"modbus-read","z":"f7e38b71.5811d8","name":"FREKWENSI","topic":"FREWKENSI","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"0","quantity":"1","rate":"1","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"89cb9a7a.f6d138","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":110,"y":200,"wires":[["d16ca2ab.17888"],[]]},{"id":"163567f4.cac448","type":"GSheet","z":"f7e38b71.5811d8","creds":"281a99af.2108f6","method":"update","action":"","sheet":"1u7Q7evwp3GfVBvjlpxqn50TZ54k7-48RZlA9_cFuH1Y","cells":"Sheet1!A2","flatten":false,"name":"modbus","x":480,"y":200,"wires":[[]]},{"id":"281a99af.2108f6","type":"gauth"},{"id":"a9b5c519.89b948","type":"ui_group","name":"SIMOR","tab":"67ef31b2.efd2d","order":1,"disp":false,"width":27,"collapse":false},{"id":"89cb9a7a.f6d138","type":"modbus-client","d":true,"name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":false,"reconnectTimeout":"2000","parallelUnitIdsAllowed":false},{"id":"67ef31b2.efd2d","type":"ui_tab","name":"Dashboard","icon":"airplay","order":4,"disabled":false,"hidden":false}]

membuat data counter di node red


 


[{"id":"1012f694.b49289","type":"ui_gauge","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":1,"width":9,"height":5,"gtype":"gage","title":"SLOT KOSONG","label":"MOBIL","format":"{{value}}","min":0,"max":"200","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":640,"y":100,"wires":[]},{"id":"4f41c5a1.85426c","type":"inject","z":"22bbee26.d91a62","name":"decrement","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":110,"y":200,"wires":[["e9085587.2d19c"]]},{"id":"afb267a8.63739","type":"inject","z":"22bbee26.d91a62","name":"increment","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":110,"y":160,"wires":[["4a35e3c7.3dbd0c"]]},{"id":"f066adf1.21ba","type":"inject","z":"22bbee26.d91a62","name":"reset","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":100,"y":240,"wires":[["523f8e05.d5537"]]},{"id":"4a35e3c7.3dbd0c","type":"function","z":"22bbee26.d91a62","name":"msg object","func":"msg.increment = 1;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":160,"wires":[["f33ad4bd.777a5"]]},{"id":"523f8e05.d5537","type":"function","z":"22bbee26.d91a62","name":"msg object","func":"msg.reset = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":240,"wires":[["f33ad4bd.777a5"]]},{"id":"e9085587.2d19c","type":"function","z":"22bbee26.d91a62","name":"msg object","func":"msg.decrement = 1;\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":200,"wires":[["f33ad4bd.777a5"]]},{"id":"9b40b088.73732","type":"debug","z":"22bbee26.d91a62","name":"count","active":true,"console":"false","complete":"payload","x":620,"y":160,"wires":[]},{"id":"f33ad4bd.777a5","type":"counter","z":"22bbee26.d91a62","name":"","init":"200","step":"0","lower":"","upper":"","mode":"decrement","outputs":"2","x":470,"y":180,"wires":[["9b40b088.73732","1012f694.b49289","ac2b4066.91b36"],["876cc69d.d4b438"]]},{"id":"99b73d63.9fdb","type":"inject","z":"22bbee26.d91a62","name":"normal msg without control parameter","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":200,"y":120,"wires":[["f33ad4bd.777a5"]]},{"id":"876cc69d.d4b438","type":"debug","z":"22bbee26.d91a62","name":"message","active":false,"console":"false","complete":"true","x":630,"y":200,"wires":[]},{"id":"d48124bf.ed8f28","type":"ui_button","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":5,"width":3,"height":2,"passthru":false,"label":"OUT","tooltip":"","color":"","bgcolor":"GREEN","icon":"","payload":"1","payloadType":"num","topic":"","x":110,"y":80,"wires":[["b2f2fe87.481ad","4a35e3c7.3dbd0c"]]},{"id":"942ce095.99c73","type":"ui_button","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":14,"width":3,"height":2,"passthru":false,"label":"IN","tooltip":"","color":"","bgcolor":"RED","icon":"","payload":"1","payloadType":"num","topic":"","x":100,"y":300,"wires":[["e9085587.2d19c","b11d964d.4aaf98"]]},{"id":"b2f2fe87.481ad","type":"function","z":"22bbee26.d91a62","name":"msg object","func":"msg.increment = 1;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":320,"wires":[["f39ecc18.f8e0c"]]},{"id":"f39ecc18.f8e0c","type":"counter","z":"22bbee26.d91a62","name":"","init":"0","step":"0","lower":null,"upper":null,"mode":"increment","outputs":"2","x":480,"y":320,"wires":[["40e2406e.019fb"],[]]},{"id":"40e2406e.019fb","type":"ui_gauge","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":2,"width":6,"height":5,"gtype":"donut","title":"JUMLAH MOBIL KELUAR HARI INI","label":"MOBIL","format":"{{value}}","min":0,"max":"200","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":720,"y":320,"wires":[]},{"id":"fe46536b.82274","type":"counter","z":"22bbee26.d91a62","name":"","init":"0","step":"0","lower":null,"upper":null,"mode":"increment","outputs":"2","x":480,"y":400,"wires":[["225d1af5.5872b6"],[]]},{"id":"225d1af5.5872b6","type":"ui_gauge","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":3,"width":6,"height":5,"gtype":"donut","title":"JUMLAH MOBIL MASUK HARI INI","label":"MOBIL","format":"{{value}}","min":0,"max":"200","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":720,"y":400,"wires":[]},{"id":"ac2b4066.91b36","type":"ui_chart","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":18,"width":26,"height":8,"label":"GRAFIK SLOT KOSONG","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":710,"y":480,"wires":[[]]},{"id":"b11d964d.4aaf98","type":"function","z":"22bbee26.d91a62","name":"msg object","func":"msg.increment = 1;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":400,"wires":[["fe46536b.82274"]]},{"id":"b6da288b.675448","type":"function","z":"22bbee26.d91a62","name":"msg object","func":"msg.reset = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":360,"wires":[["f39ecc18.f8e0c","fe46536b.82274"]]},{"id":"2979c492.32e8cc","type":"inject","z":"22bbee26.d91a62","name":"reset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"0","payloadType":"msg","x":90,"y":360,"wires":[["b6da288b.675448"]]},{"id":"6703512c.e6a1b","type":"ui_button","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":11,"width":2,"height":2,"passthru":false,"label":"RESET","tooltip":"","color":"","bgcolor":"BLUE","icon":"","payload":"0","payloadType":"num","topic":"","x":120,"y":400,"wires":[["b6da288b.675448"]]},{"id":"25d40a98.5fd9c6","type":"ui_button","z":"22bbee26.d91a62","name":"","group":"1485a8fe.3b4187","order":9,"width":2,"height":2,"passthru":false,"label":"START","tooltip":"","color":"","bgcolor":"BLUE","icon":"","payload":"200","payloadType":"num","topic":"","x":280,"y":60,"wires":[["1012f694.b49289"]]},{"id":"1485a8fe.3b4187","type":"ui_group","name":"Default","tab":"9ddb2941.5788f8","order":1,"disp":false,"width":"26","collapse":false},{"id":"9ddb2941.5788f8","type":"ui_tab","name":"MONITORING PARKIR","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

Cara membuat datalogger blynk di spreadsheet / googlesheet menggunakan akun versi Free

  silahkan video di atas. semoga bermanfaat. jika masih kurang jelas bisa kontak saya