ogema-io

An example flow using ogema-io node.

[{"id":"c26577d4.70dc08","type":"ogema in","z":"c955d988.42c2d","gwid":"testGateway7","name":"","useVisualisation":true,"addText":"Measured Temperature","topic":"SimulatedFreezer/temperatureSensor/reading","qos":"1","broker":"580db7bb.141c1","x":260.50006103515625,"y":200,"wires":[["2c7b0763.95a7c8","2e895b31.c2083c","97cd0c0b.774eb8"]]},{"id":"c654bce3.2ef29","type":"debug","z":"c955d988.42c2d","name":"","active":true,"console":"false","complete":"true","x":931.5,"y":186.00006103515625,"wires":[]},{"id":"97cd0c0b.774eb8","type":"ogema out","z":"c955d988.42c2d","gwid":"testGateway7","unit":"K","useVisualisation":true,"addText":"Temperatur ","name":"","topic":"SimulatedFreezer/temperatureSensor/settings/controlLimits/upperLimit","qos":"1","retain":"","broker":"580db7bb.141c1","x":804.2500610351562,"y":125.24996948242188,"wires":[]},{"id":"fac1190b.8dbcb8","type":"debug","z":"c955d988.42c2d","name":"","active":true,"console":"false","complete":"true","x":582.2499389648438,"y":574.0500793457031,"wires":[]},{"id":"f3e1038c.51c1e8","type":"file","z":"c955d988.42c2d","name":"","filename":"C:\\test\\ogemalist.txt","appendNewline":true,"createDir":true,"overwriteFile":"false","x":610.5357055664062,"y":660.9286804199219,"wires":[]},{"id":"6a5e368.91009c8","type":"function","z":"c955d988.42c2d","name":"Split","func":"var out = [];\nvar pl = JSON.parse(msg.payload);\nfor(var w in pl.topic){\n    out.push({payload:pl.topic[w]});\n}\n\n\nreturn [out];","outputs":1,"noerr":0,"x":347.5,"y":661.3334045410156,"wires":[["f3e1038c.51c1e8"]]},{"id":"2e895b31.c2083c","type":"ogema out","z":"c955d988.42c2d","gwid":"testGateway7","unit":"K","useVisualisation":true,"addText":"Vorlauf","name":"","topic":"SimulatedFreezer/temperatureSensor/settings/controlLimits/lowerLimit","qos":"1","retain":"","broker":"580db7bb.141c1","x":802.5,"y":67.33332824707031,"wires":[]},{"id":"2c7b0763.95a7c8","type":"function","z":"c955d988.42c2d","name":"extract","func":"if(typeof msg.payload === 'string')\n{\n    msg.payload=JSON.parse(msg.payload);\n}\nvar val=msg.payload[\"value\"];\nif(val !== undefined)\nmsg.payload[\"value\"]=parseFloat(val.toFixed(2));\nvar newMsg={\"payload\":''};\nnewMsg.payload=msg.payload.value;\nreturn newMsg;\n","outputs":1,"noerr":0,"x":612.5,"y":271,"wires":[["f3f0d20.582563","c654bce3.2ef29","b5add116.6bc15"]]},{"id":"e3e4fdda.af5bb","type":"ui_chart","z":"c955d988.42c2d","name":"Selectable Chart","group":"dd625ae7.120da","order":0,"width":"6","height":"4","label":"Configurable chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"Waiting for Data","dot":false,"ymin":"250,0","ymax":"350","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"x":487.50006103515625,"y":892,"wires":[[],[]]},{"id":"f3f0d20.582563","type":"ui_gauge","z":"c955d988.42c2d","name":"","group":"d159eccc.50bca8","order":0,"width":0,"height":0,"gtype":"gage","title":"Gauge","label":"units","format":"{{value}}","min":"0","max":"500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":933.5000610351562,"y":251,"wires":[]},{"id":"d8f4d122.80d57","type":"ui_dropdown","z":"c955d988.42c2d","name":"FloatResources","label":"","place":"Select option","group":"dd625ae7.120da","order":0,"width":0,"height":0,"passthru":true,"options":[{"label":"a","value":10,"type":"num"}],"payload":"","topic":"msg.payload","x":720,"y":760,"wires":[["55ba66b1.9dbda"]]},{"id":"55ba66b1.9dbda","type":"function","z":"c955d988.42c2d","name":"StoreChoosenRes","func":"global.set(\"choosenResource\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":938.1666870117188,"y":754.1666870117188,"wires":[[]]},{"id":"eaa89a77.ccfbf","type":"function","z":"c955d988.42c2d","name":"Filter","func":"if(typeof msg.payload === 'string')\n{\n    msg.payload=JSON.parse(msg.payload);\n}\nvar choosen=global.get(\"choosenResource\")||\"\";\nif(msg.topic==\"N/\"+choosen){\n    var newMsg={\"payload\":''};\n    newMsg.payload=msg.payload.value;\n    return newMsg;\n}\nelse return null; ","outputs":1,"noerr":0,"x":314,"y":891.3333740234375,"wires":[["e3e4fdda.af5bb"]]},{"id":"c20596e.c1dc8e8","type":"ogema in","z":"c955d988.42c2d","gwid":"testGateway7","name":"All Messages","useVisualisation":false,"addText":"","topic":"#","qos":"1","broker":"580db7bb.141c1","x":126.99998474121094,"y":891.6666564941406,"wires":[["eaa89a77.ccfbf"]]},{"id":"185311ac.e82b3e","type":"ogema in","z":"c955d988.42c2d","gwid":"","name":"","useVisualisation":false,"addText":"","topic":"LISTRESPONSE","qos":"1","broker":"580db7bb.141c1","x":120.50001525878906,"y":756.0000305175781,"wires":[["6a5e368.91009c8","517d0a42.aa5914"]]},{"id":"517d0a42.aa5914","type":"json","z":"c955d988.42c2d","name":"","pretty":false,"x":341.50001525878906,"y":755.6666412353516,"wires":[["7d392eb0.e6883"]]},{"id":"53f3d1bc.3bfac","type":"comment","z":"c955d988.42c2d","name":"ui_dropdown needs the selectable files in msg.option","info":"","x":391.5,"y":794.6666564941406,"wires":[]},{"id":"3f243329.1807ac","type":"comment","z":"c955d988.42c2d","name":"input of the selector box","info":"","x":713.5,"y":793.6666564941406,"wires":[]},{"id":"ac4db725.04dd98","type":"comment","z":"c955d988.42c2d","name":"store the selected value to a global variable","info":"","x":992.4999389648438,"y":793.6666564941406,"wires":[]},{"id":"ce082678.351de8","type":"comment","z":"c955d988.42c2d","name":"break the list to variables","info":"","x":346.5,"y":621.6667175292969,"wires":[]},{"id":"a88541e8.dfbea","type":"comment","z":"c955d988.42c2d","name":"store the variables to a file (example)","info":"","x":643.5,"y":619.0000915527344,"wires":[]},{"id":"b5add116.6bc15","type":"ui_chart","z":"c955d988.42c2d","name":"Fix Freezer temp","group":"d159eccc.50bca8","order":0,"width":0,"height":0,"label":"Freezer Temp","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":975.4999389648438,"y":296,"wires":[[],[]]},{"id":"39d0e5b6.843792","type":"comment","z":"c955d988.42c2d","name":"charts expect the value as payload","info":"","x":584.5,"y":312.33331298828125,"wires":[]},{"id":"157e9a20.7e238e","type":"comment","z":"c955d988.42c2d","name":"show the Freezer temperature","info":"","x":979.4999389648438,"y":340.33331298828125,"wires":[]},{"id":"f6f20b81.6afa3","type":"comment","z":"c955d988.42c2d","name":"send the value back to create some output","info":"","x":715.5,"y":25.333328247070312,"wires":[]},{"id":"1156502e.307ed8","type":"comment","z":"c955d988.42c2d","name":"Use the selection to filter the value","info":"","x":343.5,"y":932.3333740234375,"wires":[]},{"id":"7d392eb0.e6883","type":"change","z":"c955d988.42c2d","name":"","rules":[{"t":"move","p":"payload._float","pt":"msg","to":"options","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":700,"wires":[["d8f4d122.80d57","fac1190b.8dbcb8"]]},{"id":"580db7bb.141c1","type":"OG-broker","z":"","broker":"localhost","port":"1883","tls":"bf8adf89.dbdbc8","clientid":"","usetls":true,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":""},{"id":"dd625ae7.120da","type":"ui_group","z":"","name":"Group 2","tab":"c88f1aa.a982168","order":2,"disp":true,"width":"6"},{"id":"d159eccc.50bca8","type":"ui_group","z":"","name":"Group 1","tab":"c88f1aa.a982168","order":1,"disp":true,"width":"6"},{"id":"bf8adf89.dbdbc8","type":"tls-config","z":"","name":"","cert":"c:\\ogema\\sources\\mainIIS\\rundirs\\ogema-pro-felix-launcher\\localRoot\\node-red-vm_OGEMAside.pem","key":"c:\\ogema\\sources\\mainIIS\\rundirs\\ogema-pro-felix-launcher\\localRoot\\node-red-vm_OGEMAsidePriv.key","ca":"c:\\ogema\\sources\\mainIIS\\rundirs\\ogema-pro-felix-launcher\\localRoot\\rootCert.pem","certname":"","keyname":"","caname":"","verifyservercert":false},{"id":"c88f1aa.a982168","type":"ui_tab","name":"Tab 1","icon":"dashboard","order":1}]

Flow Info

Created 6 years, 9 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • comment (x9)
  • debug (x2)
  • file (x1)
  • function (x4)
  • json (x1)
  • tls-config (x1)
Other

Tags

  • ogema
  • iot
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option