Any assistance would be appreicated in getting this to work...my apologies if the post is not well formatted, I don't do a lot of forum posting
I have an HTTP API request that is working fine. I see all of the data which results in multiple arrays with multiple objects. However, after banging my head against the desk for several days, I'm reaching out for help. I want to do several things to "filter" the data before I send it to WLED (which I am quite capable of doing), but I need help with the filtering of the data first...
- Filter all resulting HTTP API data to only result in 'spotTime' is within the last 10 minutes.
- 'locationDesc' begins with "US-"
- Unique concatinated values ('mode' + 'locationDesc' [state only]). Example: SSB-FL
In the event that locationDesc has multiple states, then just the first is fine.
I am not planning on taking this into a dashboard, but rather sending to some WLED nodes to drive leds.
Here is my code:
[
{
"id": "09cc162097157e73",
"type": "tab",
"label": "Spots",
"disabled": false,
"info": "",
"env":
},
{
"id": "4b76beb994c633eb",
"type": "inject",
"z": "09cc162097157e73",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 120,
"y": 60,
"wires": [
[
"c9bea5d026895da8"
]
]
},
{
"id": "c9bea5d026895da8",
"type": "http request",
"z": "09cc162097157e73",
"name": "spot request",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.pota.app/spot/activator",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": ,
"x": 290,
"y": 60,
"wires": [
[
"3476258e1dfaf73f"
]
]
},
{
"id": "3476258e1dfaf73f",
"type": "debug",
"z": "09cc162097157e73",
"name": "debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 450,
"y": 60,
"wires":
}
]