This does not work as intended.
As long as I keep giving one type of input (say city/ country), it works. But, when I change the input type to (lat/ lon), the OpenWeather API keeps getting the last inputs from the previous input type.
[
{
"id": "b9a073da.96b51",
"type": "ui_button",
"z": "58e87bcc.806654",
"name": "",
"group": "4f271a00.762388",
"order": 0,
"width": 0,
"height": 0,
"passthru": false,
"label": "Submit",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "true",
"payloadType": "bool",
"topic": "",
"topicType": "str",
"x": 120,
"y": 900,
"wires": [
[
"3bff49e4.cede06"
]
]
},
{
"id": "880489b6.8264e8",
"type": "ui_button",
"z": "58e87bcc.806654",
"name": "",
"group": "212c669d.fce9ba",
"order": 4,
"width": "6",
"height": "1",
"passthru": false,
"label": "Submit",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "true",
"payloadType": "bool",
"topic": "",
"x": 120,
"y": 1100,
"wires": [
[
"e4190363.4d1d7"
]
]
},
{
"id": "3bff49e4.cede06",
"type": "function",
"z": "58e87bcc.806654",
"name": "",
"func": "if(msg.payload){\n return{\n location : {\n country : flow.get(\"country\"),\n city : flow.get(\"city\")\n }\n }\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 240,
"y": 840,
"wires": [
[
"51c93547576fdd44"
]
]
},
{
"id": "e4190363.4d1d7",
"type": "function",
"z": "58e87bcc.806654",
"name": "",
"func": "if(msg.payload){\n return{\n location : {\n lat : flow.get(\"lat\"),\n lon : flow.get(\"lon\")\n }\n }\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 260,
"y": 1100,
"wires": [
[
"51c93547576fdd44"
]
]
},
{
"id": "51c93547576fdd44",
"type": "trigger",
"z": "58e87bcc.806654",
"name": "",
"op1": "stop",
"op2": "",
"op1type": "str",
"op2type": "payl",
"duration": "50",
"extend": false,
"overrideDelay": false,
"units": "ms",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 210,
"y": 980,
"wires": [
[
"f5ac289be727292e"
]
]
},
{
"id": "f5ac289be727292e",
"type": "trigger",
"z": "58e87bcc.806654",
"name": "",
"op1": "",
"op2": "0",
"op1type": "pay",
"op2type": "str",
"duration": "-15",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "stop",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 410,
"y": 900,
"wires": [
[
"f185e542.8805d8"
]
]
},
{
"id": "f185e542.8805d8",
"type": "openweathermap",
"z": "58e87bcc.806654",
"name": "",
"wtype": "current",
"lon": "",
"lat": "",
"city": "",
"country": "",
"language": "en",
"credentials": {},
"x": 650,
"y": 900,
"wires": [
[
"b40b4212.24744",
"2a93c6c.1de5b3a",
"f1e080e1.05dd7",
"49e145d4.08f73c",
"185166fe.2e4809",
"b9e23bd0.ea7e08",
"901e6ec.4740a9",
"805abd3a.ac498",
"dd02eca8.d6e4f",
"8625b310c621b660",
"11219d2e62e0dbf6",
"9446411facaa23a2",
"cc7905cae328210c"
]
]
},
{
"id": "cc7905cae328210c",
"type": "debug",
"z": "58e87bcc.806654",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 700,
"y": 780,
"wires": []
},
{
"id": "4f271a00.762388",
"type": "ui_group",
"name": "Input city/country",
"tab": "152c952d.14cc0b",
"order": 1,
"disp": true,
"width": "5",
"collapse": false
},
{
"id": "212c669d.fce9ba",
"type": "ui_group",
"name": "Input latitude/longitude",
"tab": "152c952d.14cc0b",
"order": 2,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "152c952d.14cc0b",
"type": "ui_tab",
"name": "Weather",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]