I'm brand new to Node Red, please be patient with my question. I've seached forums, watched Youtube and tried my best to answer this for myself, but I still can't make it happen...so here's my issues.
I want to get the latest value from the following website (https://services.swpc.noaa.gov/json/boulder_k_index_1m.json)
I am using what appears to be 'nested' json data from the following . I noticed the ' [{ ' which is unlike the tutorials I've been through. I'm stuck because I have to run it through two JSON parsers to even get close to a clean debugging output.
I would also like to only return the last "kp_index" value. Any help would be appreciated.
My Node Red output code:
[
{
"id": "61bca993f8e4f577",
"type": "tab",
"label": "Space Weather",
"disabled": false,
"info": ""
},
{
"id": "23fa9e5c20f7fab1",
"type": "inject",
"z": "61bca993f8e4f577",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 60,
"wires": [
[
"00fcc86b1508649b"
]
]
},
{
"id": "00fcc86b1508649b",
"type": "http request",
"z": "61bca993f8e4f577",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://services.swpc.noaa.gov/json/boulder_k_index_1m.json",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 250,
"y": 140,
"wires": [
[
"26baeac30c05e8dd"
]
]
},
{
"id": "26baeac30c05e8dd",
"type": "json",
"z": "61bca993f8e4f577",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 300,
"y": 240,
"wires": [
[
"d8db3d11efdb2225"
]
]
},
{
"id": "7475d16e4676eef7",
"type": "debug",
"z": "61bca993f8e4f577",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 320,
"wires": []
},
{
"id": "d8db3d11efdb2225",
"type": "json",
"z": "61bca993f8e4f577",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 400,
"y": 320,
"wires": [
[
"551d794917251537"
]
]
},
{
"id": "551d794917251537",
"type": "function",
"z": "61bca993f8e4f577",
"name": "",
"func": "\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 400,
"wires": [
[
"7475d16e4676eef7"
]
]
}
]