WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Problemlösungen und Hinweise von allgemeinem Interesse zur Haussteuerung mit HomeMatic

Moderator: Co-Administratoren

wolwin
Beiträge: 30
Registriert: 06.06.2018, 12:27

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von wolwin » 06.01.2019, 20:17

Hallo zusammen,
ich habe die Weihnachtszeit genutzt und einmal Teile meiner 'beginnenden Hausautomation' auf Github veröffentlicht. Auslöser war der Bau des 'Weatherman' von Eugen - und eigentlich wollte ich ja nur den Garten bewässern :lol: aber dann hat mich dieses tolle Projekt der Wetterstation im Rahmen einer Hausautomation gepackt!
Nach langen Versuchen und mehreren unterschiedlichen Anläufen, wie meine HM denn nun aussehen soll, war klar: keine Cloud, (möglichst) keine (Protokoll-) Abhängigkeiten von einzelnen Herstellern, interne Daten bleiben intern, usw. - da bleibt dann nicht mehr viel übrig! Entschieden habe ich mich, modular vorzugehen - als Austauschprotokoll werde ich (möglichst) MQTT einsetzen - das ganze mit FHEM als Kontrollinstanz … bleibt noch die Problematik mit der Visualisierung und Bedienbarkeit der HM (manche nennen es auch den WAF-Faktor :wink: ).
Ja, und dann habe ich node-RED kennengelernt (die CT hat in der aktuellen Ausgabe einen guten Artikel über node-RED !!) - da dem Weatherman (aus verständlichen Gründen) ein MQTT Interface fehlt, habe ich jetzt ein universell konfigurierbares Node-RED Modul für den Weatherman geschrieben, dass nicht nur die Daten des WM entgegen nimmt (im CCU-Modus), sondern sie auch in eine SQL-Datenbank abspeichern kann und sie per MQTT weitergibt. Dabei ist es dann nicht geblieben: der Feinstaub-Sensor von 'www.luftdaten.info' wurde ebenfalls in node-RED integriert. Ausführliche Details könnt ihr hier sehen:

https://github.com/wolwin/WW-myHOME/tre ... Weatherman

Die GUI-Oberfläche sieht so aus:
NodeRED_GUI_Weatherman_1.0.jpg
Außerdem haben mich die unterschiedlichen Messwerte des BME in Feinstaub und WM gestört - das V1-Wetterschutzgehäuse des WM und mein 'Blumentopf-Selbstbau' wiesen unterschiedliche Werte bei Temperatur und Luftfeuchte aus - mein Beitrag dazu siehe hier:

posting.php?mode=edit&f=31&p=460542

Daher habe ich das V2-Wetterschutzgehäuse von Eugen als Vorlage genommen, und versucht, es weiterzuentwickeln - meine Recherchen im Netz ergaben das Zauberwort 'Belüftung der Sensorkammer'. Ihr könnt die STL Entwürfe dazu ebenfalls auf Github ('WW-myHOME / myHOME - Hardware') finden und selber nachdrucken - es gibt dort eine 'einfache' und eine 'erweiterte' Version (z.Z. im Testbetrieb) - eine 'extended' Version mit Lüfter ist in der Entwicklung.
UWK_301.jpg
UWK_301.jpg (41.29 KiB) 358 mal betrachtet
UWK_302.jpg
UWK_302.jpg (29.79 KiB) 358 mal betrachtet
So, nun viel Spaß beim Stöbern und lesen …

Gruß
Wolfram
Zuletzt geändert von wolwin am 07.01.2019, 00:18, insgesamt 1-mal geändert.

dondaik
Beiträge: 9349
Registriert: 16.01.2009, 18:48
Wohnort: Steingaden

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von dondaik » 06.01.2019, 23:12

sehr schön !
-------
wer schreibfehler findet darf sie behalten.

shooter
Beiträge: 22
Registriert: 04.09.2018, 18:41

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von shooter » 07.01.2019, 08:49

Hallo, wirf mal einen Blick in die Bauanleitung des Rainyman, da ist das besser erklärt mit der Halterung. Das 2. Loch ist für den NTC (Sonnensensor - auch wenn das wohl beim Weatherman ein anderer ist).
DANKE! Das war genau was ich gesucht habe.

Ich wollte hier nicht rummeckern sonder es ging um Hilfestellung beim Zusammenbau!

Der Halter für den Sensor hat nämlich zwei Löcher, und ich wüsste gern wie der Positioniert werden muss, das steht in der Rainyman Anleitung!

Hintergrund ist der, das mein BH1750 Werte im unteren Hunderter-Bereich anzeigt...das lieg dann jetzt daran das der Sensor nicht korrekt positioniert ist...

Mehr wollte ich garnicht wissen.

Gruß,

Flo

Hypnos
Beiträge: 107
Registriert: 06.01.2018, 12:48

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von Hypnos » 07.01.2019, 21:12

Hallo
wenn es noch nicht bekannt ist. Mit dem RedMatic Addon für die CCU3 oder RaspberryMatic bekommt man Node-RED direkt auf die CCU.

Ich habe den WEATHERMAN auch darüber direkt angebunden.
Mosquito gibt es ebenfalls als CCU Addon.


Damit kann man den WEATHERMAN auch direkt an MQTT anbinden ohne irgendwelche extra Hardware oder Software (von den beiden Addons abgesehen).

Gruß

Benutzeravatar
funkleuchtturm
Beiträge: 1427
Registriert: 13.06.2011, 16:42
Kontaktdaten:

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von funkleuchtturm » 07.01.2019, 22:33

Hypnos hat geschrieben:
07.01.2019, 21:12
Damit kann man den WEATHERMAN auch direkt an MQTT anbinden ohne irgendwelche extra Hardware oder Software (von den beiden Addons abgesehen).
Wäre schön, wenn Du das genauer (Kochrezept :D ) beschreiben könntest.
Viele Gruesse
Eugen
________________________________________________
Homematic-CCU2-Eintopf mit feinem Homeduino-Gemüse
... und für Feinschmecker gibt´s den WIFFI, den WEATHERMAN, den RAINYMAN und den PULSECOUNTER
mit vielen Kochrezepten für den ambitionierten Homematiker

Hypnos
Beiträge: 107
Registriert: 06.01.2018, 12:48

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von Hypnos » 08.01.2019, 01:03

