NodeRed connection with ThingSpeak

Hello everyone,
first time i ever use NodeRed, excited to learn a lot!!
I am dealing with a problem : i don't know how to connect NodeRed to ThingSpeak.
I was wondering how could i connect my data from a weather site called OpenWeather to ThingSpeak by using NodeRed.
Can someone help me, i only need the temperature in celsius and the humidity, so i can see them in a graph on ThingSpeak.
Ps i get a message that says i have some problems with topic, but i am not sure what it means.
Thanks everyone in advice for every answers!!!

[
    {
        "id": "ce707e2a.1bdcd",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "359ed0a8.9914a",
        "type": "inject",
        "z": "ce707e2a.1bdcd",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 80,
        "y": 460,
        "wires": [
            [
                "9f0202ae.02267"
            ]
        ]
    },
    {
        "id": "96b8784a.4a9668",
        "type": "debug",
        "z": "ce707e2a.1bdcd",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload.main.temp",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 810,
        "y": 440,
        "wires": []
    },
    {
        "id": "23e9e465.eb9a5c",
        "type": "http request",
        "z": "ce707e2a.1bdcd",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 410,
        "y": 460,
        "wires": [
            [
                "32ba6850.0d49d8"
            ]
        ]
    },
    {
        "id": "9f0202ae.02267",
        "type": "function",
        "z": "ce707e2a.1bdcd",
        "name": "",
        "func": "var OWM_KEY = \"172fd3363fd5a7a03ca9dd257d247fa1\";\nmsg.url = \"api.openweathermap.org/data/2.5/weather?q=Milan,it&APPID=\" + OWM_KEY + \"&units=metric\";\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 260,
        "y": 460,
        "wires": [
            [
                "23e9e465.eb9a5c"
            ]
        ]
    },
    {
        "id": "32ba6850.0d49d8",
        "type": "json",
        "z": "ce707e2a.1bdcd",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 570,
        "y": 460,
        "wires": [
            [
                "bcff9dac.d8896",
                "96b8784a.4a9668",
                "4c3def9f.e4ecf"
            ]
        ]
    },
    {
        "id": "bcff9dac.d8896",
        "type": "debug",
        "z": "ce707e2a.1bdcd",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload.main.humidity",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 820,
        "y": 500,
        "wires": []
    },
    {
        "id": "4c3def9f.e4ecf",
        "type": "mqtt out",
        "z": "ce707e2a.1bdcd",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "broker": "bdac2723.67a868",
        "x": 590,
        "y": 660,
        "wires": []
    },
    {
        "id": "bdac2723.67a868",
        "type": "mqtt-broker",
        "name": "ThingSpeak MQTT Broker",
        "broker": "mqtt.thingspeak.com",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": false,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    }
]

You need to add a mqtt topic to the mqtt out node, The Thingspeak forum is probably the place to ask for this.
Or this may help

You also do not require the json node as the http request node can be set to output a parsed json object
e.g.

[{"id":"359ed0a8.9914a","type":"inject","z":"ce707e2a.1bdcd","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":460,"wires":[["5135f05b.d2bf7"]]},{"id":"5135f05b.d2bf7","type":"change","z":"ce707e2a.1bdcd","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"api.openweathermap.org/data/2.5/weather?q=Milan,it&APPID=172fd3363fd5a7a03ca9dd257d247fa1&units=metric","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":400,"wires":[["23e9e465.eb9a5c"]]},{"id":"23e9e465.eb9a5c","type":"http request","z":"ce707e2a.1bdcd","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":420,"y":460,"wires":[["87c3eed6.53da98"]]},{"id":"87c3eed6.53da98","type":"change","z":"ce707e2a.1bdcd","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"hold","tot":"msg"},{"t":"set","p":"payload.temp","pt":"msg","to":"hold.main.temp","tot":"msg"},{"t":"set","p":"payload.humidity","pt":"msg","to":"hold.main.humidity","tot":"msg"},{"t":"delete","p":"hold","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":460,"wires":[["76873006.c28d08","4c3def9f.e4ecf"]]},{"id":"76873006.c28d08","type":"debug","z":"ce707e2a.1bdcd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":520,"wires":[]},{"id":"4c3def9f.e4ecf","type":"mqtt out","z":"ce707e2a.1bdcd","name":"","topic":"","qos":"","retain":"","broker":"bdac2723.67a868","x":590,"y":580,"wires":[]},{"id":"bdac2723.67a868","type":"mqtt-broker","name":"ThingSpeak MQTT Broker","broker":"mqtt.thingspeak.com","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

You just need to figure out the mqtt topic to send the data to Thingspeak.
Also you will need to change your API key as anyone on the internet now has access to your Openweather API

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.