SonOff Tasmota szenzor adatok továbbítása MQTT-n NodeRed segítségével.

SonOff kapcsolóra csatlakoztatva van egy AM2301(DHT22) szenzor. MQTT-n küldi erről az adatokat. NodeRed segítségel ezeket tovább küldjük Thingspeak csatornánkra szintén MQTT-n keresztül. Az API-ról leírás: https://www.mathworks.com/help/thingspeak/mqtt-api.html

[{"id":"98fdf049.93d28","type":"tab","label":"Flow 1","disabled":true,"info":""},
{"id":"70b9218c.b994d","type":"json","z":"98fdf049.93d28","name":"JSON Parse","property":"payload.AM2301","action":"obj","pretty":false,"x":179,"y":128,"wires":[["f28a7c8c.fc1ab","18b36a.7f9e4497"]]},
{"id":"f28a7c8c.fc1ab","type":"function","z":"98fdf049.93d28","name":"paratartalom kinyerese","func":"var para= {\"payload\":msg.payload.AM2301.Humidity.toString().slice(0,10)};\n\nreturn para","outputs":1,"noerr":0,"x":213,"y":228,"wires":[["aec9009c.987838"]]},{"id":"4929f906.23c438","type":"mqtt in","z":"98fdf049.93d28","name":"","topic":"tele/furdoszobaventi/SENSOR","qos":"2","datatype":"json","broker":"53bd5c09.14a054","x":198.5,"y":52,"wires":[["70b9218c.b994d"]]},{"id":"aec9009c.987838","type":"template","z":"98fdf049.93d28","name":"paratartalom formazas","field":"para","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}}","output":"str","x":464.5,"y":202,"wires":[["a6c89606.d4dad8"]]},{"id":"dfbfd217.2a42a","type":"debug","z":"98fdf049.93d28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":742.5,"y":190,"wires":[]},{"id":"a165e3e2.88a6b","type":"template","z":"98fdf049.93d28","name":"homerseklet formazasa","field":"home","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}}","output":"str","x":469.5,"y":261,"wires":[["f5ae03dd.de237","428b14ed.d480ec"]]},{"id":"f5ae03dd.de237","type":"debug","z":"98fdf049.93d28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":742.5,"y":256,"wires":[]},{"id":"428b14ed.d480ec","type":"mqtt out","z":"98fdf049.93d28","name":"","topic":"channels/csatornaidide/publish/fields/field4/writekeyide","qos":"","retain":"","broker":"1ffe407d.7fa008","x":658.5,"y":342,"wires":[]},{"id":"5fff7e7b.6d0b4","type":"mqtt out","z":"98fdf049.93d28","name":"","topic":"channels/csatornaidide/publish/fields/field3/writekeyide","qos":"","retain":"","broker":"1ffe407d.7fa008","x":668,"y":63,"wires":[]},{"id":"a6c89606.d4dad8","type":"delay","z":"98fdf049.93d28","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":594.5,"y":141,"wires":[["5fff7e7b.6d0b4","dfbfd217.2a42a"]]},{"id":"18b36a.7f9e4497","type":"function","z":"98fdf049.93d28","name":"homerseklet kinyerese","func":"var home= {\"payload\":msg.payload.AM2301.Temperature.toString().slice(0,10)};\nreturn home","outputs":1,"noerr":0,"x":201,"y":291,"wires":[["a165e3e2.88a6b"]]},{"id":"53bd5c09.14a054","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},
{"id":"1ffe407d.7fa008","type":"mqtt-broker","z":"","name":"thingspeak okosház mqtt","broker":"mqtt.thingspeak.com","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"200","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
This entry was posted in NodeRed, RaspberryPi, Uncategorized, Web and tagged , , , , , , . Bookmark the permalink.

Vélemény, hozzászólás?

Az email címet nem tesszük közzé. A kötelező mezőket * karakterrel jelöltük

Ez a weboldal az Akismet szolgáltatását használja a spam kiszűrésére. Tudjunk meg többet arról, hogyan dolgozzák fel a hozzászólásunk adatait..