EasyManua.ls Logo

MC Technologies MC100 - Page 61

MC Technologies MC100
72 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MC100
Mobile programmable gateway
MC Technologies GmbH, Kabelkamp 2, 30179 Hannover, Germany
Tel: +49511 67 69 99-0, Fax: +49511 67 69 99-150, Website & Shop: www.mc-technologies.net, Email: info@mc-technologies.net
61
Node Red flow example:
Command:
root@MC100:~# mcwmbus -u http://localhost:1880/wmbus -c -C json
Exported Flow from Node RED example:
[{"id":"2d7d91ec.eb8846","type":"tab","label":"Wmbus","disabled":false,"info":""},{"id":"a4663c25.fa8f98","type":"switch","z":"2d7d91ec.eb8846","name":"2 Temperatures
Filter","property":"payload.SlaveInformation.Id","propertyType":"msg","rules":[{"t":"eq","v":"41000018","vt":"num"}],"checkall":"true","repair":true,"outputs":1,"x":340 ,"y":960,"wires":[["ea217aa1.348558"]
]},{"id":"c31e2cda.f9d7e","type":"http
in","z":"2d7d91ec.eb8846","name":"","url":"/wmbus","method":"post","upload":false,"swaggerDoc":"","x":90,"y":1080,"wires":[["a4663c25.fa8f98","ff357041.e0fc98","ef2bf7f.5136188","b 051727d.3aa3a8"]]},{"id":
"33fa8aec.51c216","type":"comment","z":"2d7d91ec.eb8846","name":"README","info":"# WMBus message filter and display\n\nThis Flow is here to demonstrate how to work with WM-Bus messages received by the
MC100.\n\nA command line tool will receive and parse the messages and post them to an url, which gets provided by node red.\n\nThis way every message can be parsed by node red.\n\nOn the command line
call\n\n```\nmcwmbus -U json -u http://localhost:1880/wmbus\n```\n\nto start receiving messages.\n\nWe tent to provide an init script, that starts the command on boot, as well as node-red.\nIf this is not
the case, feel free to contact us.\n\n## Message Format\n\nHere is an example messages, as received by node-red:\n\n```\n{\n \"SlaveInformation\": {\n \"Id\": 41000002,\n \"Manufacturer\":
\"SEO\",\n \"Version\": 1,\n \"ProductName\": \"Sensoco Wireless M‐Bus 2 NTC Temperature Sensor\",\n \"Medium\": \"Ambient Sensor\",\n \"AccessNumber\": 225,\n \"Status\": \"00\",\n
\"Signature\": \"0000\"\n },\n \"DataRecords\": [\n {\n \"id\": 0,\n \"Function\": \"Instantaneous value\",\n \"StorageNumber\": 0,\n \"VIF\": 102,\n \"VIFE\": 0,\n
\"Unit\": \"External temperature (1e-1 deg C)\",\n \"Value\": \"245\",\n \"Timestamp\": \"2020-06-08T13:41:42Z\"\n },\n {\n \"id\": 1,\n \"Function\": \"Instantaneous value\",\n
\"StorageNumber\": 0,\n \"VIF\": 102,\n \"VIFE\": 0,\n \"Unit\": \"External temperature (1e-1 deg C)\",\n \"Value\": \"246\",\n \"Timestamp\": \"2020-06-08T13:41:42Z\"\n }\n
],\n \"RawMessage\": \"1644AF4C02000041011B7AE10000000266F5000266F600\"\n}\n```\n\nThe message itself is in json and the fieldnames should not change, but the number of DataRecords might, depending on
your
sensor.\n","x":100,"y":1020,"wires":[]},{"id":"ff357041.e0fc98","type":"debug","z":"2d7d91ec.eb8846","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":35 0,"y"
:1080,"wires":[]},{"id":"1ac3dc7c.7a5114","type":"change","z":"2d7d91ec.eb8846","name":"Temperature
1","rules":[{"t":"move","p":"payload.DataRecords[0].Value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":fa lse,"x":780,"y":940,"wires":[["77aa58c.31664a8"]]},{"i
d":"ac6f27a5.b2baf8","type":"change","z":"2d7d91ec.eb8846","name":"Temperature
2","rules":[{"t":"move","p":"payload.DataRecords[1].Value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":980,"wires":[["244fbd87.84b42a"]]},{"i
d":"d0c214cb.c425","type":"ui_chart","z":"2d7d91ec.eb8846","name":"","group":"2b1712f4.c90846","order":2,"width":0,"height":0,"label":"Temperature
1","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"u
seOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1100,"y":940,"wires":[[]]},{"id":"c
d4e2dac.d1457","type":"ui_chart","z":"2d7d91ec.eb8846","name":"","group":"2b1712f4.c90846","order":2,"width":0,"height":0,"label" :"Temperature
2","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"u
seOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1100,"y":980,"wires":[[]]},{"id":"a
b52af69.2de7d","type":"ui_text","z":"2d7d91ec.eb8846","group":"d45c3f1b.23739","order":4,"width":30,"height":2,"name":"ID | Time | Temp | Temp 2 | RSSI","label":"","format":"{{msg.payload}}","layout":"col-
center","x":1610,"y":960,"wires":[]},{"id":"df2314df.1e1bd","type":"function","z":"2d7d91ec.eb8846","name":"json-to-csv","func":"\n// This function will messages, based on ID and Manufacturer\n\n// ID and
Manufacturer are unique for all devices.\n// The device ID used here must be replaced with the device you have.\n// Please use the Debug Window to find out your device ID\n\nid=
msg.payload.SlaveInformation.Id\ntemp= msg.payload.DataRecords[0].Value /10.0;\ntemp2= msg.payload.DataRecords[1].Value / 10.0;\ntime= msg.payload.DataRecords[1].Timestamp\nrssi = msg.payload.RSSI
\n\nmsg.payload=id+\" ,\"+time+\" ,\"+temp+\" ,\"+temp2+\" ,\"+rssi\nreturn
msg;\n","outputs":1,"noerr":0,"x":1370,"y":940,"wires":[["ab52af69.2de7d","7be6b356.4bea54"]]},{"id":"7be6b356.4bea54","type": "file","z":"2d7d91ec.eb8846","name":"Save to
file","filename":"/sensors/41000018.csv","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1830,"y":940,"wires":[[]]},{"id":"2df41e95.80746a","type":"ui_text","z":"2d7d91ec.eb8846","group":
"d45c3f1b.23739","order":1,"width":"30","height":2,"name":"","label":"ID | Time | Temp | Temp 2 | RSSI","format":"{{msg.payload}}", "layout":"col-
center","x":1610,"y":900,"wires":[]},{"id":"ea217aa1.348558","type":"link
out","z":"2d7d91ec.eb8846","name":"41000018/In","links":["56517074.898d88","253baead.5638ea","c1f3e626.b000d"],"x":535,"y":960,"wires":[]},{"id":"253baead.5638ea","type ":"link
in","z":"2d7d91ec.eb8846","name":"41000018/Out1","links":["ea217aa1.348558"],"x":1235,"y":940,"wires":[["df2314df.1e1bd"]]},{"id":"56517074.898d88","type":"link
in","z":"2d7d91ec.eb8846","name":"41000018/Out","links":["ea217aa1.348558"],"x":655,"y":960,"wires":[["1ac3dc7c.7a5114","ac6f27a5.b2baf8"]]},{"id":"be5603e3.b8fb98","type":"function","z":"2d7d91ec.eb8846",
"name":"map data","func":"var time = msg.payload.DataRecords[1].Timestamp;\nvar Temp1= msg.payload.DataRecords[0].Value/10.0;\nvar Temp2= msg.payload.DataRecords[1].Value/10.0;\nvar id=
msg.payload.SlaveInformation.Id;\n\nmsg.payload = {};\n\nmsg.payload = {\n \"name\": id,\n \"time\": time,\n \"Temp 1\": Temp1,\n \"Temp 2\": Temp2,\n \"id\": id ,\n \"status\":
\"reviewed\",\n \"locationSource\": \"nn\",\n \"magSource\": \"nn\",\n \"lon\": 000,\n \"lat\": 000,\n \"icon\": \"globe\",\n \"iconColor\": \"orange\",\n
\"layer\":\"wmbus\",\n}\ndelete msg.payload.status;\ndelete msg.payload.locationSource;\t\ndelete msg.payload.magSource;\ndelete msg.payload.id;\n\nreturn
msg;","outputs":1,"noerr":4,"x":1360,"y":1020,"wires":[["659e3d0f.b9ced4"]]},{"id":"c1f3e626.b000d","type":"link
in","z":"2d7d91ec.eb8846","name":"41000018/Out2","links":["ea217aa1.348558"],"x":1235,"y":1020,"wires":[["be5603e3.b8fb98"]]},{"id":"ef2bf7f.5136188","type":"switch","z":"2d7d91ec.eb8846","name":"Temperatu
re and Humidity
Filter","property":"payload.SlaveInformation.Id","propertyType":"msg","rules":[{"t":"eq","v":"63000001","vt":"num"}],"checkall":"true","repair":true,"outputs":1,"x":370,"y":1220,"wires":[["5c2a3f23.d8b84"]
]},{"id":"95da81a5.910068","type":"change","z":"2d7d91ec.eb8846","name":"Temperature","rules":[{"t":"move","p":"payload.DataRecords[0].Value","pt":"msg","to":"payload ","tot":"msg"}],"action":"","property":
"","from":"","to":"","reg":false,"x":830,"y":1200,"wires":[["1cc10cb8.788533"]]},{"id":"decdcbb5.0ff8","type":"change","z":"2d7d91ec.eb8846","name":"Humidity","rules":[{"t":"move","p":"payload.DataRecords[
1].Value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":1240,"wires":[["53f3cca1.ecb224"]]},{"id":"5c2a3f23.d8b84","type":"link
out","z":"2d7d91ec.eb8846","name":"61000001/In","links":["bbe60719.6551c8","f32f2d3d.1a96d","3fc40fe7.bd2c88"],"x":575,"y":1220,"wires":[]},{"id":"bbe60719.6551c8","type":"link
in","z":"2d7d91ec.eb8846","name":"63000001/Out","links":["5c2a3f23.d8b84"],"x":695,"y":1220,"wires":[["95da81a5.910068","decdcbb5.0ff8"]]},{"id":"f32f2d3d.1a 96d","type":"link
in","z":"2d7d91ec.eb8846","name":"63000001/Out","links":["5c2a3f23.d8b84"],"x":1275,"y":1200,"wires":[["b875b5a0.e15b28"]]},{"id":"4512209e.633028","type":"file","z":"2d7d91ec.eb8846","name":"Save to
file","filename":"/sensors/63000001.csv","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1890,"y":1200,"wires":[[]]},{"id":"b00c0cbd.4da31","type":"ui_text","z":"2d7d91ec.eb8846","group":
"356e6fbe.368018","order":5,"width":30,"height":1,"name":"ID | Time | Temp | Humidity | RSSI","label":"","format":"{{msg.payload}}","layout":"col-
center","x":1660,"y":1220,"wires":[]},{"id":"b875b5a0.e15b28","type":"function","z":"2d7d91ec.eb8846","name":"json-to-csv","func":"\n// This function will messages, based on ID and Manufacturer\n\n// ID
and Manufacturer are unique for all devices.\n// The device ID used here must be replaced with the device you have.\n// Please use the Debug Window to find out your device ID\n\nid=
msg.payload.SlaveInformation.Id\ntemp= msg.payload.DataRecords[0].Value /10.0;\nhum= msg.payload.DataRecords[1].Value \ntime= msg.payload.DataRecords[1].Timestamp\nrssi = msg.payload.RSSI
\n\nmsg.payload=id+\" ,\"+temp+\" ,\"+hum+\" ,\"+time+\" ,\"+rssi\nreturn
msg;\n","outputs":1,"noerr":0,"x":1410,"y":1200,"wires":[["b00c0cbd.4da31","4512209e.633028"]]},{"id":"25749ef5.ae691a","type":"ui _text","z":"2d7d91ec.eb8846","group":"356e6fbe.368018","order":1,"width":30
,"height":1,"name":"","label":"ID | Time | Temp | Humidity | RSSI","format":"{{msg.payload}}","layout":"col-center","x":1660,"y":1160,"wires":[]},{"id":"3fc40fe7.bd2c88","type":"link
in","z":"2d7d91ec.eb8846","name":"63000001/Out","links":["5c2a3f23.d8b84"],"x":1255,"y":1280,"wires":[["7c9bb07b.6f2ca"]]},{"id":"7c9bb07b.6f2ca","type":"function","z":"2d7d91ec.eb8846","n ame":"map
data","func":"var time = msg.payload.DataRecords[1].Timestamp;\nvar Temp1= msg.payload.DataRecords[0].Value/10.0;\nvar Humidity= msg.payload.DataRecords[1].Value;\nvar id=
msg.payload.SlaveInformation.Id;\n\nmsg.payload = {};\n\nmsg.payload = {\n \"name\": id,\n \"time\": time,\n \"Temp1\": Temp1,\n \"Humidity\": Humidity,\n \"id\": id ,\n \"status\":
\"reviewed\",\n \"locationSource\": \"nn\",\n \"magSource\": \"nn\",\n \"lon\": 00000,\n \"lat\": 00000,\n \"icon\": \"globe\",\n \"iconColor\": \"orange\",\n
\"layer\":\"wmbus\",\n}\ndelete msg.payload.status;\ndelete msg.payload.locationSource;\t\ndelete msg.payload.magSource;\ndelete msg.payload.id;\n\nreturn
msg;","outputs":1,"noerr":4,"x":1380,"y":1280,"wires":[["a2214636.71d7d"]]},{"id":"9a5d7873.d2e8d8","type":"ui_worldmap","z":"2d7d91ec.eb8846","group":"df02e013.0749a","order":1,"width":"20","height":"20",
"name":"","lat":"52.4126344","lon":"9.7326637","zoom":"18","layer":"OSM","cluster":"4","maxage":"1200","usermenu":"hide","layers":"hide","panit":"false","panlock":"false","zoomlock":"false","hiderightclick
":"true","coords":"none","showgrid":"false","path":"/worldmap","x":1000,"y":1080,"wires":[]},{"id":"979840e5.0c08a8","type":"ui_chart","z":"2d7d91ec.eb88 46","name":"","group":"6586f11c.31c43","order":1,"wi
dth":0,"height":0,"label":"Temperature","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":true,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":""," r
emoveOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"
x":1130,"y":1200,"wires":[[]]},{"id":"53f3cca1.ecb224","type":"ui_chart","z":"2d7d91ec.eb8846","name":"","group":"6586f11c.31c43","order":3,"width":0,"height":0,"label":"Humidity","chartType":"line","legen
d":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":fals
e,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1120,"y":1240 ,"wires":[[]]},{"id":"e2c4ed7d.b50bb8","type":"http
response","z":"2d7d91ec.eb8846","name":"","statusCode":"","headers":{},"x":490,"y":1140,"wires":[]},{"id":"b051727d.3aa3a8","type":"function","z":"2d7d91ec.eb8846","name":"Be quiet","func":" \nmsg.payload=
\"\";\n\n// This node will remove the message from the answer to curl.\n// Whatever is given here as the payload, will be displayed by the command line tool.\n\nreturn
msg;","outputs":1,"noerr":0,"x":340,"y":1140,"wires":[["e2c4ed7d.b50bb8"]]},{"id":"1cc10cb8.788533","type":"range","z":"2d7d91ec.eb8846","minin":"0","maxin":"1000","minout":"0","maxout":"100","action":"sca
le","round":false,"property":"payload","name":"","x":980,"y":1200,"wires":[["979840e5.0c08a8"]]},{"id":"77aa58c.31664a8","type":"range","z ":"2d7d91ec.eb8846","minin":"0","maxin":"1000","minout":"0","maxout
":"100","action":"scale","round":false,"property":"payload","name":"","x":940,"y":940,"wires":[["d0c214cb.c425"]]},{"id":"244fbd87.84b42a","type":"range","z":"2d7d91ec.eb8846","minin":"0"," maxin":"1000","m
inout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"","x":940,"y":980,"wires":[["cd4e2dac.d1457"]]},{"id":"a2214636.71d7d","type":"link
out","z":"2d7d91ec.eb8846","name":"map 169MHz output","links":["e02fa5aa.f6abf8"],"x":1515,"y":1280,"wires":[]},{"id":"659e3d0f.b9ced4","type":"link out","z":"2d7d91ec.eb8846","name":"map 833
Output","links":["e02fa5aa.f6abf8"],"x":1515,"y":1020,"wires":[]},{"id":"e02fa5aa.f6abf8","type":"link in","z":"2d7d91ec.eb8846","name":"map
Input","links":["659e3d0f.b9ced4","a2214636.71d7d"],"x":760,"y":1080,"wires":[["9a5d7873.d2e8d8"]]},{"id":"2b1712f4.c90846","type":"ui_group","z":"","name":"41000018","tab":"fbb0f1e5.e1a2e","order":2,"disp
":true,"width":"7","collapse":false},{"id":"d45c3f1b.23739","type":"ui_group","z":"","name":"Last
Update","tab":"fbb0f1e5.e1a2e","order":1,"disp":true,"width":"30","collapse":false},{"id":"356e6fbe.368018","type":"ui_group","z":"","name":"Last
update","tab":"439b7598.b25cc4","order":1,"disp":true,"width":"30","collapse":false},{"id":"df02e013.0749a","type":"ui_group","z":"","name":"Map","tab":"3e66a237.a71a76","order":1,"disp":true,"width":"20",
"collapse":false},{"id":"6586f11c.31c43","type":"ui_group","z":"","name":"63000001","tab":"439b7598.b25cc4","order":2,"disp":true,"width":7,"collapse":false},{"id":"fbb0f1e5.e1a2e","type":"ui_tab","z":"","
name":"2 Temperature Sensors","icon":"dashboard","disabled":false,"hidden":false},{"id":"439b7598.b25cc4","type":"ui_tab","z":"","name":"Temp & Humidity
Sensors","icon":"dashboard","disabled":false,"hidden":false},{"id":"3e66a237.a71a76","type":"ui_tab","z":"","name":"Map","icon":"dashboard","disabled":false,"hidden":false}]

Table of Contents

Related product manuals