funkleuchtturm hat geschrieben:
07.01.2019, 22:33
Hypnos hat geschrieben:
07.01.2019, 21:12
Damit kann man den WEATHERMAN auch direkt an MQTT anbinden ohne irgendwelche extra Hardware oder Software (von den beiden Addons abgesehen).
Wäre schön, wenn Du das genauer (Kochrezept :D ) beschreiben könntest.
kein Problem

Schritt 1, man installiert das Redmatic Addon.
Schritt 2, man installiert mosquitto Addon.
Schritt 2a, Aufruf der Redmatic-Seite mit http://<ccu3_ip>/addons/red/
Schritt 3, in Redmatic stellt man den MQTT Broker ein (entfällt, wenn man den Flow von mir unten importiert, sonst einen MQTT node in einen Flow ziehen, Doppelklichen und das Stift-Button neben dem Eintrag " Server"--> "Add net MQTT Broker...")
Screenshot 2019-01-08 at 00.42.49.png
Schritt 4, man stellt den Weatherman so ain, das er die Daten an die CCU als JSON sendet.
Screenshot 2019-01-08 at 00.44.24.png
Schritt 5, man erstellt sich einen Flow, der das über MQTT published.
Dazu kann man auch den code von mir unten in Redmatic importieren, indem man im Menü den Punkt "Import"--> "Clipboard" aufruft. Danach unter "new flow" den Code am Ende des Beitrages einfügen und mit "import" abspeichern!
Nicht vergessen Änderungen zu deployen. Nur dadurch werden diese aktiv und gespeichert.

Zum letzten Schritt kann man die Lösung von Sineos nutzen, oder meine Variante.

Meine Variante unterscheidet sich in folgenden Punkten:

Ich nutze die im Weatherman hinterlegten Variablennamen und nicht die Variablen Nummern und bin damit von Veränderungen bei Software updates unabhängig.

Außerdem fügt meine Variante noch zu den folgenden Variablen noch den Wert in km/h hinzu:
"w_wind_spitze" --> "w_wind_spitze_km_h"
"w_windstaerke" --> "w_windstaerke_km_"
"w_wind_mittel" --> "w_wind_mittel_km_h"

Von dem Wert "w_wind_mittel" wird noch der Wert nach Beaufort als "w_wind_beaufort" und "w_wind_bezeichnung" ermittelt.

Hier die Lösung zum Import in RedMatic:
Screenshot 2019-01-08 at 00.57.00.png

Code: Alles auswählen

