Plane spotting with Node-RED

and of course... don't forget the geofence node - could be useful as well. (for some definition of useful).

Here's a screen-shot of my color-coding, also altered the Group title to include the airport key.

1 Like

Keeps getting better. May as well add Luton and Southampton, and... (I guess exercise for the student :slight_smile:

1 Like

I assume IBM have their own private airfield at Hursley ???
Do you know the 3-letter code for it ???

1 Like

That would be HAH !
(as if)
though there is a private airstrip nearby - at 51.048647, -1.442973
(nothing to do with IBM)

2 Likes

@dynamicdave have you updated node-red-contrib-fligtradar24 to v0.0.7? One of the updates as to fix a issue @dceejay entered where speed was missing - however I just noticed Dave opened a new issue because of the invalid function name which happens depending on what other nodes are installed. Hopefully the author will clean it up quickly.

If you use a switch statement, you could group airports. For example:

switch (msg.payload.destination){
    case "BOS":  // Boston
       msg.payload.iconColor = "blue";
       break;
    case "PVD":  // Providence
       msg.payload.iconColor = "green";
       break;
    case "HYA":  // Hyanis
    case "OWD":  // Norwood
       msg.payload.iconColor = "purple";
       break;
    case "MIA":  // Miami
    case "FLL":  // Fort Laurdale
       msg.payload.iconColor = "yellow";
       break;
    case "JFK":  // JFK
    case "LGA":  // Laguadia
    case "EWR":  // Newark
       msg.payload.iconColor = "orange";
       break;
    case "DFW":  // Dallas
       msg.payload.iconColor = "brown";
       break;
    case "BWI":  // Baltimore
    case "DCA":  // Reagan
    case "IAD":  // Dulles
       msg.payload.iconColor = "black";
       break;
}

return msg;
1 Like

Thanks Paul - I had clean-forgotten about the Switch/Case construct as I only use it when I'm building Finite State Machines (FSMs).

I might explain this construct to the more advanced students at the IoT Club and see if they are capable of altering the code to implement a Switch/Case ladder.

I've added some buttons on the Dashboard to filter the aircraft displayed according to airport destination.
e.g. I can click a button labelled 'LGW' and just see all the aircraft heading to London Gatwick.

I'll post the flow later.

3 Likes

It is worth wrapping the code in each switch in a code block { ... } which will prevent some nasty, hard-to-find bugs. There was an article on it somewhere that I can't find off the top of my head I'm afraid.

As an ex, old-school COBOL programmer, switch/case statements are part of my deeply embedded psyche :older_man:

1 Like

Coming from (Turbo) Pascal moving to Python full time was a challenge for the lack of switch statements - although if/elif/else wasn’t too bad - and involved unlearning to rely on them for everything. It’s good to remember they do exist in JavaScript/ECMAScript :slight_smile:

1 Like

Thanks to everyone who has given me comments and suggestions for enhancements to the Plane Spotting project. Here's the revised flow and some screen-shots of filtering aircraft by airport destination.
I've also colour-keyed the UI-buttons and introduced some 'tooltips' to explain the 3-letter airport codes.

[{"id":"1185ed6d.9f64fb","type":"inject","z":"c7e0008b.a61528","name":"","topic":"","payload":"","payloadType":"date","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":150,"y":80,"wires":[["ce6384bb.7fd9e8"]]},{"id":"6e493d8c.4d607c","type":"debug","z":"c7e0008b.a61528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":690,"y":140,"wires":[]},{"id":"8a42f846.cde21","type":"worldmap","z":"c7e0008b.a61528","name":"","lat":"51.35","lon":"-0.87","zoom":"10","layer":"OSM grey","cluster":"0","maxage":"","usermenu":"show","layers":"show","panit":"false","hiderightclick":"false","coords":"none","path":"","x":1270,"y":180,"wires":[]},{"id":"dfdd7eaf.17e7b","type":"flightradar24","z":"c7e0008b.a61528","lat":"51.74","latType":"num","lon":"-0.4543","lonType":"num","name":"","x":510,"y":180,"wires":[["6e493d8c.4d607c","a3b58290.57dee"]]},{"id":"ee6bf048.2e39f8","type":"template","z":"c7e0008b.a61528","name":"Template Iframe align=middle ","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n<body style=\"background-color:MediumSeaGreen;\">\n<iframe src={{{payload}}}  height=\"625\" width=\"1108\"   ></iframe>\n</body>\n</html>\n","output":"str","x":570,"y":420,"wires":[["77031a1d.012e14"]]},{"id":"77031a1d.012e14","type":"ui_template","z":"c7e0008b.a61528","group":"1e3c302e.ea7338","name":"iFRAME","order":1,"width":"21","height":"12","format":"<div ng-bind-html=\"msg.payload | trusted\"></div>","storeOutMessages":false,"fwdInMessages":true,"templateScope":"local","x":800,"y":420,"wires":[[]]},{"id":"3485cb7c.7d6514","type":"function","z":"c7e0008b.a61528","name":"Build HTTP statement","func":"msg.payload = \"http://192.168.1.138:1880/worldmap\";\nreturn msg;\n","outputs":1,"noerr":0,"x":520,"y":360,"wires":[["ee6bf048.2e39f8"]]},{"id":"cd22bffb.ec6348","type":"inject","z":"c7e0008b.a61528","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":360,"wires":[["473a8d89.96c86c","42ccf4af.587cdc","dfdd7eaf.17e7b"]]},{"id":"574d211a.0c92e","type":"ui_button","z":"c7e0008b.a61528","name":"Free Run","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"Free Run","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":120,"y":140,"wires":[["3a0baaa1.142e6e"]]},{"id":"8a8577d3.8d92c8","type":"ui_button","z":"c7e0008b.a61528","name":"STOP","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"STOP","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":110,"y":200,"wires":[["b8d1cd1f.748228"]]},{"id":"c302638f.698c08","type":"ui_button","z":"c7e0008b.a61528","name":"Manual Update","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"Manual Update","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":140,"y":280,"wires":[["dfdd7eaf.17e7b"]]},{"id":"42ccf4af.587cdc","type":"function","z":"c7e0008b.a61528","name":"D","func":"flow.set(\"status\",\"stopped\");\nflow.set(\"filter\",\"none\");\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":400,"wires":[[]]},{"id":"473a8d89.96c86c","type":"delay","z":"c7e0008b.a61528","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":360,"wires":[["3485cb7c.7d6514"]]},{"id":"3a0baaa1.142e6e","type":"function","z":"c7e0008b.a61528","name":"B","func":"flow.set(\"status\",\"run\");\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":140,"wires":[[]]},{"id":"b8d1cd1f.748228","type":"function","z":"c7e0008b.a61528","name":"C","func":"flow.set(\"status\",\"stopped\");\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":200,"wires":[[]]},{"id":"ce6384bb.7fd9e8","type":"function","z":"c7e0008b.a61528","name":"A","func":"var status = flow.get(\"status\")||\"stopped\";\n\nif (status==\"run\") {\n   msg.payload = 1;\n   return msg;\n}","outputs":1,"noerr":0,"x":330,"y":80,"wires":[["dfdd7eaf.17e7b"]]},{"id":"a3b58290.57dee","type":"function","z":"c7e0008b.a61528","name":"Colour-code the destination airports","func":"if (msg.payload.destination == \"LHR\") {\n    msg.payload.iconColor = \"blue\";\n}\nelse if (msg.payload.destination == \"LGW\"){\n    msg.payload.iconColor = \"orange\";\n}\nelse if (msg.payload.destination == \"LCY\"){\n    msg.payload.iconColor = \"olive\";\n}\nelse if (msg.payload.destination == \"STN\"){\n    msg.payload.iconColor = \"green\";\n}\nelse if (msg.payload.destination == \"LTN\"){\n    msg.payload.iconColor = \"teal\";\n}\nelse if (msg.payload.destination == \"BHX\"){\n    msg.payload.iconColor = \"maroon\";\n}\nelse if (msg.payload.destination == \"BRS\"){\n    msg.payload.iconColor = \"plum\";\n}\nelse if (msg.payload.destination == \"EDI\"){\n    msg.payload.iconColor = \"chocolate\";\n}\nelse if (msg.payload.destination == \"GLA\"){\n    msg.payload.iconColor = \"coral\";\n}\nelse if (msg.payload.destination == \"CWL\"){\n    msg.payload.iconColor = \"gold\";\n}\nelse if (msg.payload.destination == \"SOU\"){\n    msg.payload.iconColor = \"tan\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":180,"wires":[["c171e176.370028","8a269de3.63ff2"]]},{"id":"316415cb.57ea5a","type":"ui_button","z":"c7e0008b.a61528","name":"No filter","group":"a977dccc.1c6208","order":1,"width":"3","height":"1","passthru":false,"label":"No filter","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"none","x":140,"y":520,"wires":[["16f61fdc.553fe8"]]},{"id":"37789d07.c2475a","type":"ui_button","z":"c7e0008b.a61528","name":"LHR","group":"a977dccc.1c6208","order":2,"width":"3","height":"1","passthru":false,"label":"LHR","tooltip":"London Heathrow airport","color":"","bgcolor":"blue","icon":"","payload":"1","payloadType":"num","topic":"LHR","x":130,"y":580,"wires":[["16f61fdc.553fe8"]]},{"id":"cf3b7df.b6574","type":"ui_button","z":"c7e0008b.a61528","name":"LGW","group":"a977dccc.1c6208","order":3,"width":"3","height":"1","passthru":false,"label":"LGW","tooltip":"London Gatwick airport","color":"","bgcolor":"orange","icon":"","payload":"1","payloadType":"num","topic":"LGW","x":130,"y":620,"wires":[["16f61fdc.553fe8"]]},{"id":"16f61fdc.553fe8","type":"function","z":"c7e0008b.a61528","name":"","func":"// flow.set(\"filter\",\"none\");\n\nflow.set(\"filter\",msg.topic);\nreturn msg;\n","outputs":1,"noerr":0,"x":390,"y":520,"wires":[["6f0d13f1.ec7a44"]]},{"id":"c171e176.370028","type":"function","z":"c7e0008b.a61528","name":"Filter the DEST","func":"var filter = flow.get(\"filter\") || \"none\";\n\nif ( (filter == \"none\") || (filter == msg.payload.destination) ) {\n   return msg;\n}\n","outputs":1,"noerr":0,"x":1060,"y":180,"wires":[["8a42f846.cde21","8803c86c.2b92d"]]},{"id":"8803c86c.2b92d","type":"debug","z":"c7e0008b.a61528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1270,"y":140,"wires":[]},{"id":"8a269de3.63ff2","type":"debug","z":"c7e0008b.a61528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1050,"y":140,"wires":[]},{"id":"6f0d13f1.ec7a44","type":"function","z":"c7e0008b.a61528","name":"Clear the map","func":"var command = {clear :(\"unknown\")};\nmsg.payload ={command};\n\n// msg.payload = {clear:(\"unknown\")};\n\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":520,"wires":[["8a42f846.cde21"]]},{"id":"3e5339e0.30388e","type":"ui_button","z":"c7e0008b.a61528","name":"STN","group":"a977dccc.1c6208","order":4,"width":"3","height":"1","passthru":false,"label":"STN","tooltip":"London Stanstead airport","color":"","bgcolor":"green","icon":"","payload":"1","payloadType":"num","topic":"STN","x":130,"y":660,"wires":[["16f61fdc.553fe8"]]},{"id":"7746a8ed.3a80d","type":"ui_button","z":"c7e0008b.a61528","name":"LTN","group":"a977dccc.1c6208","order":5,"width":"3","height":"1","passthru":false,"label":"LTN","tooltip":"Luton airport","color":"","bgcolor":"teal","icon":"","payload":"1","payloadType":"num","topic":"LTN","x":130,"y":700,"wires":[["16f61fdc.553fe8"]]},{"id":"2b804e61.db2292","type":"ui_button","z":"c7e0008b.a61528","name":"LCY","group":"a977dccc.1c6208","order":6,"width":"3","height":"1","passthru":false,"label":"LCY","tooltip":"London City airport","color":"","bgcolor":"olive","icon":"","payload":"1","payloadType":"num","topic":"LCY","x":130,"y":740,"wires":[["16f61fdc.553fe8"]]},{"id":"4e53717f.999c58","type":"ui_button","z":"c7e0008b.a61528","name":"BHX","group":"a977dccc.1c6208","order":7,"width":"3","height":"1","passthru":false,"label":"BHX","tooltip":"Birmingham airport","color":"","bgcolor":"maroon","icon":"","payload":"1","payloadType":"num","topic":"BHX","x":130,"y":780,"wires":[["16f61fdc.553fe8"]]},{"id":"60d80935.16d538","type":"ui_button","z":"c7e0008b.a61528","name":"BRS","group":"a977dccc.1c6208","order":8,"width":"3","height":"1","passthru":false,"label":"BRS","tooltip":"Bristol airport","color":"","bgcolor":"plum","icon":"","payload":"1","payloadType":"num","topic":"BRS","x":130,"y":820,"wires":[["16f61fdc.553fe8"]]},{"id":"68dfae6d.43c6e","type":"ui_button","z":"c7e0008b.a61528","name":"Clear Map","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"Clear Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"unknown","payloadType":"str","topic":"","x":710,"y":620,"wires":[["6f0d13f1.ec7a44"]]},{"id":"f5873f7e.db5118","type":"ui_button","z":"c7e0008b.a61528","name":"EDI","group":"a977dccc.1c6208","order":9,"width":"3","height":"1","passthru":false,"label":"EDI","tooltip":"Edingburgh airport","color":"","bgcolor":"chocolate","icon":"","payload":"1","payloadType":"num","topic":"EDI","x":130,"y":860,"wires":[["16f61fdc.553fe8"]]},{"id":"b006a031.4774e","type":"ui_button","z":"c7e0008b.a61528","name":"GLA","group":"a977dccc.1c6208","order":10,"width":"3","height":"1","passthru":false,"label":"GLA","tooltip":"Glasgow airport","color":"","bgcolor":"coral","icon":"","payload":"1","payloadType":"num","topic":"GLA","x":130,"y":900,"wires":[["16f61fdc.553fe8"]]},{"id":"7470ec9.45dee14","type":"ui_button","z":"c7e0008b.a61528","name":"CWL","group":"a977dccc.1c6208","order":11,"width":"3","height":"1","passthru":false,"label":"CWL","tooltip":"Cardiff airport","color":"","bgcolor":"gold","icon":"","payload":"1","payloadType":"num","topic":"CWL","x":130,"y":940,"wires":[["16f61fdc.553fe8"]]},{"id":"cbf30969.78e7d8","type":"ui_button","z":"c7e0008b.a61528","name":"SOU","group":"a977dccc.1c6208","order":12,"width":"3","height":"1","passthru":false,"label":"SOU","tooltip":"Southampton airport","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"SOU","x":130,"y":980,"wires":[["16f61fdc.553fe8"]]},{"id":"1e3c302e.ea7338","type":"ui_group","z":"","name":"Display Area","tab":"5459be96.5ac0a","order":3,"disp":true,"width":"21","collapse":false},{"id":"5ec3df82.345448","type":"ui_group","z":"","name":"Controls","tab":"5459be96.5ac0a","order":1,"disp":true,"width":"3","collapse":false},{"id":"a977dccc.1c6208","type":"ui_group","z":"","name":"Filter by Dest","tab":"5459be96.5ac0a","order":2,"disp":true,"width":"3","collapse":false},{"id":"5459be96.5ac0a","type":"ui_tab","z":"c7e0008b.a61528","name":"Flight Radar","icon":"language","order":1,"disabled":false,"hidden":false}]

9 Likes

Nice work, Dave!

One more embellishment (perhaps you have already thought about this one too): use different icons for aircraft loads/engines (perhaps five or so icons should be sufficient).

Kind regards.

P.S. I have been siphoning FlighAware 1090 feeds to trap certain models of aircraft. The FA code for the aircraft models is not a cent per cent fix for my solution but at least I get to know when the larger Antonov aircraft are in the neighborhood (very rare these days).

Hi @baqwas, thanks for that idea of filtering by A/C type.
Here's the revised, revised, revised flow and a screen-shot.

[{"id":"1185ed6d.9f64fb","type":"inject","z":"c7e0008b.a61528","name":"","topic":"","payload":"1","payloadType":"num","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":80,"wires":[["ce6384bb.7fd9e8"]]},{"id":"6e493d8c.4d607c","type":"debug","z":"c7e0008b.a61528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":690,"y":140,"wires":[]},{"id":"dfdd7eaf.17e7b","type":"flightradar24","z":"c7e0008b.a61528","lat":"51.74","latType":"num","lon":"-0.4543","lonType":"num","name":"","x":510,"y":180,"wires":[["6e493d8c.4d607c","a3b58290.57dee"]]},{"id":"574d211a.0c92e","type":"ui_button","z":"c7e0008b.a61528","name":"Free Run","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"Free Run","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":120,"y":140,"wires":[["3a0baaa1.142e6e"]]},{"id":"8a8577d3.8d92c8","type":"ui_button","z":"c7e0008b.a61528","name":"STOP","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"STOP","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":110,"y":200,"wires":[["b8d1cd1f.748228"]]},{"id":"c302638f.698c08","type":"ui_button","z":"c7e0008b.a61528","name":"Manual Update","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"Manual Update","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":140,"y":260,"wires":[["dfdd7eaf.17e7b"]]},{"id":"3a0baaa1.142e6e","type":"function","z":"c7e0008b.a61528","name":"B","func":"flow.set(\"status\",\"run\");\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":140,"wires":[[]]},{"id":"b8d1cd1f.748228","type":"function","z":"c7e0008b.a61528","name":"C","func":"flow.set(\"status\",\"stopped\");\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":200,"wires":[[]]},{"id":"ce6384bb.7fd9e8","type":"function","z":"c7e0008b.a61528","name":"A","func":"var status = flow.get(\"status\")||\"stopped\";\n\nif (status==\"run\") {\n   msg.payload = 1;\n   return msg;\n}","outputs":1,"noerr":0,"x":330,"y":80,"wires":[["dfdd7eaf.17e7b"]]},{"id":"a3b58290.57dee","type":"function","z":"c7e0008b.a61528","name":"Colour-code the destination airports","func":"if (msg.payload.destination == \"LHR\") {\n    msg.payload.iconColor = \"blue\";\n}\nelse if (msg.payload.destination == \"LGW\"){\n    msg.payload.iconColor = \"orange\";\n}\nelse if (msg.payload.destination == \"LCY\"){\n    msg.payload.iconColor = \"olive\";\n}\nelse if (msg.payload.destination == \"STN\"){\n    msg.payload.iconColor = \"green\";\n}\nelse if (msg.payload.destination == \"LTN\"){\n    msg.payload.iconColor = \"teal\";\n}\nelse if (msg.payload.destination == \"BHX\"){\n    msg.payload.iconColor = \"maroon\";\n}\nelse if (msg.payload.destination == \"BRS\"){\n    msg.payload.iconColor = \"plum\";\n}\nelse if (msg.payload.destination == \"EDI\"){\n    msg.payload.iconColor = \"chocolate\";\n}\nelse if (msg.payload.destination == \"GLA\"){\n    msg.payload.iconColor = \"coral\";\n}\nelse if (msg.payload.destination == \"CWL\"){\n    msg.payload.iconColor = \"gold\";\n}\nelse if (msg.payload.destination == \"SOU\"){\n    msg.payload.iconColor = \"LightSkyBlue\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":180,"wires":[["c171e176.370028","8a269de3.63ff2"]]},{"id":"316415cb.57ea5a","type":"ui_button","z":"c7e0008b.a61528","name":"No filter","group":"a977dccc.1c6208","order":1,"width":"3","height":"1","passthru":false,"label":"No filter","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"none","x":120,"y":400,"wires":[["16f61fdc.553fe8"]]},{"id":"37789d07.c2475a","type":"ui_button","z":"c7e0008b.a61528","name":"LHR","group":"a977dccc.1c6208","order":2,"width":"3","height":"1","passthru":false,"label":"LHR","tooltip":"London Heathrow airport","color":"","bgcolor":"blue","icon":"","payload":"1","payloadType":"num","topic":"LHR","x":110,"y":460,"wires":[["16f61fdc.553fe8"]]},{"id":"cf3b7df.b6574","type":"ui_button","z":"c7e0008b.a61528","name":"LGW","group":"a977dccc.1c6208","order":3,"width":"3","height":"1","passthru":false,"label":"LGW","tooltip":"London Gatwick airport","color":"","bgcolor":"orange","icon":"","payload":"1","payloadType":"num","topic":"LGW","x":110,"y":500,"wires":[["16f61fdc.553fe8"]]},{"id":"16f61fdc.553fe8","type":"function","z":"c7e0008b.a61528","name":"","func":"// flow.set(\"filter\",\"none\");\n\nflow.set(\"filter\",msg.topic);\nreturn msg;\n","outputs":1,"noerr":0,"x":310,"y":400,"wires":[["6f0d13f1.ec7a44"]]},{"id":"c171e176.370028","type":"function","z":"c7e0008b.a61528","name":"Filter the DEST","func":"var filter = flow.get(\"filter\") || \"none\";\n\nif ( (filter == \"none\") || (filter == msg.payload.destination) ) {\n   return msg;\n}\n","outputs":1,"noerr":0,"x":1060,"y":180,"wires":[["c73c08af.e617c"]]},{"id":"8803c86c.2b92d","type":"debug","z":"c7e0008b.a61528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1490,"y":140,"wires":[]},{"id":"8a269de3.63ff2","type":"debug","z":"c7e0008b.a61528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1050,"y":140,"wires":[]},{"id":"6f0d13f1.ec7a44","type":"function","z":"c7e0008b.a61528","name":"Clear the map","func":"var command = {clear :(\"unknown\")};\nmsg.payload ={command};\n\n// msg.payload = {clear:(\"unknown\")};\n\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":320,"wires":[["f7da8b43.220128"]]},{"id":"3e5339e0.30388e","type":"ui_button","z":"c7e0008b.a61528","name":"STN","group":"a977dccc.1c6208","order":4,"width":"3","height":"1","passthru":false,"label":"STN","tooltip":"London Stanstead airport","color":"","bgcolor":"green","icon":"","payload":"1","payloadType":"num","topic":"STN","x":110,"y":540,"wires":[["16f61fdc.553fe8"]]},{"id":"7746a8ed.3a80d","type":"ui_button","z":"c7e0008b.a61528","name":"LTN","group":"a977dccc.1c6208","order":5,"width":"3","height":"1","passthru":false,"label":"LTN","tooltip":"Luton airport","color":"","bgcolor":"teal","icon":"","payload":"1","payloadType":"num","topic":"LTN","x":110,"y":580,"wires":[["16f61fdc.553fe8"]]},{"id":"2b804e61.db2292","type":"ui_button","z":"c7e0008b.a61528","name":"LCY","group":"a977dccc.1c6208","order":6,"width":"3","height":"1","passthru":false,"label":"LCY","tooltip":"London City airport","color":"","bgcolor":"olive","icon":"","payload":"1","payloadType":"num","topic":"LCY","x":110,"y":620,"wires":[["16f61fdc.553fe8"]]},{"id":"4e53717f.999c58","type":"ui_button","z":"c7e0008b.a61528","name":"BHX","group":"a977dccc.1c6208","order":7,"width":"3","height":"1","passthru":false,"label":"BHX","tooltip":"Birmingham airport","color":"","bgcolor":"maroon","icon":"","payload":"1","payloadType":"num","topic":"BHX","x":110,"y":660,"wires":[["16f61fdc.553fe8"]]},{"id":"60d80935.16d538","type":"ui_button","z":"c7e0008b.a61528","name":"BRS","group":"a977dccc.1c6208","order":8,"width":"3","height":"1","passthru":false,"label":"BRS","tooltip":"Bristol airport","color":"","bgcolor":"plum","icon":"","payload":"1","payloadType":"num","topic":"BRS","x":110,"y":700,"wires":[["16f61fdc.553fe8"]]},{"id":"68dfae6d.43c6e","type":"ui_button","z":"c7e0008b.a61528","name":"Clear Map","group":"5ec3df82.345448","order":1,"width":"3","height":"1","passthru":false,"label":"Clear Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"unknown","payloadType":"str","topic":"","x":130,"y":320,"wires":[["6f0d13f1.ec7a44"]]},{"id":"f5873f7e.db5118","type":"ui_button","z":"c7e0008b.a61528","name":"EDI","group":"a977dccc.1c6208","order":9,"width":"3","height":"1","passthru":false,"label":"EDI","tooltip":"Edingburgh airport","color":"","bgcolor":"chocolate","icon":"","payload":"1","payloadType":"num","topic":"EDI","x":110,"y":740,"wires":[["16f61fdc.553fe8"]]},{"id":"b006a031.4774e","type":"ui_button","z":"c7e0008b.a61528","name":"GLA","group":"a977dccc.1c6208","order":10,"width":"3","height":"1","passthru":false,"label":"GLA","tooltip":"Glasgow airport","color":"","bgcolor":"coral","icon":"","payload":"1","payloadType":"num","topic":"GLA","x":110,"y":780,"wires":[["16f61fdc.553fe8"]]},{"id":"7470ec9.45dee14","type":"ui_button","z":"c7e0008b.a61528","name":"CWL","group":"a977dccc.1c6208","order":11,"width":"3","height":"1","passthru":false,"label":"CWL","tooltip":"Cardiff airport","color":"","bgcolor":"gold","icon":"","payload":"1","payloadType":"num","topic":"CWL","x":110,"y":820,"wires":[["16f61fdc.553fe8"]]},{"id":"cbf30969.78e7d8","type":"ui_button","z":"c7e0008b.a61528","name":"SOU","group":"a977dccc.1c6208","order":12,"width":"3","height":"1","passthru":false,"label":"SOU","tooltip":"Southampton airport","color":"","bgcolor":"LightSkyBlue","icon":"","payload":"1","payloadType":"num","topic":"SOU","x":110,"y":860,"wires":[["16f61fdc.553fe8"]]},{"id":"5e0949f5.66b528","type":"function","z":"c7e0008b.a61528","name":"","func":"// flow.set(\"filter\",\"none\");\n\nflow.set(\"filter_ac_type\",msg.topic);\nreturn msg;\n","outputs":1,"noerr":0,"x":670,"y":460,"wires":[["6f0d13f1.ec7a44"]]},{"id":"8d53499c.0bdd6","type":"ui_button","z":"c7e0008b.a61528","name":"No filter","group":"10612dab.364f02","order":1,"width":"3","height":"1","passthru":false,"label":"No filter","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"none","x":500,"y":460,"wires":[["5e0949f5.66b528"]]},{"id":"b0cb1b02.840b88","type":"ui_button","z":"c7e0008b.a61528","name":"A320","group":"10612dab.364f02","order":5,"width":"3","height":"1","passthru":false,"label":"A320","tooltip":"A320","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A320","x":490,"y":600,"wires":[["5e0949f5.66b528"]]},{"id":"1bd97cd.f1e6d03","type":"ui_button","z":"c7e0008b.a61528","name":"A319","group":"10612dab.364f02","order":4,"width":"3","height":"1","passthru":false,"label":"A319","tooltip":"A319","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A319","x":490,"y":560,"wires":[["5e0949f5.66b528"]]},{"id":"b3a1b2c5.9aac38","type":"ui_button","z":"c7e0008b.a61528","name":"E190","group":"10612dab.364f02","order":11,"width":"3","height":"1","passthru":false,"label":"E190","tooltip":"E190","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"E190","x":490,"y":520,"wires":[["5e0949f5.66b528"]]},{"id":"905632e6.246e1","type":"ui_button","z":"c7e0008b.a61528","name":"A321","group":"10612dab.364f02","order":6,"width":"3","height":"1","passthru":false,"label":"A321","tooltip":"A321","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A321","x":490,"y":640,"wires":[["5e0949f5.66b528"]]},{"id":"3c1725ea.ab084a","type":"ui_button","z":"c7e0008b.a61528","name":"A333","group":"10612dab.364f02","order":7,"width":"3","height":"1","passthru":false,"label":"A333","tooltip":"A333","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A333","x":490,"y":680,"wires":[["5e0949f5.66b528"]]},{"id":"631e0f03.a29288","type":"ui_button","z":"c7e0008b.a61528","name":"B738","group":"10612dab.364f02","order":8,"width":"3","height":"1","passthru":false,"label":"B738","tooltip":"B738","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"B738","x":490,"y":720,"wires":[["5e0949f5.66b528"]]},{"id":"c73c08af.e617c","type":"function","z":"c7e0008b.a61528","name":"Filter by A/C type","func":"var filter = flow.get(\"filter_ac_type\") || \"none\";\n\nif ( (filter == \"none\") || (filter == msg.payload.model) ) {\n   return msg;\n}\n","outputs":1,"noerr":0,"x":1270,"y":180,"wires":[["8803c86c.2b92d","f7da8b43.220128"]]},{"id":"f7da8b43.220128","type":"ui_worldmap","z":"c7e0008b.a61528","group":"1e3c302e.ea7338","order":0,"width":"21","height":"12","name":"","lat":"51.35","lon":"-0.87","zoom":"10","layer":"OSM grey","cluster":"","maxage":"","usermenu":"hide","layers":"hide","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"true","coords":"none","showgrid":"false","path":"/worldmap","x":1480,"y":180,"wires":[]},{"id":"b9b25eeb.f32898","type":"ui_button","z":"c7e0008b.a61528","name":"A20N","group":"10612dab.364f02","order":2,"width":"3","height":"1","passthru":false,"label":"A20N","tooltip":"A20N","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A20N","x":490,"y":760,"wires":[["5e0949f5.66b528"]]},{"id":"dca6b1be.c0e4b","type":"ui_button","z":"c7e0008b.a61528","name":"MD11","group":"10612dab.364f02","order":12,"width":"3","height":"1","passthru":false,"label":"MD11","tooltip":"MD11","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"MD11","x":490,"y":800,"wires":[["5e0949f5.66b528"]]},{"id":"41f2ab28.98c8b4","type":"ui_button","z":"c7e0008b.a61528","name":"E145","group":"10612dab.364f02","order":10,"width":"3","height":"1","passthru":false,"label":"E145","tooltip":"E145","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"E145","x":490,"y":840,"wires":[["5e0949f5.66b528"]]},{"id":"474d1fff.d4d4a","type":"ui_button","z":"c7e0008b.a61528","name":"C208","group":"10612dab.364f02","order":9,"width":"3","height":"1","passthru":false,"label":"C208","tooltip":"C208","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"C208","x":490,"y":880,"wires":[["5e0949f5.66b528"]]},{"id":"e14224b8.1983f8","type":"ui_button","z":"c7e0008b.a61528","name":"AS65","group":"10612dab.364f02","order":3,"width":"3","height":"1","passthru":false,"label":"AS65","tooltip":"AS65","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"AS65","x":490,"y":920,"wires":[["5e0949f5.66b528"]]},{"id":"cf368531.f7a098","type":"inject","z":"c7e0008b.a61528","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":40,"wires":[["1116248a.64d95b"]]},{"id":"1116248a.64d95b","type":"function","z":"c7e0008b.a61528","name":"Set IC","func":"flow.set(\"status\",\"stopped\");\nflow.set(\"filter\",\"none\");\nflow.set(\"filter_ac_type\",\"none\");\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":40,"wires":[[]]},{"id":"5ec3df82.345448","type":"ui_group","z":"","name":"Controls","tab":"5459be96.5ac0a","order":1,"disp":true,"width":"3","collapse":false},{"id":"a977dccc.1c6208","type":"ui_group","z":"","name":"Filter by Dest","tab":"5459be96.5ac0a","order":3,"disp":true,"width":"3","collapse":false},{"id":"10612dab.364f02","type":"ui_group","z":"","name":"Filter by A/C type","tab":"5459be96.5ac0a","order":2,"disp":true,"width":"3","collapse":false},{"id":"1e3c302e.ea7338","type":"ui_group","z":"","name":"Display Area","tab":"5459be96.5ac0a","order":4,"disp":true,"width":"21","collapse":false},{"id":"5459be96.5ac0a","type":"ui_tab","z":"c7e0008b.a61528","name":"Flight Radar","icon":"language","order":1,"disabled":false,"hidden":false}]

You need to click 'FREERUN and both NO FILTER buttons then click the appropriate aircraft model filter.

2 Likes

Well here is what your flow results in on my mac and on a Pi (installed it on both).


the map does show fine at my-ip:1880/worldmap but without the controls

Couple of things...

  • Just had to even up the number of items in the two selection-columns (probably my ADHD problem surfacing again - ha, ha, ha).
  • Incorporated @dceejay UI_worldmap widget to simplify the flow (thanks to Dave for this widget).
[{"id":"1ee01e32.393092","type":"inject","z":"6f55cf96.9193d8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":142,"y":121,"wires":[["db147a8e.696fa"]]},{"id":"d2cd9acf.3ef948","type":"debug","z":"6f55cf96.9193d8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":702,"y":181,"wires":[]},{"id":"a862b87.dbc3b48","type":"flightradar24","z":"6f55cf96.9193d8","lat":"51.74","latType":"num","lon":"-0.4543","lonType":"num","name":"","x":522,"y":221,"wires":[["d2cd9acf.3ef948","a93aa698.e447f8"]]},{"id":"ef5dcc1e.837f88","type":"ui_button","z":"6f55cf96.9193d8","name":"Free Run","group":"5c290e82.8cddd8","order":1,"width":"3","height":"1","passthru":false,"label":"Free Run","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":132,"y":181,"wires":[["88470d1a.3bfb2"]]},{"id":"9e2cd46e.0ed528","type":"ui_button","z":"6f55cf96.9193d8","name":"STOP","group":"5c290e82.8cddd8","order":1,"width":"3","height":"1","passthru":false,"label":"STOP","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":122,"y":241,"wires":[["d642aa27.d4cc9"]]},{"id":"dd28eda5.6698f","type":"ui_button","z":"6f55cf96.9193d8","name":"Manual Update","group":"5c290e82.8cddd8","order":1,"width":"3","height":"1","passthru":false,"label":"Manual Update","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":152,"y":301,"wires":[["a862b87.dbc3b48"]]},{"id":"88470d1a.3bfb2","type":"function","z":"6f55cf96.9193d8","name":"B","func":"flow.set(\"status\",\"run\");\nreturn msg;","outputs":1,"noerr":0,"x":282,"y":181,"wires":[[]]},{"id":"d642aa27.d4cc9","type":"function","z":"6f55cf96.9193d8","name":"C","func":"flow.set(\"status\",\"stopped\");\nreturn msg;","outputs":1,"noerr":0,"x":282,"y":241,"wires":[[]]},{"id":"db147a8e.696fa","type":"function","z":"6f55cf96.9193d8","name":"A","func":"var status = flow.get(\"status\")||\"stopped\";\n\nif (status==\"run\") {\n   msg.payload = 1;\n   return msg;\n}","outputs":1,"noerr":0,"x":342,"y":121,"wires":[["a862b87.dbc3b48"]]},{"id":"a93aa698.e447f8","type":"function","z":"6f55cf96.9193d8","name":"Colour-code the destination airports","func":"if (msg.payload.destination == \"LHR\") {\n    msg.payload.iconColor = \"blue\";\n}\nelse if (msg.payload.destination == \"LGW\"){\n    msg.payload.iconColor = \"orange\";\n}\nelse if (msg.payload.destination == \"LCY\"){\n    msg.payload.iconColor = \"olive\";\n}\nelse if (msg.payload.destination == \"STN\"){\n    msg.payload.iconColor = \"green\";\n}\nelse if (msg.payload.destination == \"LTN\"){\n    msg.payload.iconColor = \"teal\";\n}\nelse if (msg.payload.destination == \"BHX\"){\n    msg.payload.iconColor = \"maroon\";\n}\nelse if (msg.payload.destination == \"BRS\"){\n    msg.payload.iconColor = \"plum\";\n}\nelse if (msg.payload.destination == \"EDI\"){\n    msg.payload.iconColor = \"chocolate\";\n}\nelse if (msg.payload.destination == \"GLA\"){\n    msg.payload.iconColor = \"coral\";\n}\nelse if (msg.payload.destination == \"CWL\"){\n    msg.payload.iconColor = \"gold\";\n}\nelse if (msg.payload.destination == \"SOU\"){\n    msg.payload.iconColor = \"LightSkyBlue\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":782,"y":221,"wires":[["68fe6d4b.5ac804","a476de12.414308"]]},{"id":"24edd992.d60d2e","type":"ui_button","z":"6f55cf96.9193d8","name":"No filter","group":"46f034a6.da814c","order":1,"width":"3","height":"1","passthru":false,"label":"No filter","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"none","x":132,"y":441,"wires":[["ed69d375.f6c038"]]},{"id":"e4ff1e27.4fa758","type":"ui_button","z":"6f55cf96.9193d8","name":"LHR","group":"46f034a6.da814c","order":2,"width":"3","height":"1","passthru":false,"label":"LHR","tooltip":"London Heathrow airport","color":"","bgcolor":"blue","icon":"","payload":"1","payloadType":"num","topic":"LHR","x":122,"y":501,"wires":[["ed69d375.f6c038"]]},{"id":"aca8992e.9db8c8","type":"ui_button","z":"6f55cf96.9193d8","name":"LGW","group":"46f034a6.da814c","order":3,"width":"3","height":"1","passthru":false,"label":"LGW","tooltip":"London Gatwick airport","color":"","bgcolor":"orange","icon":"","payload":"1","payloadType":"num","topic":"LGW","x":122,"y":541,"wires":[["ed69d375.f6c038"]]},{"id":"ed69d375.f6c038","type":"function","z":"6f55cf96.9193d8","name":"","func":"// flow.set(\"filter\",\"none\");\n\nflow.set(\"filter\",msg.topic);\nreturn msg;\n","outputs":1,"noerr":0,"x":322,"y":441,"wires":[["37d3ced7.0e004a"]]},{"id":"68fe6d4b.5ac804","type":"function","z":"6f55cf96.9193d8","name":"Filter the DEST","func":"var filter = flow.get(\"filter\") || \"none\";\n\nif ( (filter == \"none\") || (filter == msg.payload.destination) ) {\n   return msg;\n}\n","outputs":1,"noerr":0,"x":1072,"y":221,"wires":[["4ba7f911.aa21c"]]},{"id":"b0efec8b.689598","type":"debug","z":"6f55cf96.9193d8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1502,"y":181,"wires":[]},{"id":"a476de12.414308","type":"debug","z":"6f55cf96.9193d8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1062,"y":181,"wires":[]},{"id":"37d3ced7.0e004a","type":"function","z":"6f55cf96.9193d8","name":"Clear the map","func":"var command = {clear :(\"unknown\")};\nmsg.payload ={command};\n\n// msg.payload = {clear:(\"unknown\")};\n\nreturn msg;","outputs":1,"noerr":0,"x":872,"y":361,"wires":[["a39466ee.0f6b88"]]},{"id":"7b876368.cf19bc","type":"ui_button","z":"6f55cf96.9193d8","name":"STN","group":"46f034a6.da814c","order":4,"width":"3","height":"1","passthru":false,"label":"STN","tooltip":"London Stanstead airport","color":"","bgcolor":"green","icon":"","payload":"1","payloadType":"num","topic":"STN","x":122,"y":581,"wires":[["ed69d375.f6c038"]]},{"id":"d0437772.b2964","type":"ui_button","z":"6f55cf96.9193d8","name":"LTN","group":"46f034a6.da814c","order":5,"width":"3","height":"1","passthru":false,"label":"LTN","tooltip":"Luton airport","color":"","bgcolor":"teal","icon":"","payload":"1","payloadType":"num","topic":"LTN","x":122,"y":621,"wires":[["ed69d375.f6c038"]]},{"id":"ffcf37ef.9fe52","type":"ui_button","z":"6f55cf96.9193d8","name":"LCY","group":"46f034a6.da814c","order":6,"width":"3","height":"1","passthru":false,"label":"LCY","tooltip":"London City airport","color":"","bgcolor":"olive","icon":"","payload":"1","payloadType":"num","topic":"LCY","x":122,"y":661,"wires":[["ed69d375.f6c038"]]},{"id":"78cd464b.66e85","type":"ui_button","z":"6f55cf96.9193d8","name":"BHX","group":"46f034a6.da814c","order":7,"width":"3","height":"1","passthru":false,"label":"BHX","tooltip":"Birmingham airport","color":"","bgcolor":"maroon","icon":"","payload":"1","payloadType":"num","topic":"BHX","x":122,"y":701,"wires":[["ed69d375.f6c038"]]},{"id":"8eec0d44.2b482","type":"ui_button","z":"6f55cf96.9193d8","name":"BRS","group":"46f034a6.da814c","order":8,"width":"3","height":"1","passthru":false,"label":"BRS","tooltip":"Bristol airport","color":"","bgcolor":"plum","icon":"","payload":"1","payloadType":"num","topic":"BRS","x":122,"y":741,"wires":[["ed69d375.f6c038"]]},{"id":"31eafd5b.5dd2ba","type":"ui_button","z":"6f55cf96.9193d8","name":"Clear Map","group":"5c290e82.8cddd8","order":1,"width":"3","height":"1","passthru":false,"label":"Clear Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"unknown","payloadType":"str","topic":"","x":142,"y":361,"wires":[["37d3ced7.0e004a"]]},{"id":"566bc67.cdf73b8","type":"ui_button","z":"6f55cf96.9193d8","name":"EDI","group":"46f034a6.da814c","order":9,"width":"3","height":"1","passthru":false,"label":"EDI","tooltip":"Edingburgh airport","color":"","bgcolor":"chocolate","icon":"","payload":"1","payloadType":"num","topic":"EDI","x":122,"y":781,"wires":[["ed69d375.f6c038"]]},{"id":"2ec24299.5b6bde","type":"ui_button","z":"6f55cf96.9193d8","name":"GLA","group":"46f034a6.da814c","order":10,"width":"3","height":"1","passthru":false,"label":"GLA","tooltip":"Glasgow airport","color":"","bgcolor":"coral","icon":"","payload":"1","payloadType":"num","topic":"GLA","x":122,"y":821,"wires":[["ed69d375.f6c038"]]},{"id":"3d795efb.2038a2","type":"ui_button","z":"6f55cf96.9193d8","name":"CWL","group":"46f034a6.da814c","order":11,"width":"3","height":"1","passthru":false,"label":"CWL","tooltip":"Cardiff airport","color":"","bgcolor":"gold","icon":"","payload":"1","payloadType":"num","topic":"CWL","x":122,"y":861,"wires":[["ed69d375.f6c038"]]},{"id":"610bc20f.611834","type":"ui_button","z":"6f55cf96.9193d8","name":"SOU","group":"46f034a6.da814c","order":12,"width":"3","height":"1","passthru":false,"label":"SOU","tooltip":"Southampton airport","color":"","bgcolor":"LightSkyBlue","icon":"","payload":"1","payloadType":"num","topic":"SOU","x":122,"y":901,"wires":[["ed69d375.f6c038"]]},{"id":"a3f9d757.a786a","type":"function","z":"6f55cf96.9193d8","name":"","func":"// flow.set(\"filter\",\"none\");\n\nflow.set(\"filter_ac_type\",msg.topic);\nreturn msg;\n","outputs":1,"noerr":0,"x":682,"y":501,"wires":[["37d3ced7.0e004a"]]},{"id":"495a7e90.e594d8","type":"ui_button","z":"6f55cf96.9193d8","name":"No filter","group":"2ac96fe6.f53378","order":1,"width":"3","height":"1","passthru":false,"label":"No filter","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"none","x":512,"y":501,"wires":[["a3f9d757.a786a"]]},{"id":"93ae8700.b9cb8","type":"ui_button","z":"6f55cf96.9193d8","name":"A320","group":"2ac96fe6.f53378","order":5,"width":"3","height":"1","passthru":false,"label":"A320","tooltip":"A320","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A320","x":502,"y":641,"wires":[["a3f9d757.a786a"]]},{"id":"10d4e9dd.bdb25e","type":"ui_button","z":"6f55cf96.9193d8","name":"A319","group":"2ac96fe6.f53378","order":4,"width":"3","height":"1","passthru":false,"label":"A319","tooltip":"A319","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A319","x":502,"y":601,"wires":[["a3f9d757.a786a"]]},{"id":"fd2178b9.d0b988","type":"ui_button","z":"6f55cf96.9193d8","name":"E190","group":"2ac96fe6.f53378","order":11,"width":"3","height":"1","passthru":false,"label":"E190","tooltip":"E190","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"E190","x":502,"y":561,"wires":[["a3f9d757.a786a"]]},{"id":"fcaea854.516ca8","type":"ui_button","z":"6f55cf96.9193d8","name":"A321","group":"2ac96fe6.f53378","order":6,"width":"3","height":"1","passthru":false,"label":"A321","tooltip":"A321","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A321","x":502,"y":681,"wires":[["a3f9d757.a786a"]]},{"id":"9a394e66.2505f","type":"ui_button","z":"6f55cf96.9193d8","name":"A333","group":"2ac96fe6.f53378","order":7,"width":"3","height":"1","passthru":false,"label":"A333","tooltip":"A333","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A333","x":502,"y":721,"wires":[["a3f9d757.a786a"]]},{"id":"a915d000.3f88c8","type":"ui_button","z":"6f55cf96.9193d8","name":"B738","group":"2ac96fe6.f53378","order":8,"width":"3","height":"1","passthru":false,"label":"B738","tooltip":"B738","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"B738","x":502,"y":761,"wires":[["a3f9d757.a786a"]]},{"id":"4ba7f911.aa21c","type":"function","z":"6f55cf96.9193d8","name":"Filter by A/C type","func":"var filter = flow.get(\"filter_ac_type\") || \"none\";\n\nif ( (filter == \"none\") || (filter == msg.payload.model) ) {\n   return msg;\n}\n","outputs":1,"noerr":0,"x":1282,"y":221,"wires":[["b0efec8b.689598","a39466ee.0f6b88"]]},{"id":"a39466ee.0f6b88","type":"ui_worldmap","z":"6f55cf96.9193d8","group":"566a7576.13c14c","order":0,"width":"21","height":"12","name":"","lat":"51.35","lon":"-0.87","zoom":"10","layer":"OSM grey","cluster":"","maxage":"","usermenu":"hide","layers":"hide","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"true","coords":"none","showgrid":"false","path":"/worldmap","x":1492,"y":221,"wires":[]},{"id":"d162bce9.bae158","type":"ui_button","z":"6f55cf96.9193d8","name":"A20N","group":"2ac96fe6.f53378","order":2,"width":"3","height":"1","passthru":false,"label":"A20N","tooltip":"A20N","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"A20N","x":502,"y":801,"wires":[["a3f9d757.a786a"]]},{"id":"9710fd43.654ad8","type":"ui_button","z":"6f55cf96.9193d8","name":"MD11","group":"2ac96fe6.f53378","order":12,"width":"3","height":"1","passthru":false,"label":"MD11","tooltip":"MD11","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"MD11","x":502,"y":841,"wires":[["a3f9d757.a786a"]]},{"id":"55096c59.abd28c","type":"ui_button","z":"6f55cf96.9193d8","name":"E145","group":"2ac96fe6.f53378","order":10,"width":"3","height":"1","passthru":false,"label":"E145","tooltip":"E145","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"E145","x":502,"y":881,"wires":[["a3f9d757.a786a"]]},{"id":"dbe3e390.975c78","type":"ui_button","z":"6f55cf96.9193d8","name":"C208","group":"2ac96fe6.f53378","order":9,"width":"3","height":"1","passthru":false,"label":"C208","tooltip":"C208","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"C208","x":502,"y":921,"wires":[["a3f9d757.a786a"]]},{"id":"117b058f.cacee2","type":"ui_button","z":"6f55cf96.9193d8","name":"AS65","group":"2ac96fe6.f53378","order":3,"width":"3","height":"1","passthru":false,"label":"AS65","tooltip":"AS65","color":"","bgcolor":"tan","icon":"","payload":"1","payloadType":"num","topic":"AS65","x":502,"y":961,"wires":[["a3f9d757.a786a"]]},{"id":"ff0563c7.fb819","type":"inject","z":"6f55cf96.9193d8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":142,"y":81,"wires":[["253a6c17.326ce4"]]},{"id":"253a6c17.326ce4","type":"function","z":"6f55cf96.9193d8","name":"Set IC","func":"flow.set(\"status\",\"stopped\");\nflow.set(\"filter\",\"none\");\nflow.set(\"filter_ac_type\",\"none\");\nreturn msg;","outputs":1,"noerr":0,"x":342,"y":81,"wires":[[]]},{"id":"68ac7eb.b42a48","type":"ui_template","z":"6f55cf96.9193d8","group":"4ab9724d.ef034c","name":"","order":8,"width":0,"height":0,"format":"<style>\n.masonry-container {\n    width: 1600px;\n}\n</style>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":540,"y":40,"wires":[[]]},{"id":"94c3e3e0.3483c8","type":"ui_template","z":"6f55cf96.9193d8","group":"542be730.29f758","name":"","order":0,"width":0,"height":0,"format":"<style>\nbody.nr-dashboard-theme {\n    font-size: 14px !important;\n}\n.md-toolbar-tools h1 {\n    font-size: 20px !important;\n}\n</style>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"global","x":540,"y":120,"wires":[[]]},{"id":"5c290e82.8cddd8","type":"ui_group","z":"","name":"Controls","tab":"1c0f0262.6bb80e","order":1,"disp":true,"width":"3","collapse":false},{"id":"46f034a6.da814c","type":"ui_group","z":"","name":"Filter by Dest","tab":"1c0f0262.6bb80e","order":3,"disp":true,"width":"3","collapse":false},{"id":"2ac96fe6.f53378","type":"ui_group","z":"","name":"Filter by A/C type","tab":"1c0f0262.6bb80e","order":2,"disp":true,"width":"3","collapse":false},{"id":"566a7576.13c14c","type":"ui_group","z":"","name":"Display Area","tab":"1c0f0262.6bb80e","order":4,"disp":true,"width":"21","collapse":false},{"id":"4ab9724d.ef034c","type":"ui_group","z":"","name":"Shutdown the various servers","tab":"a2efca21.4f31a8","order":1,"disp":true,"width":"5","collapse":false},{"id":"542be730.29f758","type":"ui_group","z":"","name":"Default","tab":"b6520f83.fe4fc8","disp":true,"width":"6","collapse":true},{"id":"1c0f0262.6bb80e","type":"ui_tab","z":"6f55cf96.9193d8","name":"Flight Radar","icon":"language","order":1,"disabled":false,"hidden":false},{"id":"a2efca21.4f31a8","type":"ui_tab","z":"","name":"Server control centre","icon":"dashboard","order":3,"disabled":false,"hidden":false},{"id":"b6520f83.fe4fc8","type":"ui_tab","z":"","name":"SMART Home - weather forecast","icon":"dashboard","order":8}]

Setting the buttons and group for the A/C type and Destination from 3 blocks to 2 makes it fit better on my screen.

Hello dynamicdave,

Appreciate testing the suggestion. Looks just like the map that I would like on one of the spare terminals. Very nice.

Sorry, for not replying earlier. As you may have guessed - too many other challenges elsewhere.

I understand that you are a Flight Radar person but perhaps you could drop a note to FlightAware demonstrating your achievement. I am sure that the readers there too would like your work.

Kind regards.

Hello, I'm just a beginner and I'm looking for some help: is there a possibility to change dynamical (e.g. with a node red function) the coordinates of the flightradar24 node red node. I tried something like sending msg.payload.lat to the flightradar24 node but it remained the same center coordinates. Happy to get any advice on how to do that. Thank you!

Hi - as it happens I was just playing with a different api - from Opensky - and that lets you call the api with a set of boundaries - so this flow gets all the planes in the view in the map.

NOTE: the OpenSky Network only seems to have commercial flights... some apis seem to have some more flights like some mil ones.

[{"id":"f8ce24246794a0f0","type":"worldmap","z":"c31385261656417b","name":"","lat":"","lon":"","zoom":"","layer":"","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"false","showgrid":"false","allowFileDrop":"false","path":"/worldmap","overlist":"DR,CO,RA,DN,HM","maplist":"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS,SW","mapname":"","mapurl":"","mapopt":"","mapwms":false,"x":870,"y":450,"wires":[]},{"id":"f8f66972.c46d98","type":"function","z":"c31385261656417b","name":"flights filter func","func":"\nmsg.payload = msg.payload.states.filter(function(f) { f[1]=f[1].trim(); return f[5] != null });\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":495,"wires":[["5cf4ce68.f9f9e"]]},{"id":"5cf4ce68.f9f9e","type":"split","z":"c31385261656417b","name":"split flights","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":595,"y":495,"wires":[["8bdd67c6.3db3d8"]]},{"id":"8bdd67c6.3db3d8","type":"function","z":"c31385261656417b","name":"add flight to map","func":"\nvar flight = {\n    name: msg.payload[1].trim(),\n    icao:msg.payload[0],\n    lat:msg.payload[6], \n    lon:msg.payload[5],\n    alt:msg.payload[13] || msg.payload[7],\n    bearing:msg.payload[10],\n    speed:msg.payload[9],\n    layer:\"Opensky\",\n    icon:\"plane\",\n    iconColor:\"#910000\",\n    TTL: 300\n};\n\nmsg.payload = flight;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":450,"wires":[["f8ce24246794a0f0"]]},{"id":"210a722caa5c0373","type":"http request","z":"c31385261656417b","name":"get from Opensky Network","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://opensky-network.org/api/states/all?lamin={{{payload.south}}}&lomin={{{payload.west}}}&lamax={{{payload.north}}}&lomax={{{payload.east}}}","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":345,"y":450,"wires":[["f1f4171e87d34cbe","f8f66972.c46d98"]]},{"id":"5de9e7c3215a34e9","type":"worldmap in","z":"c31385261656417b","name":"","path":"/worldmap","events":"bounds","x":120,"y":450,"wires":[["210a722caa5c0373"]]}]