You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
APRS-Bake/flow.json

1 lines
4.7 KiB

[{"id":"f9919657.169ae","type":"tab","label":"APRS Bake","disabled":false,"info":""},{"id":"a3419ec8.bf571","type":"mqtt in","z":"f9919657.169ae","name":"Joachim","topic":"/aprs/joachim/bake","qos":"2","datatype":"json","broker":"d1df93ca.89d618","x":166,"y":281,"wires":[["b4d9d242.bd10c8"]]},{"id":"b4d9d242.bd10c8","type":"function","z":"f9919657.169ae","name":"Bake","func":"var temp = msg.payload.sensordatavalues[2].value;\nvar hum = msg.payload.sensordatavalues[3].value;\nvar press = msg.payload.sensordatavalues[4].value;\n\n// Convert Celsius to Fahrenheit / APRS Protocol\nvar tempF = ((temp*1.8)+32); \nvar press2 = ((press/100)+64);\nvar hum2 = (hum*1);\n// Erase decimal points\nvar tempP = parseFloat(tempF.toFixed(0)); \nvar pressP = parseFloat(press2.toFixed(0));\nvar humP = parseFloat(hum2.toFixed(0));\n\nvar msg1 = { payload: \"user CALL pass XXXX\" };\nvar msg2 = { payload: \"CALL-1>APRS,TCPIP*:!4808.30N/01125.75E_000/000g000t0\"+tempP+\"r000p000P000h\"+humP+\"b\"+pressP+\"0wRSW\" }; \nvar msg3 = { payload: \"CALL-1>APRS,TCPIP*:>Maker Themen, LoraWAN, Arduino, Raspberry, SmartHome und AFU\" }; \nvar msg4 = { payload: \"File löschen\" }; \nreturn [ [ msg1, msg2, msg3 ], msg4 ]\n\n\n","outputs":4,"noerr":0,"x":349,"y":282,"wires":[["937bf49f.2885a8","e0d66fd9.02b048","7887a95a.059ed"],["99f92534.dd0ec8"],[],[]]},{"id":"937bf49f.2885a8","type":"delay","z":"f9919657.169ae","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":575,"y":233,"wires":[["a2bc24cb.c65c1"]]},{"id":"a2bc24cb.c65c1","type":"exec","z":"f9919657.169ae","command":"/bin/nc -w 10 195.190.142.207 14580 < /var/tmp/bake.txt","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"APRS Bake","x":784,"y":234,"wires":[[],[],[]]},{"id":"e0d66fd9.02b048","type":"file","z":"f9919657.169ae","name":"Bake File","filename":"/var/tmp/bake.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":560,"y":283,"wires":[[]]},{"id":"99f92534.dd0ec8","type":"delay","z":"f9919657.169ae","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":569,"y":338,"wires":[["1f30e907.eafd6f"]]},{"id":"1f30e907.eafd6f","type":"file","z":"f9919657.169ae","name":"Bake File löschen","filename":"/var/tmp/bake.txt","appendNewline":true,"createDir":false,"overwriteFile":"delete","encoding":"utf8","x":792,"y":339,"wires":[[]]},{"id":"3398a9cb.72ebc6","type":"http request","z":"f9919657.169ae","name":"","method":"GET","ret":"obj","url":"http://192.168.10.27/data.json","tls":"","x":411,"y":444,"wires":[["f831289a.11eb8"]]},{"id":"8faddbfc.0dc82","type":"inject","z":"f9919657.169ae","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":186,"y":443,"wires":[["3398a9cb.72ebc6"]]},{"id":"7887a95a.059ed","type":"debug","z":"f9919657.169ae","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":544,"y":182,"wires":[]},{"id":"f831289a.11eb8","type":"mqtt out","z":"f9919657.169ae","name":"Joachim","topic":"/aprs/joachim/bake","qos":"","retain":"","broker":"d1df93ca.89d618","x":609,"y":444,"wires":[]},{"id":"e1d0fa76.6b87c","type":"comment","z":"f9919657.169ae","name":"Info zu dem Programm : APRS Bake","info":"Dieses Programm liest folgende Wetterdaten \n\n * Temperatur\n * Luftdruck\n * Luftfeuchtigkeit \n\n \nIn dem Funktionsblock \"Bake\" müssen die Werte für\n\n * eigene Rufzeichen und \n * Passwort \n * Koordinaten \nangepasst werden.\n\nDer Syntax für APRS ist nicht fehlertolerant \nund liefert keine Fehlermeldungen zurück.\nAußerdem können die Wetterdaten nur alle 15 Minuten\ngesendet werden, damit diese aktualisiert werden.\nEin kürzerer Intervall bringt nichts und wird schlichtweg\nignoriert. \n\nAls MQTT-Broker nehmen ich meinen eigenen unter mqtt.unixweb.de.\nDie Topics und Broker können natürlich für die eigene Umgebung angepasst werden.\nDie Anbindung an anderen Sensoren die ebenfalls an einen MQTT-Broker Daten \nversenden, können individuell angepasst werden. \n\nViel Spaß und Erfolg wünscht , Joachim Hummel\nWeitere Infos sind zu finden unter: https://blog.unixweb.de\n","x":272,"y":113,"wires":[]},{"id":"d1df93ca.89d618","type":"mqtt-broker","z":"","name":"unixweb.de","broker":"mqtt.unixweb.de","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]