[{"id":"37398772.8eff58","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"7ab160bf.078c5","type":"tcp in","z":"37398772.8eff58","name":"","server":"server","host":"","port":"8186","datamode":"single","datatype":"utf8","newline":"","topic":"","base64":false,"x":120,"y":90,"wires":[["295deaca.80f9c6"]]},{"id":"295deaca.80f9c6","type":"function","z":"37398772.8eff58","name":"Parse JSON","func":"// customize baspath for the topic\nlet basePath = '/weatherman/status/';\n\nlet myJSON = msg.payload;\n\n// Regex to match the unicode characters for EOT\nlet grepEOT = /(.*)(\\u0003|\\u0004)/;\nlet match = grepEOT.exec(myJSON);\n\n// String contains EOT, should be complete\nif (match !== null) {\n    // Try to parse JSON and validate object\n    let myJSONObj = JSON.parse(match[1]);\n    if (myJSONObj && typeof myJSONObj === 'object') {\n        msg.payload = {\n            modultyp: myJSONObj.modultyp,\n            data : {},\n            values : {},\n            Systeminfo : myJSONObj.Systeminfo\n        };\n\n        let myTime = new Date();\n        msg.timestamp = myTime.toLocaleString();\n        msg.topic = basePath;\n        myJSONObj.vars.forEach(function(item, index, array) {\n        if (item.homematic_name) {\n            msg.payload.data[item.homematic_name] = item;\n            msg.payload.data[item.homematic_name].id = index;\n            msg.payload.values[item.homematic_name] = item.value;\n        } else {\n            msg.payload.data['data' + item.name] = item;\n        }\n    });\n\n    if (msg.payload.values.w_wind_spitze) {\n        let val = Number(msg.payload.values.w_wind_spitze) * 3.6;\n        msg.payload.values.w_wind_spitze_km_h = Math.round(val * 100) / 100;\n        msg.payload.data.w_wind_spitze_km_h = {\n            name    : 925,\n            homematic_name  : \"w_wind_spitze_km_h\",\n            desc    : \"peak_windgeschwindigkeit km/h\",\n            type    : \"number\",\n            unit    : \"km/h\",\n            value   : msg.payload.values.w_wind_spitze_km_h\n        };\n    }\n\n    if (msg.payload.values.w_windstaerke) {\n        let val = Number(msg.payload.values.w_windstaerke) * 3.6;\n        msg.payload.values.w_windstaerke_km_h = Math.round(val * 100) / 100;\n        msg.payload.data.w_windstaerke_km_h = {\n            name    : 926,\n            homematic_name  : \"w_windstaerke_km_h\",\n            desc    : \"bft_windgeschwindigkeit km/h\",\n            type    : \"number\",\n            unit    : \"km/h\",\n            value   : msg.payload.values.w_windstaerke_km_h\n        };\n    }\n    if (msg.payload.values.w_wind_mittel) {\n        let val = Number(msg.payload.values.w_wind_mittel) * 3.6;\n        msg.payload.values.w_wind_mittel_km_h = Math.round(val * 100) / 100;\n        msg.payload.data.w_wind_mittel_km_h = {\n            name    : 927,\n            homematic_name  : \"w_wind_mittel_km_h\",\n            desc    : \"avg_windgeschwindigkeit km/h\",\n            type    : \"number\",\n            unit    : \"km/h\",\n            value   : msg.payload.values.w_wind_mittel_km_h\n        };\n        if (msg.payload.values.w_wind_mittel < 0.3) {\n            msg.payload.values.w_wind_bezeichnung = \"Windstille\";\n            msg.payload.values.w_wind_beaufort = 0;\n        } else if (msg.payload.values.w_wind_mittel < 1.5) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwacher Wind\";\n            msg.payload.values.w_wind_beaufort = 1;\n        } else if (msg.payload.values.w_wind_mittel < 3.3) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwacher Wind\";\n            msg.payload.values.w_wind_beaufort = 2;\n        } else if (msg.payload.values.w_wind_mittel < 5.4) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwacher Wind\";\n            msg.payload.values.w_wind_beaufort = 3;\n        } else if (msg.payload.values.w_wind_mittel < 7.9) {\n            msg.payload.values.w_wind_bezeichnung = \"Mäßiger Wind\";\n            msg.payload.values.w_wind_beaufort = 4;\n        } else if (msg.payload.values.w_wind_mittel < 10.7) {\n            msg.payload.values.w_wind_bezeichnung = \"Frischer Wind\";\n            msg.payload.values.w_wind_beaufort = 5;\n        } else if (msg.payload.values.w_wind_mittel < 13.8) {\n            msg.payload.values.w_wind_bezeichnung = \"Starker Wind\";\n            msg.payload.values.w_wind_beaufort = 6;\n        } else if (msg.payload.values.w_wind_mittel < 17.1) {\n            msg.payload.values.w_wind_bezeichnung = \"Windstille\";\n            msg.payload.values.w_wind_beaufort = 7;\n        } else if (msg.payload.values.w_wind_mittel < 20,7) {\n            msg.payload.values.w_wind_bezeichnung = \"Steifer Wind\";\n            msg.payload.values.w_wind_beaufort = 8;\n        } else if (msg.payload.values.w_wind_mittel < 24,4) {\n            msg.payload.values.w_wind_bezeichnung = \"Stürmischer Wind\";\n            msg.payload.values.w_wind_beaufort = 9;\n        } else if (msg.payload.values.w_wind_mittel < 28,4) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwerer Sturm\";\n            msg.payload.values.w_wind_beaufort = 10;\n        } else if (msg.payload.values.w_wind_mittel < 32,6) {\n            msg.payload.values.w_wind_bezeichnung = \"Orkanartiger Sturm\";\n            msg.payload.values.w_wind_beaufort = 11;\n        } else { //über 32,7\n            msg.payload.values.w_wind_bezeichnung = \"Orkan\";\n            msg.payload.values.w_wind_beaufort = 12;\n        }        \n        msg.payload.data.w_wind_bezeichnung = {\n            name    : 928,\n            homematic_name  : \"w_wind_bezeichnung\",\n            desc    : \"Bezeichnung der Windstärke (Beaufort)\",\n            type    : \"string\",\n            unit    : \"\",\n            value   : msg.payload.values.w_wind_bezeichnung\n        };\n        msg.payload.data.w_wind_beaufort = {\n            name    : 929,\n            homematic_name  : \"w_wind_beaufort\",\n            desc    : \"Windstärke (Beaufort)\",\n            type    : \"number\",\n            unit    : \"Bft\",\n            value   : msg.payload.values.w_wind_beaufort\n        };\n    }\n\n    return msg;\n  } else {\n    node.error('Weatherman: Incomplete or corrupt JSON received', msg);\n  }\n// No EOT found or parse error. Possibly trunctuated / corrupt message\n} else {\n  node.error('Weatherman: Incomplete or corrupt JSON received', msg);\n}\n","outputs":1,"noerr":0,"x":310,"y":90,"wires":[["c8dd7eb9.eb7dd","da5fc697.fd2968"]]},{"id":"365a6c05.4d5d04","type":"comment","z":"37398772.8eff58","name":"Weatherman","info":"","x":100,"y":40,"wires":[]},{"id":"c8dd7eb9.eb7dd","type":"change","z":"37398772.8eff58","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"wm","tot":"str"},{"t":"delete","p":"payload.data","pt":"msg"},{"t":"delete","p":"payload.values.w_ip","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":90,"wires":[["aed867ee.695d88"]]},{"id":"da5fc697.fd2968","type":"debug","z":"37398772.8eff58","name":"WEATHERMAN-Data","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":550,"y":140,"wires":[]},{"id":"b1382945.e023b8","type":"mqtt out","z":"37398772.8eff58","name":"","topic":"","qos":"0","retain":"false","broker":"ad1f3a00.8fd8f8","x":1100,"y":90,"wires":[]},{"id":"aed867ee.695d88","type":"function","z":"37398772.8eff58","name":"prepare","func":"  if (msg.payload && (typeof(msg.payload) === 'object')) {\n    workOn(msg.payload, msg.topic);\n    return null;\n  }\n  \n  return msg;\n  \n  function workOn(obj, topic) {\n    Object.keys(obj).forEach(function(key) {\n        if (obj[key] != null && typeof(obj[key]) === 'object') {\n            workOn(obj[key], topic + '/' + key);\n        } else {\n            doSend(obj[key], topic + '/' + key);\n        }        \n      });\n  }\n  \n  function doSend(obj, topic) {\n    if (obj instanceof Date) {\n        obj = obj.toISOString();\n    }\n    if( typeof obj === 'undefined' || obj == null || typeof(obj) == 'function' ) {\n          return;\n    }\n    let msgNew = {\n        topic : topic,\n        payload : obj, //String(obj),\n        qos : msg.qos,\n        retain : msg.retain\n    }\n    node.send(msgNew);\n  }","outputs":1,"noerr":0,"x":730,"y":90,"wires":[["5c346688.4c1b78"]]},{"id":"5c346688.4c1b78","type":"delay","z":"37398772.8eff58","name":"","pauseType":"queue","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"second","randomFirst":"1","randomLast":"5000","randomUnits":"milliseconds","drop":true,"x":920,"y":90,"wires":[["b1382945.e023b8"]]},{"id":"ad1f3a00.8fd8f8","type":"mqtt-broker","z":"","name":"Mosquitto","broker":"localhost","port":"1883","clientid":"ccu","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"ccu/system/connection","birthQos":"0","birthRetain":"false","birthPayload":"start","closeTopic":"ccu/system/connection","closeQos":"0","closeRetain":"false","closePayload":"end","willTopic":"ccu/system/connection","willQos":"0","willPayload":"end unexpected"}]
Wer das ganze in RedMatic selbst verwenden will, Beispielsweise wieder in Systemvariablken der CCU schreiben kann diese Komplete Lösung nehmen:
Screenshot 2019-01-08 at 00.41.10.png

Code: Alles auswählen

[{"id":"cdaea329.3cf46","type":"subflow","name":"send MQTT","info":"","in":[{"x":60,"y":40,"wires":[{"id":"91fadaca.0a2788"}]}],"out":[]},{"id":"f6454355.0b87","type":"mqtt out","z":"cdaea329.3cf46","name":"","topic":"","qos":"0","retain":"false","broker":"ad1f3a00.8fd8f8","x":570,"y":40,"wires":[]},{"id":"91fadaca.0a2788","type":"function","z":"cdaea329.3cf46","name":"prepare","func":"if (!msg.topic) {\n    msg.topic = 'log';\n  }\n  if (!msg.topic.startsWith('log') &&\n    !msg.topic.startsWith('ccu') &&\n    !msg.topic.startsWith('sys') &&\n    !msg.topic.startsWith('wm') &&\n    !msg.topic.startsWith('esp')) {\n    msg.topic = 'ccu/'+msg.topic;\n  }\n  \n  msg.topic = msg.topic.replace('localhost/','').replace('127.0.0.1/','');\n  \n  if (msg.payload && (typeof(msg.payload) === 'object')) {\n    workOn(msg.payload, msg.topic);\n    return null;\n  }\n  \n  return msg;\n  \n  function workOn(obj, topic) {\n    Object.keys(obj).forEach(function(key) {\n        if (obj[key] != null && typeof(obj[key]) === 'object') {\n            workOn(obj[key], topic + '/' + key);\n        } else {\n            doSend(obj[key], topic + '/' + key);\n        }        \n      });\n  }\n  \n  function doSend(obj, topic) {\n    if (obj instanceof Date) {\n        obj = obj.toISOString();\n    }\n    if( typeof obj === 'undefined' || obj == null || typeof(obj) == 'function' ) {\n          return;\n    }\n    let msgNew = {\n        topic : topic,\n        payload : obj, //String(obj),\n        qos : msg.qos,\n        retain : msg.retain\n    }\n    node.send(msgNew);\n  }","outputs":1,"noerr":0,"x":200,"y":40,"wires":[["318e8c05.73d674"]]},{"id":"318e8c05.73d674","type":"delay","z":"cdaea329.3cf46","name":"","pauseType":"queue","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"second","randomFirst":"1","randomLast":"5000","randomUnits":"milliseconds","drop":true,"x":390,"y":40,"wires":[["f6454355.0b87"]]},{"id":"ad1f3a00.8fd8f8","type":"mqtt-broker","z":"","name":"Mosquitto","broker":"localhost","port":"1883","clientid":"ccu","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"ccu/system/connection","birthQos":"0","birthRetain":"false","birthPayload":"start","closeTopic":"ccu/system/connection","closeQos":"0","closeRetain":"false","closePayload":"end","willTopic":"ccu/system/connection","willQos":"0","willPayload":"end unexpected"},{"id":"37398772.8eff58","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"7ab160bf.078c5","type":"tcp in","z":"37398772.8eff58","name":"","server":"server","host":"","port":"8186","datamode":"single","datatype":"utf8","newline":"","topic":"","base64":false,"x":90,"y":840,"wires":[["295deaca.80f9c6","255157ee.359238"]]},{"id":"295deaca.80f9c6","type":"function","z":"37398772.8eff58","name":"Parse JSON","func":"// customize baspath for the topic\nlet basePath = '/weatherman/status/';\n\nlet myJSON = msg.payload;\n\n// Regex to match the unicode characters for EOT\nlet grepEOT = /(.*)(\\u0003|\\u0004)/;\nlet match = grepEOT.exec(myJSON);\n\n// String contains EOT, should be complete\nif (match !== null) {\n    // Try to parse JSON and validate object\n    let myJSONObj = JSON.parse(match[1]);\n    if (myJSONObj && typeof myJSONObj === 'object') {\n        msg.payload = {\n            modultyp: myJSONObj.modultyp,\n            data : {},\n            values : {},\n            Systeminfo : myJSONObj.Systeminfo\n        };\n\n        let myTime = new Date();\n        msg.timestamp = myTime.toLocaleString();\n        msg.topic = basePath;\n        myJSONObj.vars.forEach(function(item, index, array) {\n        if (item.homematic_name) {\n            msg.payload.data[item.homematic_name] = item;\n            msg.payload.data[item.homematic_name].id = index;\n            msg.payload.values[item.homematic_name] = item.value;\n        } else {\n            msg.payload.data['data' + item.name] = item;\n        }\n    });\n\n    if (msg.payload.values.w_wind_spitze) {\n        let val = Number(msg.payload.values.w_wind_spitze) * 3.6;\n        msg.payload.values.w_wind_spitze_km_h = Math.round(val * 100) / 100;\n        msg.payload.data.w_wind_spitze_km_h = {\n            name    : 925,\n            homematic_name  : \"w_wind_spitze_km_h\",\n            desc    : \"peak_windgeschwindigkeit km/h\",\n            type    : \"number\",\n            unit    : \"km/h\",\n            value   : msg.payload.values.w_wind_spitze_km_h\n        };\n    }\n\n    if (msg.payload.values.w_windstaerke) {\n        let val = Number(msg.payload.values.w_windstaerke) * 3.6;\n        msg.payload.values.w_windstaerke_km_h = Math.round(val * 100) / 100;\n        msg.payload.data.w_windstaerke_km_h = {\n            name    : 926,\n            homematic_name  : \"w_windstaerke_km_h\",\n            desc    : \"bft_windgeschwindigkeit km/h\",\n            type    : \"number\",\n            unit    : \"km/h\",\n            value   : msg.payload.values.w_windstaerke_km_h\n        };\n    }\n    if (msg.payload.values.w_wind_mittel) {\n        let val = Number(msg.payload.values.w_wind_mittel) * 3.6;\n        msg.payload.values.w_wind_mittel_km_h = Math.round(val * 100) / 100;\n        msg.payload.data.w_wind_mittel_km_h = {\n            name    : 927,\n            homematic_name  : \"w_wind_mittel_km_h\",\n            desc    : \"avg_windgeschwindigkeit km/h\",\n            type    : \"number\",\n            unit    : \"km/h\",\n            value   : msg.payload.values.w_wind_mittel_km_h\n        };\n        if (msg.payload.values.w_wind_mittel < 0.3) {\n            msg.payload.values.w_wind_bezeichnung = \"Windstille\";\n            msg.payload.values.w_wind_beaufort = 0;\n        } else if (msg.payload.values.w_wind_mittel < 1.5) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwacher Wind\";\n            msg.payload.values.w_wind_beaufort = 1;\n        } else if (msg.payload.values.w_wind_mittel < 3.3) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwacher Wind\";\n            msg.payload.values.w_wind_beaufort = 2;\n        } else if (msg.payload.values.w_wind_mittel < 5.4) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwacher Wind\";\n            msg.payload.values.w_wind_beaufort = 3;\n        } else if (msg.payload.values.w_wind_mittel < 7.9) {\n            msg.payload.values.w_wind_bezeichnung = \"Mäßiger Wind\";\n            msg.payload.values.w_wind_beaufort = 4;\n        } else if (msg.payload.values.w_wind_mittel < 10.7) {\n            msg.payload.values.w_wind_bezeichnung = \"Frischer Wind\";\n            msg.payload.values.w_wind_beaufort = 5;\n        } else if (msg.payload.values.w_wind_mittel < 13.8) {\n            msg.payload.values.w_wind_bezeichnung = \"Starker Wind\";\n            msg.payload.values.w_wind_beaufort = 6;\n        } else if (msg.payload.values.w_wind_mittel < 17.1) {\n            msg.payload.values.w_wind_bezeichnung = \"Windstille\";\n            msg.payload.values.w_wind_beaufort = 7;\n        } else if (msg.payload.values.w_wind_mittel < 20,7) {\n            msg.payload.values.w_wind_bezeichnung = \"Steifer Wind\";\n            msg.payload.values.w_wind_beaufort = 8;\n        } else if (msg.payload.values.w_wind_mittel < 24,4) {\n            msg.payload.values.w_wind_bezeichnung = \"Stürmischer Wind\";\n            msg.payload.values.w_wind_beaufort = 9;\n        } else if (msg.payload.values.w_wind_mittel < 28,4) {\n            msg.payload.values.w_wind_bezeichnung = \"Schwerer Sturm\";\n            msg.payload.values.w_wind_beaufort = 10;\n        } else if (msg.payload.values.w_wind_mittel < 32,6) {\n            msg.payload.values.w_wind_bezeichnung = \"Orkanartiger Sturm\";\n            msg.payload.values.w_wind_beaufort = 11;\n        } else { //über 32,7\n            msg.payload.values.w_wind_bezeichnung = \"Orkan\";\n            msg.payload.values.w_wind_beaufort = 12;\n        }        \n        msg.payload.data.w_wind_bezeichnung = {\n            name    : 928,\n            homematic_name  : \"w_wind_bezeichnung\",\n            desc    : \"Bezeichnung der Windstärke (Beaufort)\",\n            type    : \"string\",\n            unit    : \"\",\n            value   : msg.payload.values.w_wind_bezeichnung\n        };\n        msg.payload.data.w_wind_beaufort = {\n            name    : 929,\n            homematic_name  : \"w_wind_beaufort\",\n            desc    : \"Windstärke (Beaufort)\",\n            type    : \"number\",\n            unit    : \"Bft\",\n            value   : msg.payload.values.w_wind_beaufort\n        };\n    }\n\n    return msg;\n  } else {\n    node.error('Weatherman: Incomplete or corrupt JSON received', msg);\n  }\n// No EOT found or parse error. Possibly trunctuated / corrupt message\n} else {\n  node.error('Weatherman: Incomplete or corrupt JSON received', msg);\n}\n","outputs":1,"noerr":0,"x":280,"y":840,"wires":[["dd45891d.750f98","a3a9e7cc.e10918","e34b872c.1568b8","e16380c0.27301","849baab1.c13f08","5d6ee271.d086cc","4be63be7.e036e4","d0cd617d.78738","6d246b71.1c1c84","c8dd7eb9.eb7dd","da5fc697.fd2968","5bc6120e.d4e13c","28cff7d3.807f78","fdaf5660.70c6d8","194dff0c.cd6371","3c3466fc.77a3ea","c382126f.7094f","65d49058.eadef","7a88d72a.cb1648","e5159a57.4bcd68","4c57c2ea.fb593c","de203979.cc53e8","4e17a85.b567758","54c95549.43000c","bc3d20bb.d724","baaff4bc.7e8a08","f9a2d3a8.a7467","3d5aa90b.d00436","9dffa488.770198","258fcdcb.1846e2"]]},{"id":"dd45891d.750f98","type":"change","z":"37398772.8eff58","name":"w_temperatur - aussentemperatur","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & \"w_temperatur\"","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_temperatur.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_temperatur.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":240,"wires":[[]]},{"id":"c382126f.7094f","type":"change","z":"37398772.8eff58","name":"w_windchill - gefuehlte_temperatur","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_windchill'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_windchill.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_windchill.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":320,"wires":[[]]},{"id":"8a7eff29.e8571","type":"catch","z":"37398772.8eff58","name":"Parse JSON Error","scope":["748657ac.017fc8","dcc01123.c799e","295deaca.80f9c6"],"x":1600,"y":1660,"wires":[["b334b530.cd7fd8"]]},{"id":"65d49058.eadef","type":"change","z":"37398772.8eff58","name":"w_taupunkt - taupunkt_temperatur","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_taupunkt'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_taupunkt.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_taupunkt.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":360,"wires":[[]]},{"id":"7a88d72a.cb1648","type":"change","z":"37398772.8eff58","name":"w_himmeltemperatur - himmel_temperatur","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_himmeltemperatur'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_himmeltemperatur.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_himmeltemperatur.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":400,"wires":[[]]},{"id":"e34b872c.1568b8","type":"change","z":"37398772.8eff58","name":"w_feuchte_rel - rel_feuchte","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_feuchte_rel'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_feuchte_rel.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_feuchte_rel.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":440,"wires":[[]]},{"id":"b041c75a.225f58","type":"change","z":"37398772.8eff58","name":"w_feuchte_abs - abs_feuchte","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_feuchte_abs'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_feuchte_abs.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_feuchte_abs.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":480,"wires":[[]]},{"id":"f1ac6d45.5a5cc","type":"change","z":"37398772.8eff58","name":"w_regensensor_wert - regenmelderwert","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_regensensor_wert'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_regensensor_wert.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_regensensor_wert.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":520,"wires":[[]]},{"id":"3c3466fc.77a3ea","type":"change","z":"37398772.8eff58","name":"w_regenmelder - regenstatus","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_regenmelder'","tot":"jsonata"},{"t":"set","p":"regenstaerke","pt":"msg","to":"payload.data.w_regenstaerke.value","tot":"msg"},{"t":"set","p":"regen_letzte_h","pt":"msg","to":"payload.data.w_regen_letzte_h.value","tot":"msg"},{"t":"set","p":"regen_mm_heute","pt":"msg","to":"payload.data.w_regen_mm_heute.value","tot":"msg"},{"t":"set","p":"regenstunden_heute","pt":"msg","to":"payload.data.w_regenstunden_heute.value","tot":"msg"},{"t":"set","p":"regensensor_wert","pt":"msg","to":"payload.data.w_regensensor_wert.value","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_regenmelder.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":560,"wires":[[]]},{"id":"fdaf5660.70c6d8","type":"change","z":"37398772.8eff58","name":"w_regenstaerke - regenstaerke","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_regenstaerke'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_regenstaerke.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_regenstaerke.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":600,"wires":[[]]},{"id":"28cff7d3.807f78","type":"change","z":"37398772.8eff58","name":"w_regen_letzte_h - regen_pro_h","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_regen_letzte_h'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_regen_letzte_h.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_regen_letzte_h.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":640,"wires":[[]]},{"id":"6d246b71.1c1c84","type":"change","z":"37398772.8eff58","name":"w_barometer - nn_luftdruck","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_barometer'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_barometer.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_barometer.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":760,"wires":[[]]},{"id":"a3a9e7cc.e10918","type":"change","z":"37398772.8eff58","name":"w_barotrend - luftdrucktrend","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_barotrend'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_barotrend.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_barotrend.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":800,"wires":[[]]},{"id":"e5159a57.4bcd68","type":"change","z":"37398772.8eff58","name":"w_wind_mittel - avg_windgeschwindigkeit","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_wind_mittel'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_wind_mittel.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_wind_mittel.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":840,"wires":[[]]},{"id":"4e17a85.b567758","type":"change","z":"37398772.8eff58","name":"w_wind_spitze - peak_windgeschwindigkeit","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_wind_spitze'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_wind_spitze.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_wind_spitze.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":920,"wires":[[]]},{"id":"bc3d20bb.d724","type":"change","z":"37398772.8eff58","name":"w_windstaerke - bft_windgeschwindigkeit","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_windstaerke'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_windstaerke.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_windstaerke.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":1000,"wires":[[]]},{"id":"3d5aa90b.d00436","type":"change","z":"37398772.8eff58","name":"w_windrichtung - windrichtung","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_windrichtung'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_windrichtung.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_windrichtung.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":1120,"wires":[[]]},{"id":"e16380c0.27301","type":"change","z":"37398772.8eff58","name":"w_wind_dir - windwinkel","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_wind_dir'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_wind_dir.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_wind_dir.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":1160,"wires":[[]]},{"id":"849baab1.c13f08","type":"change","z":"37398772.8eff58","name":"w_lux - helligkeit","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_lux'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_lux.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_lux.value","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"ccu/system/info/sun/intensity/lightS","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":1200,"wires":[[]]},{"id":"5d6ee271.d086cc","type":"change","z":"37398772.8eff58","name":"w_sonne_diff_temp - sonnen_difftemperatur","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_sonne_diff_temp'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_sonne_diff_temp.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_sonne_diff_temp.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1250,"wires":[[]]},{"id":"9dffa488.770198","type":"change","z":"37398772.8eff58","name":"w_sonne_scheint - sonne_scheint","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_sonne_scheint'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_sonne_scheint.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_sonne_scheint.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":1290,"wires":[[]]},{"id":"258fcdcb.1846e2","type":"change","z":"37398772.8eff58","name":"w_sonnenstunden_heute - sonne_heute","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_sonnenstunden_heute'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_sonnenstunden_heute.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_sonnenstunden_heute.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":1330,"wires":[[]]},{"id":"4be63be7.e036e4","type":"change","z":"37398772.8eff58","name":"sec_seit_reset","rules":[{"t":"set","p":"topic","pt":"msg","to":"sec_seit_reset","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.Systeminfo.sec_seit_reset","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":1580,"wires":[["1bbc5b02.12dc15"]]},{"id":"d0cd617d.78738","type":"change","z":"37398772.8eff58","name":"firmware","rules":[{"t":"set","p":"topic","pt":"msg","to":"firmware","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.Systeminfo.firmware","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1660,"wires":[[]]},{"id":"1bbc5b02.12dc15","type":"rbe","z":"37398772.8eff58","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1020,"y":1580,"wires":[["f8cc8867.82e2b8","fc6d83b1.11265"]]},{"id":"f8cc8867.82e2b8","type":"trigger","z":"37398772.8eff58","op1":"true","op2":"false","op1type":"bool","op2type":"bool","duration":"60","extend":true,"units":"s","reset":"1","bytopic":"all","name":"TimeOut","x":1210,"y":1540,"wires":[["c2b6b58c.455d18"]]},{"id":"fc6d83b1.11265","type":"trigger","z":"37398772.8eff58","op1":"0","op2":"1","op1type":"num","op2type":"num","duration":"250","extend":false,"units":"ms","reset":"","bytopic":"all","name":"Heart Beat","x":1620,"y":1620,"wires":[["b334b530.cd7fd8"]]},{"id":"f8df3db1.321d8","type":"change","z":"37398772.8eff58","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"con_ok","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1610,"y":1540,"wires":[["b334b530.cd7fd8"]]},{"id":"c2b6b58c.455d18","type":"switch","z":"37398772.8eff58","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1400,"y":1540,"wires":[["f8df3db1.321d8"],["114afa57.3593d6"]]},{"id":"114afa57.3593d6","type":"change","z":"37398772.8eff58","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"con_timeout","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1610,"y":1580,"wires":[["b334b530.cd7fd8"]]},{"id":"255157ee.359238","type":"link out","z":"37398772.8eff58","name":"","links":["d9984bdc.5365b8"],"x":225,"y":880,"wires":[]},{"id":"365a6c05.4d5d04","type":"comment","z":"37398772.8eff58","name":"Weatherman","info":"","x":100,"y":40,"wires":[]},{"id":"e2554de2.daa9b","type":"comment","z":"37398772.8eff58","name":"Weatherman - Values","info":"","x":830,"y":200,"wires":[]},{"id":"db60b01f.0496d","type":"comment","z":"37398772.8eff58","name":"Weatherman - System Info","info":"","x":840,"y":1500,"wires":[]},{"id":"bbd16706.0d3b38","type":"comment","z":"37398772.8eff58","name":"Parse JSON","info":"","x":170,"y":760,"wires":[]},{"id":"cd6e2d5b.f2263","type":"comment","z":"37398772.8eff58","name":"Einfaches Monitoring und Fehlerbehandlung","info":"","x":1350,"y":1500,"wires":[]},{"id":"59693460.53219c","type":"subflow:cdaea329.3cf46","z":"37398772.8eff58","name":"","x":1080,"y":120,"wires":[]},{"id":"c8dd7eb9.eb7dd","type":"change","z":"37398772.8eff58","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"wm","tot":"str"},{"t":"delete","p":"payload.data","pt":"msg"},{"t":"delete","p":"payload.values.w_ip","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":120,"wires":[["59693460.53219c"]]},{"id":"da5fc697.fd2968","type":"debug","z":"37398772.8eff58","name":"WEATHERMAN-Data","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":830,"y":160,"wires":[]},{"id":"5bc6120e.d4e13c","type":"function","z":"37398772.8eff58","name":"WindData","func":"'use strict';\n// Long term wind data in h\nconst limitLongTerm = 8;\n// Mid term wind data in h\nconst limitMediumTerm = 3;\n// Short term wind data in h\nconst limitShortTerm = 1;\n\n//payload.data.w_windrichtung.unit   - w_windrichtung - windrichtung\nlet windDirection =  msg.payload.data.w_windrichtung.value;\n//payload.data.w_wind_mittel.unit    - w_wind_mittel - avg_windgeschwindigkeit\nlet windSpeed = msg.payload.data.w_wind_mittel.value;\n\n// Define context to store data across multiple messages\nlet windVector = context.get('windVector') || [];\n\n// Start processing the data once both speed and \n// direction are available\nif (windDirection != null && windSpeed != null) {\n  let LTdata = [],\n      MTdata = [],\n      STdata = [],\n      LTresult = [],\n      MTresult = [],\n      STresult = [],\n      windObj = {},\n      LTmsg = {},\n      MTmsg = {},\n      STmsg = {};\n  const LTlimit = Date.now() - (limitLongTerm * 3600 * 1000);\n  const MTlimit = Date.now() - (limitMediumTerm * 3600 * 1000);\n  const STlimit = Date.now() - (limitShortTerm * 3600 * 1000);\n\n  // Generate an object out of speed, direction and \n  // current time and store as array\n  windObj = {[windDirection]: windSpeed, timestamp: Date.now()};\n  windVector.push(windObj);\n\n  // Create arrays with data only for the above defined\n  // time ranges\n  LTdata = windVector.filter((arr) => arr.timestamp > LTlimit);\n  MTdata = LTdata.filter((arr) => arr.timestamp > MTlimit);\n  STdata = MTdata.filter((arr) => arr.timestamp > STlimit);\n  \n  // Make sure that the context does not grow infinitly \n  context.set('windVector', LTdata);\n  \n  // Get the sum of all wind speeds for the different\n  // cardinal points and for the above defined \n  // time ranges\n  LTresult[0] = LTdata.map((item) => (isNaN(item.N) ? 0 : item.N)).reduce((prev, next) => prev + next);\n  LTresult[1] = LTdata.map((item) => (isNaN(item.NE) ? 0 : item.NE)).reduce((prev, next) => prev + next);\n  LTresult[2] = LTdata.map((item) => (isNaN(item.E) ? 0 : item.E)).reduce((prev, next) => prev + next);\n  LTresult[3] = LTdata.map((item) => (isNaN(item.SE) ? 0 : item.SE)).reduce((prev, next) => prev + next);\n  LTresult[4] = LTdata.map((item) => (isNaN(item.S) ? 0 : item.S)).reduce((prev, next) => prev + next);\n  LTresult[5] = LTdata.map((item) => (isNaN(item.SW) ? 0 : item.SW)).reduce((prev, next) => prev + next);\n  LTresult[6] = LTdata.map((item) => (isNaN(item.W) ? 0 : item.W)).reduce((prev, next) => prev + next);\n  LTresult[7] = LTdata.map((item) => (isNaN(item.NW) ? 0 : item.NW)).reduce((prev, next) => prev + next);\n\n  MTresult[0] = MTdata.map((item) => (isNaN(item.N) ? 0 : item.N)).reduce((prev, next) => prev + next);\n  MTresult[1] = MTdata.map((item) => (isNaN(item.NE) ? 0 : item.NE)).reduce((prev, next) => prev + next);\n  MTresult[2] = MTdata.map((item) => (isNaN(item.E) ? 0 : item.E)).reduce((prev, next) => prev + next);\n  MTresult[3] = MTdata.map((item) => (isNaN(item.SE) ? 0 : item.SE)).reduce((prev, next) => prev + next);\n  MTresult[4] = MTdata.map((item) => (isNaN(item.S) ? 0 : item.S)).reduce((prev, next) => prev + next);\n  MTresult[5] = MTdata.map((item) => (isNaN(item.SW) ? 0 : item.SW)).reduce((prev, next) => prev + next);\n  MTresult[6] = MTdata.map((item) => (isNaN(item.W) ? 0 : item.W)).reduce((prev, next) => prev + next);\n  MTresult[7] = MTdata.map((item) => (isNaN(item.NW) ? 0 : item.NW)).reduce((prev, next) => prev + next);\n\n  STresult[0] = STdata.map((item) => (isNaN(item.N) ? 0 : item.N)).reduce((prev, next) => prev + next);\n  STresult[1] = STdata.map((item) => (isNaN(item.NE) ? 0 : item.NE)).reduce((prev, next) => prev + next);\n  STresult[2] = STdata.map((item) => (isNaN(item.E) ? 0 : item.E)).reduce((prev, next) => prev + next);\n  STresult[3] = STdata.map((item) => (isNaN(item.SE) ? 0 : item.SE)).reduce((prev, next) => prev + next);\n  STresult[4] = STdata.map((item) => (isNaN(item.S) ? 0 : item.S)).reduce((prev, next) => prev + next);\n  STresult[5] = STdata.map((item) => (isNaN(item.SW) ? 0 : item.SW)).reduce((prev, next) => prev + next);\n  STresult[6] = STdata.map((item) => (isNaN(item.W) ? 0 : item.W)).reduce((prev, next) => prev + next);\n  STresult[7] = STdata.map((item) => (isNaN(item.NW) ? 0 : item.NW)).reduce((prev, next) => prev + next);\n\n  return [  { payload : LTresult, topic : msg.topic + 'longTerm' },\n            { payload : MTresult, topic : msg.topic + 'mediumTerm' },\n            { payload : STresult, topic : msg.topic + 'shortTerm' }];\n}\n","outputs":3,"noerr":0,"x":790,"y":1410,"wires":[["c487b54e.293088"],[],["27a2e572.9e785a"]],"outputLabels":["LongTerm","MidTerm","ShortTerm"]},{"id":"c487b54e.293088","type":"debug","z":"37398772.8eff58","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1020,"y":1400,"wires":[]},{"id":"27a2e572.9e785a","type":"debug","z":"37398772.8eff58","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1020,"y":1440,"wires":[]},{"id":"baaff4bc.7e8a08","type":"change","z":"37398772.8eff58","name":"w_windstaerke_km_h - bft_windgeschwindigkeit km/h","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_windstaerke_km_h'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_windstaerke_km_h.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_windstaerke_km_h.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":1040,"wires":[[]]},{"id":"f9a2d3a8.a7467","type":"change","z":"37398772.8eff58","name":"w_wind_beaufort - Windstärke (Beaufort)","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_wind_beaufort'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_wind_beaufort.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_wind_beaufort.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":1080,"wires":[[]]},{"id":"194dff0c.cd6371","type":"change","z":"37398772.8eff58","name":"w_regen_mm_heute - ...","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_regen_mm_heute'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_regen_mm_heute.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_regen_mm_heute.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":680,"wires":[[]]},{"id":"4c57c2ea.fb593c","type":"change","z":"37398772.8eff58","name":"w_regenstunden_heute - ...","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_regenstunden_heute'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_regenstunden_heute.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_regenstunden_heute.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":720,"wires":[[]]},{"id":"de203979.cc53e8","type":"change","z":"37398772.8eff58","name":"w_wind_mittel_km_h - avg_windgeschwindigkeit km/h","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_wind_mittel_km_h'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_wind_mittel_km_h.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_wind_mittel_km_h.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":880,"wires":[[]]},{"id":"54c95549.43000c","type":"change","z":"37398772.8eff58","name":"w_wind_spitze_km_h - peak_windgeschwindigkeit km/h","rules":[{"t":"set","p":"topic","pt":"msg","to":"$$.topic & 'w_wind_spitze_km_h'","tot":"jsonata"},{"t":"set","p":"unit","pt":"msg","to":"payload.data.w_wind_spitze_km_h.unit","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.data.w_wind_spitze_km_h.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":960,"wires":[[]]},{"id":"b334b530.cd7fd8","type":"debug","z":"37398772.8eff58","name":"HealthSate","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1850,"y":1540,"wires":[]}]
Zuletzt geändert von Hypnos am 09.01.2019, 21:41, insgesamt 1-mal geändert.

wolwin
Beiträge: 30
Registriert: 06.06.2018, 12:27

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von wolwin » 08.01.2019, 12:11

Mit RedMatic in der HM-Welt sicher eine gute Wahl und eine prima Umsetzung - setzt jedoch eine CCU (HARDWARE) voraus! Genau die CCU besitze ich nicht - meine Entscheidung fiel ja für FHEM - daher bei meiner Node-RED Lösung vielleicht etwas weniger 'Bequemlichkeit' bei der Konfiguration (Installation und Konfiguration statt installierbare AddOns). Jedoch in meinem Modul mit allen Freiheitsgraden Richtung mariaDB + Grafana - und: bei beiden Vorgehensweisen werden identische Komponenten benutzt (Node-RED, Mosquitto, etc.) - es sollte also möglich sein, das beste für sich aus den beiden Implementationen heraus zu finden.

Noch eine kleine Anmerkung zu ...
Ich nutze die im Weatherman hinterlegten Variablennamen und nicht die Variablen Nummern und bin damit von Veränderungen bei Software updates unabhängig.
Sehe ich anders - es wurden schon öfter die HM-Namen geändert - lediglich die Var-Indizes behielten ihre Bedeutung - siehe auch die Gegenüberstellung der verschiedenen FW-Versionen des WM auf meiner Github Seite:
https://github.com/wolwin/WW-myHOME/blo ... mes_WM.txt

Gruß
Wolfram

wolwin
Beiträge: 30
Registriert: 06.06.2018, 12:27

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von wolwin » 10.01.2019, 21:29

Hallo Eugen,
folgende Frage an den Elektronik-Fachmann: kann ich die Spannung am externen BME von 3,3V auf 5V anheben, da ich vor habe, noch einen 5V Lüfter anzuschließen - der BME280 ist ja auch für 5V ausgelegt - eigentlich sollte der Wemos die SCL / SDA Signale dann auch noch verarbeiten können, oder??? Folgende Schaltung möchte ich gerne einsetzen:
WM_BME_5V.jpg
Gruss
Wolfram

dondaik
Beiträge: 9349
Registriert: 16.01.2009, 18:48
Wohnort: Steingaden

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von dondaik » 10.01.2019, 21:46

keine ahnung was der lüfter da soll . egal und warum nicht einfach einen step-down 3.3V regler rein ... je nach bme ist der bei 5Vcc tot - man kann ja die 5V version kaufen....
-------
wer schreibfehler findet darf sie behalten.

wolwin
Beiträge: 30
Registriert: 06.06.2018, 12:27

Re: WEATHERMAN ...perfekte Wetterstation für die Hausautomation

Beitrag von wolwin » 10.01.2019, 22:21

Den Stepdown wollte ich mir sparen - der BME ist nur für 3,3V spezifiziert, aber die meisten BME Miniboards sind mit 5V Spannungsregler ausgestattet.

Antworten

Zurück zu „HomeMatic Tipps & Tricks - keine Fragen!“