Node-RED
Sanity check for Node-RED
Open at https://node-red.local
to access the Node-RED GUI.
Access Node-RED API
Access Node-RED Admin HTTP API.
Access Node-RED Admin HTTP API
Request:
curl https://node-red.local/settings
Response:
{
"httpNodeRoot": "/",
"version": "3.1.0",
"context": {
"default": "memory",
"stores": [
"memory"
]
},
"codeEditor": {
"lib": "monaco",
"options": {}
},
"markdownEditor": {
"mermaid": {
"enabled": true
}
},
"libraries": [
{
"id": "local",
"label": "editor:library.types.local",
"user": false,
"icon": "font-awesome/fa-hdd-o"
},
{
"id": "examples",
"label": "editor:library.types.examples",
"user": false,
"icon": "font-awesome/fa-life-ring",
"types": [
"flows"
],
"readOnly": true
}
],
"flowFilePretty": true,
"externalModules": {},
"flowEncryptionType": "system",
"diagnostics": {
"enabled": true,
"ui": true
},
"runtimeState": {
"enabled": false,
"ui": false
},
"functionExternalModules": true,
"functionTimeout": 0,
"tlsConfigDisableLocalFiles": false,
"editorTheme": {
"palette": {},
"projects": {
"enabled": false,
"workflow": {
"mode": "manual"
}
},
"languages": [
"de",
"en-US",
"fr",
"ja",
"ko",
"pt-BR",
"ru",
"zh-CN",
"zh-TW"
]
}
}
How to use NGSI node
Create entity
Request:
ngsi create \
--host orion.local \
entity \
--data '{"id":"device001"}' \
--keyValues
Get entity
Request:
ngsi get \
--host orion.local \
entity \
--id device001 \
--pretty
Response:
{
"id": "device001",
"type": "Thing"
}
Create flow
[{"id":"f5717ef56f6b92ee","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"d64a75632b691651","type":"NGSI Entity","z":"f5717ef56f6b92ee","openapis":"c574ed7e49fe8012","servicepath":"/","mode":"normalized","entitytype":"","attrs":"","x":410,"y":100,"wires":[["1600fecad297713b"]]},{"id":"ac8c9b2cb6a23119","type":"inject","z":"f5717ef56f6b92ee","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"device001","payloadType":"str","x":240,"y":100,"wires":[["d64a75632b691651"]]},{"id":"1600fecad297713b","type":"debug","z":"f5717ef56f6b92ee","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":590,"y":100,"wires":[]},{"id":"c574ed7e49fe8012","type":"Open APIs","name":"","brokerEndpoint":"https://orion.local","service":"","idmEndpoint":"https://orion.local","idmType":"tokenproxy"}]
Configuration for nodes
Configuration for NGSI Entity node
Add new Open APIs endpoint.
- Context Broker: Open APIs endpoint
Configuration for Context-Broker node
Set up an broker endpoint and security configuration.
- Broker Endpoint:
http://<your local IP address>:1026
Inject payload
Examples
Look at examples here.