From f275a95b52551ad08ea5a7b8f09dccb697accc04 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Mon, 17 Mar 2025 01:28:45 -0400 Subject: [PATCH] Imported weather conversions subflow from Home Assistant --- flows.json | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/flows.json b/flows.json index e0dbe1d..6d223a8 100644 --- a/flows.json +++ b/flows.json @@ -23,6 +23,40 @@ "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", @@ -104,6 +138,44 @@ "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": "a1c109993f7dd396", "type": "mqtt in",