Files
nodered-hub/flows.json
2025-03-17 01:30:02 -04:00

951 lines
25 KiB
JSON

[
{
"id": "ed4ea3c2bc13d1ec",
"type": "tab",
"label": "Weather",
"disabled": false,
"info": "",
"env": []
},
{
"id": "91324b2dbbd2a883",
"type": "tab",
"label": "Settings",
"disabled": false,
"info": "",
"env": []
},
{
"id": "50d1e20d24132c99",
"type": "tab",
"label": "Testing",
"disabled": false,
"info": "",
"env": []
},
{
"id": "4107976aa434eb03",
"type": "subflow",
"name": "Weather Conversions",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 80,
"wires": [
{
"id": "388878f6056fa3e4"
}
]
}
],
"out": [
{
"x": 500,
"y": 80,
"wires": [
{
"id": "80ce4b42b82e3c78",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#DDAA99",
"icon": "font-awesome/fa-cloud"
},
{
"id": "df425a30fbcfb2e9",
"type": "group",
"z": "ed4ea3c2bc13d1ec",
"name": "General Alerts",
"style": {
"label": true
},
"nodes": [
"7d9f24e0a78ec15c",
"7a962f9a62b1c9bd",
"f9f2f5c1415ff1be",
"6837f30909e2eb48",
"b2fd625446aad769",
"4982986ff8aefd02",
"ca5ab0add7ccdb84",
"e7c7b4fcae2ded18",
"474ea9dc63cf9b40"
],
"x": 14,
"y": 79,
"w": 1352,
"h": 202
},
{
"id": "b0521ee44dc796d1",
"type": "group",
"z": "ed4ea3c2bc13d1ec",
"name": "Defiance Alerts",
"style": {
"label": true
},
"nodes": [
"8ac36baa32177bd6",
"aa989a69868fc5fe",
"846ac653b993bbec",
"fc63778f17491208",
"404170ec56d4c845",
"15a570205c470b53",
"6d492df9348a35e9",
"ab2e9b884521285a",
"eff5cac2621c8c91",
"9151c0cd48bb3c45",
"1bbab6628566033e"
],
"x": 14,
"y": 299,
"w": 1372,
"h": 262
},
{
"id": "200f284a1171f0a8",
"type": "mqtt-broker",
"name": "",
"broker": "192.168.1.251",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "5",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "388878f6056fa3e4",
"type": "function",
"z": "4107976aa434eb03",
"name": "Conversions",
"func": "msg.data.main.temp = ((msg.data.main.temp - 273.15) * 1.8) + 32\nmsg.data.main.feels_like = ((msg.data.main.feels_like - 273.15) * 1.8) + 32\nmsg.data.main.temp_min = ((msg.data.main.temp_min - 273.15) * 1.8) + 32\nmsg.data.main.temp_max = ((msg.data.main.temp_max - 273.15) * 1.8) + 32\nmsg.data.main.pressure = msg.data.main.pressure * 0.029529983071445\nmsg.data.wind.speed = msg.data.wind.speed * 2.237\nmsg.data.wind.gust = msg.data.wind.gust * 2.237\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 190,
"y": 80,
"wires": [
[
"80ce4b42b82e3c78"
]
]
},
{
"id": "80ce4b42b82e3c78",
"type": "function",
"z": "4107976aa434eb03",
"name": "Rounding",
"func": "const temp = msg.data.main.temp\nconst feels_like = msg.data.main.feels_like\nconst temp_min = msg.data.main.temp_min\nconst temp_max = msg.data.main.temp_max\nconst pressure = msg.data.main.pressure\nconst windspeed = msg.data.wind.speed\nconst windgust = msg.data.wind.gust\n\nmsg.data.main.temp = +temp.toFixed(1)\nmsg.data.main.feels_like = +feels_like.toFixed(1)\nmsg.data.main.temp_min = +temp_min.toFixed(1)\nmsg.data.main.temp_max = +temp_max.toFixed(1)\nmsg.data.main.pressure = +pressure.toFixed(2)\nmsg.data.wind.speed = +windspeed.toFixed(2)\nmsg.data.wind.gust = +windgust.toFixed(2)\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 80,
"wires": [
[]
]
},
{
"id": "7d9f24e0a78ec15c",
"type": "http request",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "AtmosphericX",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "http://192.168.1.106:3010/api/warnings",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 320,
"y": 120,
"wires": [
[
"f9f2f5c1415ff1be"
]
]
},
{
"id": "7a962f9a62b1c9bd",
"type": "inject",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "30",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 120,
"wires": [
[
"7d9f24e0a78ec15c"
]
]
},
{
"id": "f9f2f5c1415ff1be",
"type": "function",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "Filter",
"func": "let alerts = msg.payload\n\n// Filter for Severe Thunderstorm Warnings\n\nlet ts = alerts.filter(function(alert) {\n if (alert.raw.properties &&\n alert.raw.properties.event === \"Severe Thunderstorm Warning\") {\n return true\n }\n})\n\n// Filter for Severe Thunderstorm Warnings with tornado detection\n// that have a tornado possible parameter\n\nlet tstp = alerts.filter(function(alert) {\n if (alert.raw.properties &&\n alert.raw.properties.event === \"Severe Thunderstorm Warning\" &&\n alert.raw.properties.parameters &&\n alert.raw.properties.parameters.tornadoDetection &&\n alert.raw.properties.parameters.tornadoDetection.length > 0) {\n let tornadoPossible = alert.raw.properties.parameters.tornadoDetection[0]\n return tornadoPossible === \"POSSIBLE\"\n }\n})\n\n// Filter for Tornado Warnings\n\nlet tornado = alerts.filter(function(alert) {\n if (alert.raw.properties &&\n alert.raw.properties.event === \"Tornado Warning\") {\n return true\n }\n})\n\n// If there are any alerts, return them\n\nmsg.ts = ts\nmsg.ts_count = ts.length\n\nmsg.tstp = tstp\nmsg.tstp_count = tstp.length\n\nmsg.tornado = tornado\nmsg.tornado_count = tornado.length\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 490,
"y": 120,
"wires": [
[
"b2fd625446aad769",
"4982986ff8aefd02",
"e7c7b4fcae2ded18"
]
]
},
{
"id": "6837f30909e2eb48",
"type": "mqtt out",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "",
"topic": "weather/alerts/general/severe_thunderstorm_warning/tornado_possible",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "200f284a1171f0a8",
"x": 1090,
"y": 180,
"wires": []
},
{
"id": "b2fd625446aad769",
"type": "change",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "tstp_count",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 180,
"wires": [
[
"6837f30909e2eb48"
]
]
},
{
"id": "4982986ff8aefd02",
"type": "change",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "tornado_count",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 240,
"wires": [
[
"ca5ab0add7ccdb84"
]
]
},
{
"id": "ca5ab0add7ccdb84",
"type": "mqtt out",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "",
"topic": "weather/alerts/general/tornado_warning",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "200f284a1171f0a8",
"x": 1000,
"y": 240,
"wires": []
},
{
"id": "e7c7b4fcae2ded18",
"type": "change",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "ts_count",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 120,
"wires": [
[
"474ea9dc63cf9b40"
]
]
},
{
"id": "474ea9dc63cf9b40",
"type": "mqtt out",
"z": "ed4ea3c2bc13d1ec",
"g": "df425a30fbcfb2e9",
"name": "",
"topic": "weather/alerts/general/severe_thunderstorm_warning",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "200f284a1171f0a8",
"x": 1040,
"y": 120,
"wires": []
},
{
"id": "8ac36baa32177bd6",
"type": "http request",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "Defiance County",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://api.weather.gov/alerts/active/zone/OHC039",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 300,
"y": 400,
"wires": [
[
"fc63778f17491208",
"404170ec56d4c845"
]
]
},
{
"id": "aa989a69868fc5fe",
"type": "inject",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "30",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 400,
"wires": [
[
"8ac36baa32177bd6"
]
]
},
{
"id": "846ac653b993bbec",
"type": "mqtt out",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"topic": "weather/alerts/defiance",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "200f284a1171f0a8",
"x": 730,
"y": 340,
"wires": []
},
{
"id": "fc63778f17491208",
"type": "change",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.features",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 340,
"wires": [
[
"846ac653b993bbec"
]
]
},
{
"id": "404170ec56d4c845",
"type": "function",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "Filter",
"func": "let alerts = msg.payload.features\n\n// Filter for Severe Thunderstorm Warnings\n\nlet ts = alerts.filter(function(alert) {\n if (alert.properties &&\n alert.properties.event === \"Severe Thunderstorm Warning\") {\n return true\n }\n})\n\n// Filter for Severe Thunderstorm Warnings with tornado detection\n// that have a tornado possible parameter\n\nlet tstp = alerts.filter(function(alert) {\n if (alert.properties &&\n alert.properties.event === \"Severe Thunderstorm Warning\" &&\n alert.properties.parameters &&\n alert.properties.parameters.tornadoDetection &&\n alert.properties.parameters.tornadoDetection.length > 0) {\n let tornadoPossible = alert.properties.parameters.tornadoDetection[0]\n return tornadoPossible === \"POSSIBLE\"\n }\n})\n\n// Filter for Tornado Warnings\n\nlet tornado = alerts.filter(function(alert) {\n if (alert.properties &&\n alert.properties.event === \"Tornado Warning\") {\n return true\n }\n})\n\n// If there are any alerts, return them\n\nmsg.ts = ts\nmsg.ts_count = ts.length\n\nmsg.tstp = tstp\nmsg.tstp_count = tstp.length\n\nmsg.tornado = tornado\nmsg.tornado_count = tornado.length\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 470,
"y": 400,
"wires": [
[
"eff5cac2621c8c91",
"15a570205c470b53",
"6d492df9348a35e9"
]
]
},
{
"id": "15a570205c470b53",
"type": "change",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "tstp_count",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 460,
"wires": [
[
"1bbab6628566033e"
]
]
},
{
"id": "6d492df9348a35e9",
"type": "change",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "tornado_count",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 520,
"wires": [
[
"ab2e9b884521285a"
]
]
},
{
"id": "ab2e9b884521285a",
"type": "mqtt out",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"topic": "weather/alerts/defiance/tornado_warning",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "200f284a1171f0a8",
"x": 1000,
"y": 520,
"wires": []
},
{
"id": "eff5cac2621c8c91",
"type": "change",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "ts_count",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 400,
"wires": [
[
"9151c0cd48bb3c45"
]
]
},
{
"id": "9151c0cd48bb3c45",
"type": "mqtt out",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"topic": "weather/alerts/defiance/severe_thunderstorm_warning",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "200f284a1171f0a8",
"x": 1040,
"y": 400,
"wires": []
},
{
"id": "1bbab6628566033e",
"type": "mqtt out",
"z": "ed4ea3c2bc13d1ec",
"g": "b0521ee44dc796d1",
"name": "",
"topic": "weather/alerts/defiance/severe_thunderstorm_warning/tornado_possible",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "200f284a1171f0a8",
"x": 1100,
"y": 460,
"wires": []
},
{
"id": "a1c109993f7dd396",
"type": "mqtt in",
"z": "91324b2dbbd2a883",
"name": "",
"topic": "house/time/night_mode",
"qos": "2",
"datatype": "auto-detect",
"broker": "200f284a1171f0a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 140,
"y": 60,
"wires": [
[
"0ea09d79d6de5c53"
]
]
},
{
"id": "0ea09d79d6de5c53",
"type": "change",
"z": "91324b2dbbd2a883",
"name": "",
"rules": [
{
"t": "set",
"p": "night_mode",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 60,
"wires": [
[]
]
},
{
"id": "395e101ae9c12369",
"type": "mqtt in",
"z": "91324b2dbbd2a883",
"name": "",
"topic": "house/time/give_me_darkness",
"qos": "2",
"datatype": "auto-detect",
"broker": "200f284a1171f0a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 160,
"y": 120,
"wires": [
[
"7e79da9ecd800892"
]
]
},
{
"id": "7e79da9ecd800892",
"type": "change",
"z": "91324b2dbbd2a883",
"name": "",
"rules": [
{
"t": "set",
"p": "give_me_darkness",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 120,
"wires": [
[]
]
},
{
"id": "a67eb32acf21917c",
"type": "mqtt in",
"z": "91324b2dbbd2a883",
"name": "",
"topic": "house/time/early_night_mode",
"qos": "2",
"datatype": "auto-detect",
"broker": "200f284a1171f0a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 160,
"y": 180,
"wires": [
[
"e183038952420a88"
]
]
},
{
"id": "e183038952420a88",
"type": "change",
"z": "91324b2dbbd2a883",
"name": "",
"rules": [
{
"t": "set",
"p": "early_night_mode",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 180,
"wires": [
[]
]
},
{
"id": "da24109fa6585678",
"type": "mqtt in",
"z": "91324b2dbbd2a883",
"name": "",
"topic": "house/studio/live",
"qos": "2",
"datatype": "auto-detect",
"broker": "200f284a1171f0a8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 120,
"y": 240,
"wires": [
[
"f7219402165cd674"
]
]
},
{
"id": "f7219402165cd674",
"type": "change",
"z": "91324b2dbbd2a883",
"name": "",
"rules": [
{
"t": "set",
"p": "studio_live",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 340,
"y": 240,
"wires": [
[]
]
},
{
"id": "2fe03a09d418699b",
"type": "exec",
"z": "50d1e20d24132c99",
"command": "",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 370,
"y": 180,
"wires": [
[
"652d9b04c03a88b8"
],
[
"b784a6fd67e1cac0"
],
[
"38d4b39d1405b540"
]
]
},
{
"id": "b114d9e490180bbc",
"type": "inject",
"z": "50d1e20d24132c99",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 200,
"y": 180,
"wires": [
[
"2fe03a09d418699b"
]
]
},
{
"id": "652d9b04c03a88b8",
"type": "debug",
"z": "50d1e20d24132c99",
"name": "stdout",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 530,
"y": 120,
"wires": []
},
{
"id": "b784a6fd67e1cac0",
"type": "debug",
"z": "50d1e20d24132c99",
"name": "stderr",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 530,
"y": 180,
"wires": []
},
{
"id": "38d4b39d1405b540",
"type": "debug",
"z": "50d1e20d24132c99",
"name": "return code",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 550,
"y": 240,
"wires": []
}
]