Example for BigClout CKAN Timeseries

An example flow showing how to use Node RED CKAN Timeseries nodes to interact with CKAN Timeseries API.

A BigClout project.

[
    {
        "id": "b1ab63bc.5aa5d",
        "type": "tab",
        "label": "Flow 1"
    },
    {
        "id": "97f102ac.0ff9",
        "type": "ckants insert",
        "z": "b1ab63bc.5aa5d",
        "resourceId": "0531180e-8f9a-4b12-94a3-527881127481",
        "name": "London Air Quality - Data push",
        "auth": "c55ee6d0.e700e8",
        "x": 601.0000648498535,
        "y": 104.00000953674316,
        "wires": []
    },
    {
        "id": "3a7ffc7.518b804",
        "type": "function",
        "z": "b1ab63bc.5aa5d",
        "name": "Prep",
        "func": "\nreturn {payload: [{\n    aqi: msg.payload.data.aqi\n}]};",
        "outputs": 1,
        "noerr": 0,
        "x": 350.000057220459,
        "y": 104.40001487731934,
        "wires": [
            [
                "97f102ac.0ff9"
            ]
        ]
    },
    {
        "id": "97f023cb.c1f5a",
        "type": "http request",
        "z": "b1ab63bc.5aa5d",
        "name": "London air quality",
        "method": "GET",
        "ret": "obj",
        "url": "http://api.waqi.info/feed/london/?token=86870712e0ec68ceb467cde1ce854a55b2fc6808",
        "tls": "",
        "x": 336.00003814697266,
        "y": 41.400020599365234,
        "wires": [
            [
                "3a7ffc7.518b804"
            ]
        ]
    },
    {
        "id": "a53d7e2b.9f1bf",
        "type": "inject",
        "z": "b1ab63bc.5aa5d",
        "name": "5 min",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "300",
        "crontab": "",
        "once": false,
        "x": 117.00000381469727,
        "y": 41.39999580383301,
        "wires": [
            [
                "97f023cb.c1f5a"
            ]
        ]
    },
    {
        "id": "937db30f.b922a",
        "type": "ckants create",
        "z": "b1ab63bc.5aa5d",
        "auth": "c55ee6d0.e700e8",
        "name": "London air quality - Resource creation",
        "description": "",
        "package": "test1",
        "fields": [
            {
                "id": "aqi",
                "type": "int"
            }
        ],
        "x": 581.0000762939453,
        "y": 438.0000638961792,
        "wires": []
    },
    {
        "id": "dbdeffe3.4536d",
        "type": "ui_gauge",
        "z": "b1ab63bc.5aa5d",
        "name": "London Air Quality",
        "group": "e2c3cacf.5d0898",
        "order": 0,
        "width": "5",
        "height": "5",
        "gtype": "gage",
        "title": "London",
        "label": "AQI",
        "format": "{{value}}",
        "min": 0,
        "max": "100",
        "colors": [
            "#04b704",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 716.400016784668,
        "y": 300.8000144958496,
        "wires": []
    },
    {
        "id": "e6650540.717908",
        "type": "function",
        "z": "b1ab63bc.5aa5d",
        "name": "Numeric extract",
        "func": "\nreturn msg.payload.result.records.length > 0 ? {\n    payload: msg.payload.result.records[0].aqi \n} : null",
        "outputs": 1,
        "noerr": 0,
        "x": 504.40003967285156,
        "y": 300.80003356933594,
        "wires": [
            [
                "dbdeffe3.4536d"
            ]
        ]
    },
    {
        "id": "1f1cea2b.20ef06",
        "type": "ckants search",
        "z": "b1ab63bc.5aa5d",
        "resourceId": "0531180e-8f9a-4b12-94a3-527881127481",
        "name": "London Air Quality - Data query",
        "auth": "c55ee6d0.e700e8",
        "fromtime": "last 5m",
        "totime": "",
        "x": 524.0000114440918,
        "y": 229.00003242492676,
        "wires": [
            [
                "e6650540.717908"
            ]
        ]
    },
    {
        "id": "8bd1eecb.3586b",
        "type": "function",
        "z": "b1ab63bc.5aa5d",
        "name": "Prep",
        "func": "\nreturn {payload: {\n    limit: 1\n}};",
        "outputs": 1,
        "noerr": 0,
        "x": 271.00000762939453,
        "y": 229.00000858306885,
        "wires": [
            [
                "1f1cea2b.20ef06"
            ]
        ]
    },
    {
        "id": "d223273f.8451b8",
        "type": "inject",
        "z": "b1ab63bc.5aa5d",
        "name": "3 min",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "180",
        "crontab": "",
        "once": false,
        "x": 115.00000762939453,
        "y": 229.00000286102295,
        "wires": [
            [
                "8bd1eecb.3586b"
            ]
        ]
    },
    {
        "id": "c55ee6d0.e700e8",
        "type": "ckants-credentials",
        "z": "",
        "ckan": "http://bigclout.lancaster.ac.uk/",
        "name": "bigclout"
    },
    {
        "id": "e2c3cacf.5d0898",
        "type": "ui_group",
        "z": "",
        "name": "Air Quality",
        "tab": "5adf6470.632b2c",
        "disp": true,
        "width": "5"
    },
    {
        "id": "5adf6470.632b2c",
        "type": "ui_tab",
        "z": "",
        "name": "Home",
        "icon": "dashboard"
    }
]
namgk

Flow Info

created 1 month ago

Node Types

Core
  • function (x3)
  • http request (x1)
  • inject (x2)
Other

Tags

  • bigclout
  • ckan
  • ckan-timeseries
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option