Slide 17
Slide 17 text
Node-REDでNGSIデータを読み書きする
NGSIデータのダッシュボードでの可視化フロー
17
[{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow
1","disabled":false,"info":""},{"id":"3cc11d24.ff01a2","type":"comment","z":"f6f2187d.f17ca8","name":"WARNING: please check you have started this
container with a volume that is mounted to /data¥¥n otherwise any flow changes are lost when you redeploy or upgrade the container¥¥n (e.g. upgrade
to a more recent node-red docker image).¥¥n If you are using named volumes you can ignore this warning.¥¥n Double click or see info side panel to
learn how to start Node-RED in Docker to save your work","info":"¥nTo start docker with a bind mount volume (-v option), for example:¥n¥n```¥ndocker
run -it -p 1880:1880 -v /home/user/node_red_data:/data --name mynodered nodered/node-red¥n```¥n¥nwhere `/home/user/node_red_data` is a
directory on your host machine where you want to store your flows.¥n¥nIf you do not do this then you can experiment and redploy flows, but if you
restart or upgrade the container the flows will be disconnected and lost. ¥n¥nThey will still exist in a hidden data volume, which can be recovered using
standard docker techniques, but that is much more complex than just starting with a named volume as described
above.","x":350,"y":80,"wires":[]},{"id":"e9a6b8ca.396498","type":"NGSI-
Entity","z":"f6f2187d.f17ca8","name":"test","endpoint":"e880c8d8.cfe0c8","protocol":"v2","ldContext":"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-
context.jsonld","mode":"normalized","mimeType":"application/ld+json","attrs":"","x":150,"y":300,"wires":[["7d49bbdc.944b54","3c2aa1a8.0e71be"]]},{"
id":"60f518ba.a13428","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"}],"repeat":"300","crontab":"","once":false,"onceDelay":
0.1,"topic":"","payload":"urn:ngsi-
ld:WeatherObserved:10417","payloadType":"str","x":150,"y":240,"wires":[["e9a6b8ca.396498"]]},{"id":"7d49bbdc.944b54","type":"debug","z":"f6f2187
d.f17ca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":370,"y":280,
"wires":[]},{"id":"fa65993a.fa02d8","type":"ui_text","z":"f6f2187d.f17ca8","group":"251627e8.a926c8","order":3,"width":0,"height":0,"name":"","label":
"CO2濃度","format":"{{msg.payload}}","layout":"row-
spread","className":"","x":160,"y":500,"wires":[]},{"id":"3c2aa1a8.0e71be","type":"json","z":"f6f2187d.f17ca8","name":"","property":"payload","action
":"","pretty":false,"x":150,"y":380,"wires":[["7d2f129d.69da2c","5b24b7d4.ab30d8"]]},{"id":"7d2f129d.69da2c","type":"change","z":"f6f2187d.f17ca8","
name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.CO2.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":14
0,"y":440,"wires":[["7d49bbdc.944b54","fa65993a.fa02d8","cbda101b.9ccfb"]]},{"id":"cbda101b.9ccfb","type":"ui_gauge","z":"f6f2187d.f17ca8","name"
:"","group":"251627e8.a926c8","order":2,"width":0,"height":0,"gtype":"gage","title":"CO2濃度
","label":"units","format":"{{value}}","min":"400","max":"1100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"800","seg2":"1000","className":"","
x":160,"y":560,"wires":[]},{"id":"e6f6af56.20ac7","type":"ui_text","z":"f6f2187d.f17ca8","group":"251627e8.a926c8","order":1,"width":0,"height":0,"na
me":"","label":"取得時刻","format":"{{msg.payload}}","layout":"row-
spread","className":"","x":380,"y":500,"wires":[]},{"id":"5b24b7d4.ab30d8","type":"change","z":"f6f2187d.f17ca8","name":"","rules":[{"t":"set","p":"pa
yload","pt":"msg","to":"payload.dateObservedJST.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":440,"wires":[["e
6f6af56.20ac7"]]},{"id":"e880c8d8.cfe0c8","type":"Context-Broker","name":"fiware-sakura context broker","endpoint":"https://orion.fiware-
sakura.jp","service":"fgn","servicepath":"/sensors","idmEndpoint":"https://keyrock.fiware-
sakura.jp"},{"id":"251627e8.a926c8","type":"ui_group","name":"デフォルト
","tab":"1e2d2bae.ea9874","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"1e2d2bae.ea9874","type":"ui_tab","name":"ホーム
","icon":"dashboard","disabled":false,"hidden":false}]