[ { "id": "54b453f8b1822086", "type": "tab", "label": "Temperatures", "disabled": false, "info": "", "env": [] }, { "id": "42787d14c99c43ed", "type": "modbus-flex-getter", "z": "54b453f8b1822086", "name": "Heating PLC", "showStatusActivities": false, "showErrors": false, "logIOActivities": false, "server": "32c359504aeff938", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "x": 610, "y": 160, "wires": [ [], [ "c882614f5223fdb8" ] ] }, { "id": "741032aef6173311", "type": "inject", "z": "54b453f8b1822086", "name": "Poll every 5 sec", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "5", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 190, "y": 160, "wires": [ [ "a34af57b10993218" ] ] }, { "id": "a34af57b10993218", "type": "function", "z": "54b453f8b1822086", "name": "Modbus temp outside", "func": "msg.payload = { value: msg.payload, 'fc': 3, 'unitid': 1, 'address': 16 , 'quantity': 2 } \nreturn msg", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 420, "y": 160, "wires": [ [ "42787d14c99c43ed" ] ] }, { "id": "c882614f5223fdb8", "type": "buffer-parser", "z": "54b453f8b1822086", "name": "2x16bit to 32bit int", "data": "payload.buffer", "dataType": "msg", "specification": "spec", "specificationType": "ui", "items": [ { "type": "int32be", "name": "temp_outside", "offset": 0, "length": 1, "offsetbit": 0, "scale": "0.1", "mask": "" } ], "swap1": "", "swap2": "", "swap3": "", "swap1Type": "swap", "swap2Type": "swap", "swap3Type": "swap", "msgProperty": "payload", "msgPropertyType": "str", "resultType": "keyvalue", "resultTypeType": "return", "multipleResult": false, "fanOutMultipleResult": false, "setTopic": true, "outputs": 1, "x": 870, "y": 160, "wires": [ [ "28b5a302c6acaa9c" ] ] }, { "id": "c8107088.37ef9", "type": "http in", "z": "54b453f8b1822086", "name": "", "url": "/temps", "method": "get", "upload": false, "swaggerDoc": "", "x": 150, "y": 720, "wires": [ [ "46de4c0e35edab04" ] ] }, { "id": "65401623.9abfe8", "type": "change", "z": "54b453f8b1822086", "name": "Set Headers", "rules": [ { "t": "set", "p": "headers", "pt": "msg", "to": "{}", "tot": "json" }, { "t": "set", "p": "headers.content-type", "pt": "msg", "to": "application/json", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 890, "y": 720, "wires": [ [ "f7d3e35a.082c2" ] ] }, { "id": "f7d3e35a.082c2", "type": "http response", "z": "54b453f8b1822086", "name": "", "statusCode": "", "headers": {}, "x": 1130, "y": 720, "wires": [] }, { "id": "46de4c0e35edab04", "type": "function", "z": "54b453f8b1822086", "name": "Build Object", "func": "var temp_outside = parseFloat(global.get(\"temp_outside\"))\n\nmsg.payload = {outside:temp_outside};\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 510, "y": 720, "wires": [ [ "e23dfd0f76ea6261" ] ] }, { "id": "e23dfd0f76ea6261", "type": "json", "z": "54b453f8b1822086", "name": "", "property": "payload", "action": "", "pretty": false, "x": 710, "y": 720, "wires": [ [ "65401623.9abfe8" ] ] }, { "id": "28b5a302c6acaa9c", "type": "function", "z": "54b453f8b1822086", "name": "save to global var", "func": "temp = parseFloat(msg.payload.temp_outside).toFixed(1);\nglobal.set(\"temp_outside\", temp)\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1110, "y": 160, "wires": [ [] ] }, { "id": "32c359504aeff938", "type": "modbus-client", "name": "Heating PLC", "clienttype": "tcp", "bufferCommands": true, "stateLogEnabled": false, "queueLogEnabled": false, "failureLogEnabled": true, "tcpHost": "10.1.0.7", "tcpPort": "502", "tcpType": "DEFAULT", "serialPort": "/dev/ttyUSB", "serialType": "RTU-BUFFERD", "serialBaudrate": "9600", "serialDatabits": "8", "serialStopbits": "1", "serialParity": "none", "serialConnectionDelay": "100", "serialAsciiResponseStartDelimiter": "0x3A", "unit_id": "1", "commandDelay": "1", "clientTimeout": "1000", "reconnectOnTimeout": true, "reconnectTimeout": "2000", "parallelUnitIdsAllowed": true } ]