Hey All,
I'm learning how to work with JSON in Node Red and I'm trying to inject some JSON data into a web form so I can work on it from the back end.
On the inject node I'm using Inject --> JSON and I've tried a bunch of variation but nothing is working.
What I think it should be is
{ "PIRApt" : "1" }
When I try this it says it was successfully injected but I don't see anything in the debug console. What's happening?
[
{
"id": "bf688d57fb5707dd",
"type": "debug",
"z": "574d186f6c85309d",
"name": "debug 166",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 340,
"wires": []
},
{
"id": "2f5644744a11ca4c",
"type": "json",
"z": "574d186f6c85309d",
"name": "JS OBJECT",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 470,
"y": 340,
"wires": [
[
"bf688d57fb5707dd"
]
]
},
{
"id": "f3cb687d4d24761b",
"type": "ui_form",
"z": "574d186f6c85309d",
"name": "",
"label": "",
"group": "3312af4f71436b3c",
"order": 7,
"width": 0,
"height": 0,
"options": [
{
"label": "aptPIR",
"value": "aptPIR",
"type": "number",
"required": false,
"rows": null
},
{
"label": "aptBrightness",
"value": "aptBrightness",
"type": "number",
"required": false,
"rows": null
},
{
"label": "aptTimerLength",
"value": "aptTimerLength",
"type": "number",
"required": false,
"rows": null
}
],
"formValue": {
"aptPIR": "",
"aptBrightness": "",
"aptTimerLength": ""
},
"payload": "",
"submit": "submit",
"cancel": "",
"topic": "payload",
"topicType": "msg",
"splitLayout": "",
"className": "",
"x": 330,
"y": 340,
"wires": [
[
"2f5644744a11ca4c"
]
]
},
{
"id": "a0375ba6b54b914c",
"type": "inject",
"z": "574d186f6c85309d",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"aptPIR\" : \"1\"}",
"payloadType": "json",
"x": 160,
"y": 340,
"wires": [
[
"f3cb687d4d24761b"
]
]
},
{
"id": "3312af4f71436b3c",
"type": "ui_group",
"name": "JSON",
"tab": "c548a45fe690539c",
"order": 11,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "c548a45fe690539c",
"type": "ui_tab",
"name": "Home",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": true
}
]