Data Modelling example UNS

Data Modelling UNS example for my blog article.

[{"id":"cba99e66130c4762","type":"tab","label":"S7 to UNS","disabled":false,"info":"","env":[]},{"id":"8e64f3c5bf3cea76","type":"revpi-single-input","z":"cba99e66130c4762","server":"37d1878cc07f0592","inputpin":"Core_Temperatur","topic":"temp","x":120,"y":100,"wires":[["f63558def9e857c9"]]},{"id":"cd1964f998212096","type":"debug","z":"cba99e66130c4762","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1080,"y":60,"wires":[]},{"id":"f63558def9e857c9","type":"rbe","z":"cba99e66130c4762","name":"rbe","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":310,"y":100,"wires":[["617f860c58e05d2d"]]},{"id":"4604d66f1e04ee2b","type":"template","z":"cba99e66130c4762","name":"StationA Measurements","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n    \"value\": {{payload}},\n    \"unit\": \"Celsius\",\n    \"timestamp\": \"{{timestamp}}\"\n}\n","output":"json","x":810,"y":100,"wires":[["cd1964f998212096","31e5f357440237df"]]},{"id":"617f860c58e05d2d","type":"function","z":"cba99e66130c4762","name":"Add timestamp","func":"msg.timestamp = new Date().toISOString();\nmsg.payload = parseFloat(msg.payload);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":100,"wires":[["4604d66f1e04ee2b","adb10466d6a796f4"]]},{"id":"377dba3018818550","type":"comment","z":"cba99e66130c4762","name":"Schema transformation & validation","info":"","x":800,"y":60,"wires":[]},{"id":"31e5f357440237df","type":"mqtt out","z":"cba99e66130c4762","name":"","topic":"Enterprise/Site/Line1/StationA/measurements/temperature","qos":"2","retain":"","respTopic":"","contentType":"application/json","userProps":"","correl":"","expiry":"","broker":"2f5bb399d59678df","x":1240,"y":100,"wires":[]},{"id":"adb10466d6a796f4","type":"template","z":"cba99e66130c4762","name":"StationA Schema","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"$schema\": \"Enterprise/Site/Line1/StationA/measurements/_schema\",\n    \"title\": \"Measurement Schema for StationA\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"value\": {\n            \"description\": \"The actual value being measured\",\n            \"type\": \"number\"\n        },\n        \"unit\": {\n            \"description\": \"The unit of the measurement value\",\n            \"type\": \"string\"\n        },\n        \"timestamp\": {\n            \"description\": \"The timestamp of the measurement in ISO 8601 format\",\n            \"type\": \"string\"\n        }\n    },\n    \"required\": [\n        \"value\",\n        \"unit\",\n        \"timestamp\"\n    ]\n}","output":"json","x":790,"y":140,"wires":[["b3f1334d3c5ff3a5"]]},{"id":"b3f1334d3c5ff3a5","type":"mqtt out","z":"cba99e66130c4762","name":"","topic":"Enterprise/Site/Line1/StationA/measurements/_schema","qos":"2","retain":"","respTopic":"","contentType":"application/json","userProps":"","correl":"","expiry":"","broker":"2f5bb399d59678df","x":1230,"y":140,"wires":[]},{"id":"37d1878cc07f0592","type":"revpi-server","host":"localhost","port":"8000","user":"","password":"","rejectUnauthorized":false,"ca":""},{"id":"2f5bb399d59678df","type":"mqtt-broker","name":"Pro Mosquitto","broker":"mqtt://h7qb1fqixfdk-lvt2oy4qa3pz.cedalo.dev","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"5","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

Flow Info

Created 1 year ago
Updated 11 months, 3 weeks ago
Rating: not yet rated

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x1)
  • function (x1)
  • mqtt out (x2)
  • mqtt-broker (x1)
  • rbe (x1)
  • template (x2)
Other

Tags

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