[
[
{
"id": "108683a5.96fe7c",
"type": "http in",
"z": "90eed96b.104358",
"name": "Tasker GPS",
"url": "/tracker",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 90,
"y": 320,
"wires": [
[
"4fcbbb18.41dda4",
"263e4ef8.b90f12",
"39d79a78.eecad6"
]
]
},
{
"id": "236be463.cb01fc",
"type": "http request",
"z": "90eed96b.104358",
"name": "",
"method": "GET",
"ret": "txt",
"url": "",
"tls": "",
"x": 720,
"y": 320,
"wires": [
[
"cdbd5286.95134"
]
]
},
{
"id": "cdbd5286.95134",
"type": "debug",
"z": "90eed96b.104358",
"name": "GPS请求输出",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 900,
"y": 320,
"wires": []
},
{
"id": "a13e87e7.dbcb68",
"type": "function",
"z": "90eed96b.104358",
"name": "构造GPS请求",
"func": "const device = 'mix2'\nconst lat = msg.lat\nconst lon = msg.lon\nreturn {\n url:`https://ha:8123/api/gpslogger?device=${device}&latitude=${lat}&longitude=${lon}&accuracy=0&battery=100`\n}",
"outputs": 1,
"noerr": 0,
"x": 540,
"y": 320,
"wires": [
[
"236be463.cb01fc"
]
]
},
{
"id": "263e4ef8.b90f12",
"type": "debug",
"z": "90eed96b.104358",
"name": "GPS请求输入",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 340,
"y": 240,
"wires": []
},
{
"id": "4fcbbb18.41dda4",
"type": "function",
"z": "90eed96b.104358",
"name": "解析GPS数据",
"func": "const gps = msg.payload.gps.split(',')\nconst lat = gps[0]\nconst lon = gps[1]\nreturn {lat,lon}",
"outputs": 1,
"noerr": 0,
"x": 340,
"y": 320,
"wires": [
[
"a13e87e7.dbcb68"
]
]
},
{
"id": "39d79a78.eecad6",
"type": "http response",
"z": "90eed96b.104358",
"name": "响应请求",
"statusCode": "",
"headers": {},
"x": 320,
"y": 280,
"wires": []
}
]
]