[
{
"id": "b45146a810171392",
"type": "inject",
"z": "18a6ff3f97d0870e",
"name": "",
"props": [
{
"p": "timestamp",
"v": "",
"vt": "date"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "3600",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 430,
"y": 2780,
"wires": [
[
"27fccc2cab4e22b8"
]
]
},
{
"id": "d4f68a3ce7fca3ce",
"type": "debug",
"z": "18a6ff3f97d0870e",
"name": "debug 16",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "SRE_Event",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1340,
"y": 2780,
"wires": []
},
{
"id": "27fccc2cab4e22b8",
"type": "http request",
"z": "18a6ff3f97d0870e",
"name": "",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://atlas.microsoft.com/weather/currentConditions/json?api-version=1.0&query=47.60357,-122.32945&subscription-key=7KtFD0f7uB6C6Mo7Cq3XXXXXXXXXXXXXXXXXXXXXXV1iE0A1JQQJ99AIAC8vTInGlVfjAAAgAZMPvOZv",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "Content-Type",
"keyValue": "",
"valueType": "application/json",
"valueValue": ""
}
],
"x": 630,
"y": 2780,
"wires": [
[
"3ed88f69160a5794",
"5dd1dea98a797ebc",
"27bed8caabdd785d"
]
]
},
{
"id": "113a9639bddb4196",
"type": "function",
"z": "18a6ff3f97d0870e",
"name": "Check Precipitation",
"func": "//$PROMPT: Write a function that checks if precipitation value is greater than 25 which will set SRE_Event = True if no Sre Event = False {\"value\":0,\"unit\":\"mm\",\"unitType\":3}\nconst precipitation = msg.payload\n\nif (precipitation > 25) {\n msg.SRE_Event = true\n} else {\n msg.SRE_Event = false\n}\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1090,
"y": 2780,
"wires": [
[
"d4f68a3ce7fca3ce"
]
]
},
{
"id": "3ed88f69160a5794",
"type": "change",
"z": "18a6ff3f97d0870e",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.results[0].precipitationSummary.past24Hours",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 820,
"y": 2780,
"wires": [
[
"113a9639bddb4196",
"6247442d46094351"
]
]
},
{
"id": "6247442d46094351",
"type": "debug",
"z": "18a6ff3f97d0870e",
"name": "debug 17",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1040,
"y": 2840,
"wires": []
},
{
"id": "5dd1dea98a797ebc",
"type": "debug",
"z": "18a6ff3f97d0870e",
"name": "debug 18",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 880,
"y": 2700,
"wires": []
},
{
"id": "c6fdce1d28345bc2",
"type": "debug",
"z": "18a6ff3f97d0870e",
"name": "debug 19",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1200,
"y": 2880,
"wires": []
},
{
"id": "27bed8caabdd785d",
"type": "change",
"z": "18a6ff3f97d0870e",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.results[0].precipitationSummary.pastHour",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 820,
"y": 2880,
"wires": [
[
"113a9639bddb4196",
"c6fdce1d28345bc2"
]
]
}
]