Send Aircraft Count from HAJ (DUMP1090) to Twitter, Thingspeak and MQTT Server

This Flow send Aircraft count from HAJ to Twitter, Thingspeak and MQTT Server.

More http://blog.wenzlaff.de/?p=7779

[{"id":"200f4cf9.b3976c","type":"inject","z":"ed8ad8d6.f11d18","name":"Start Abfrage","topic":"","payload":"","payloadType":"str","repeat":"300","crontab":"","once":false,"x":140,"y":80,"wires":[["2cd9a29b.be3596"]]},{"id":"2cd9a29b.be3596","type":"http request","z":"ed8ad8d6.f11d18","name":"Flug Server DUMP1090 abfragen","method":"GET","ret":"obj","url":"http://10.0.7.32/dump1090/data/aircraft.json","tls":"","x":540,"y":80,"wires":[["746a5163.28f49"]]},{"id":"99d17838.76d2b8","type":"debug","z":"ed8ad8d6.f11d18","name":"Ausgabe","active":true,"console":"true","complete":"payload","x":670,"y":300,"wires":[]},{"id":"c7289dac.89b368","type":"comment","z":"ed8ad8d6.f11d18","name":"www.wenzlaff.info","info":"","x":770,"y":20,"wires":[]},{"id":"746a5163.28f49","type":"contrib-json","z":"ed8ad8d6.f11d18","engine":"JSONSelect","command":"jq","expr":":root > .aircraft","complete":"property","prop":"payload","name":"Filter Flugzeuge","x":140,"y":380,"wires":[["8fbd74c1.43fcc","25dedb46.d297dc"]]},{"id":"8fbd74c1.43fcc","type":"function","z":"ed8ad8d6.f11d18","name":"Text für Twitter aufbereiten","func":"var newMsg = { payload: msg.payload[0].length + \" #Flugzeuge in #Hannover (#HAJ #EDDV) erfasst per #ADSB am \" + new Date() + \" per #Raspberry #Pi und Node-RED\"};\nreturn newMsg;","outputs":1,"noerr":0,"x":420,"y":360,"wires":[["99d17838.76d2b8","f763e32e.a3551"]]},{"id":"ec9fda4.d625ba8","type":"ui_gauge","z":"ed8ad8d6.f11d18","name":"Anzahl Flugzeuge","group":"c18727d3.1b7608","order":1,"width":"","height":"","gtype":"gage","title":"Anzahl Flugzeuge","label":"Hannover","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":690,"y":420,"wires":[]},{"id":"43abb4c1.6e548c","type":"ui_button","z":"ed8ad8d6.f11d18","name":"Anzahl Flugzeuge nach Twitter und Thingspeak senden","group":"c18727d3.1b7608","order":2,"width":"","height":"","label":"Anzahl Flugzeuge nach Twitter + Thingspeak senden","color":"","bgcolor":"","icon":"","payload":"timestamp","payloadType":"str","topic":"","x":250,"y":140,"wires":[["2cd9a29b.be3596"]]},{"id":"616dc16d.0c54","type":"comment","z":"ed8ad8d6.f11d18","name":"Alle 5 Minuten die Anzahl Flugzeuge in Hannover ermitteln und an Twitter/Thinkspeak senden.","info":"Und sendet das Ergebnis:\n\n-an die GUI\n\n-nach Twitter\n-nach Thingspeak.com\n\n-als Debug nachricht in den Debug Tab\n\n-als System.out auf die Konsole\n\n-an zwei MQTT Broker, den eigenen und Testserver\n\nÜber Button kann jeweils im Flow und in der Gui aktualisiert werden\n\n-abfragen von Thingspeak.com über GUI","x":340,"y":20,"wires":[]},{"id":"25dedb46.d297dc","type":"function","z":"ed8ad8d6.f11d18","name":"Anzahl Flugzeuge","func":"// die Anzahl der Flugzeuge ermitteln\n\nvar newMsg = { payload:  msg.payload[0].length };\nreturn newMsg;","outputs":1,"noerr":0,"x":390,"y":420,"wires":[["ec9fda4.d625ba8","5d6d053.86e5d7c","fb1b30e4.eb3ab","d99db983.3c7738"]]},{"id":"e85c7dcd.ed493","type":"debug","z":"ed8ad8d6.f11d18","name":"Ausgabe","active":true,"console":"true","complete":"payload","x":510,"y":880,"wires":[]},{"id":"284a27d7.dfba3","type":"inject","z":"ed8ad8d6.f11d18","name":"Abfrage von Thinkspeak.com","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":190,"y":680,"wires":[["29e6b8a3.28453"]]},{"id":"29e6b8a3.28453","type":"http request","z":"ed8ad8d6.f11d18","name":"Flugzeuge von thingspeak.com abfragen","method":"GET","ret":"obj","url":"https://api.thingspeak.com/channels/44177/feeds/last.json","tls":"","x":600,"y":720,"wires":[["e4850537.e2ea4"]]},{"id":"e4850537.e2ea4","type":"contrib-json","z":"ed8ad8d6.f11d18","engine":"JSONSelect","command":"jq","expr":":root > .field1","complete":"property","prop":"payload","name":"field1 auswerten","x":160,"y":800,"wires":[["4ad74b80.d2fd8c","132cc547.632033"]]},{"id":"4ad74b80.d2fd8c","type":"function","z":"ed8ad8d6.f11d18","name":"Text und Zeit ergänzen","func":"var newMsg = { payload: \"Anzahl Flugzeuge in HAJ \"+ msg.payload + \" angefragt \" + new Date() };\nreturn newMsg;\n","outputs":1,"noerr":0,"x":180,"y":880,"wires":[["e85c7dcd.ed493"]]},{"id":"5d6d053.86e5d7c","type":"mqtt out","z":"ed8ad8d6.f11d18","name":"pi-home","topic":"/Anzahl/Flugzeuge/Hannover","qos":"","retain":"","broker":"1e9e6c61.44b8bc","x":660,"y":480,"wires":[]},{"id":"fb1b30e4.eb3ab","type":"mqtt out","z":"ed8ad8d6.f11d18","name":"test.mosquitto.org","topic":"/Anzahl/Flugzeuge/Hannover","qos":"","retain":"","broker":"54baac58.75f87c","x":690,"y":540,"wires":[]},{"id":"d99db983.3c7738","type":"ThingspeakSendSimple","z":"ed8ad8d6.f11d18","name":"Thingspeak","writekey":"TKCAVQ7HJ2XDPP3G","fieldid":"1","x":670,"y":600,"wires":[]},{"id":"b62a4a29.30d9e","type":"ui_button","z":"ed8ad8d6.f11d18","name":"Anzahl Flugzeuge von Thingspeak abfragen","group":"c18727d3.1b7608","order":7,"width":"","height":"","label":"Anzahl Flugzeuge von Thingspeak abfragen","color":"","bgcolor":"","icon":"","payload":"timestamp","payloadType":"str","topic":"","x":210,"y":720,"wires":[["29e6b8a3.28453"]]},{"id":"132cc547.632033","type":"ui_text","z":"ed8ad8d6.f11d18","group":"c18727d3.1b7608","order":8,"width":0,"height":0,"name":"Thingspeak abfragen","label":"Anzahl Flugzeuge von Thingspeak:","format":"{{msg.payload}}","layout":"row-spread","x":540,"y":800,"wires":[]},{"id":"f763e32e.a3551","type":"twitter out","z":"ed8ad8d6.f11d18","twitter":"","name":"Tweet","x":650,"y":360,"wires":[]},{"id":"c18727d3.1b7608","type":"ui_group","z":"","name":"wenzlaff.info","tab":"a9e39ea1.b18f3","disp":false,"width":"6"},{"id":"1e9e6c61.44b8bc","type":"mqtt-broker","z":"","broker":"10.0.7.39","port":"1883","clientid":"pi-home","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"54baac58.75f87c","type":"mqtt-broker","z":"","broker":"test.mosquitto.org","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"a9e39ea1.b18f3","type":"ui_tab","z":"","name":"wenzlaff.info","icon":"dashboard"}]
IT-Berater

Flow Info

created 4 months, 3 weeks ago

Node Types

Core
  • comment (x2)
  • debug (x2)
  • function (x3)
  • http request (x2)
  • inject (x2)
  • mqtt out (x2)
  • mqtt-broker (x2)
  • twitter out (x1)
Other

Tags

  • DUMP1090
  • Thingspeak
  • MQTT
  • Wenzlaff.de
  • Wenzlaff.info
  • Kleinhirn.eu
  • Twitter
  • Aircraft
  • Count
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option