FlightAirMap (ADSB) - geojson custom component

For those who are feeding ADSB data into FlightRadar24/FlightAware/ADSBExchange and the like, I have setup a component which can show you the planes you are receiving data from on your HA map.

For those that would like to dive in, first off you need FlightAirMap or Github.

Once that is installed, check you can get the geojson data (for me that is http://192.168.0.200/FlightAirMap/live/geojson ).

Then, you will need to get the component from Github and put it in your custom_components directory.

Then, add it to your configuration.yaml like this

geo_location:
  - platform: flightairmap_feed
    url: http://192.168.0.200/FlightAirMap/live/geojson
    radius: 20000

Radius in in metres.
The default update setting at the moment is 10 seconds.

You can then add the to a lovelace map card via

      - entities: []
        geo_location_sources:
          - all
        type: map

This then gives you something like below.

Some intial issues that will be fixed shortly:

  • If you have no planes, then it will give you errors, but shouldn’t crash the plugin. I am working on getting this better. This doesn’t seem to be an issue for others, but because of my location I regularly get this.
  • The ICAO value coming from Flight Air Map is just the registration code of the plane, rather than the proper ICAO value at the moment, so I have removed that. It is on my list of things to fix.

Thanks to @exxamalte as this was based on the NSW RFS incidents code, that I have just adapted to FlightAirMap and their geojson feeds.

I haven’t tested it with any of the other data that it is possible to use with FlightAirMap, so let me know how you go if you use this data.

3 Likes

Great work!

There is also this library that uses the Flightradar24 feed or the Dump1090 feed directly, and was working with a standard Flightradar24 installation. This library also contains an “aggregator” for each feed type which tracks flights over a period of time because in my experience if the ADS-B receiver gets many updates per second, quite a few are incomplete, so the “aggregator” is amending the missing data, or discarding unsuitable entries.

1 Like

Very nice! Thanks @bavotto for sharing. Any chance you’ll add sensors (for instance, how many airplanes there currently are in a radius)? Did you get around fixing the no-planes errors (there aren’t that many where I live as well)?

I haven’t fixed the no-plane error at the moment, but I have some holidays coming up shortly where I will try and fix both that, and add a sensors with a count of the planes within a distance. I will add this to my list of things to do and let you know how I get on.

Alright :slight_smile: As long as it’s still fun for you, holidays shouldn’t be wasted :smiley:
Thanks for the reply

test etst wqwqwsda ada

1 Like

@bavotto Looks Super Promising, Any idea why I it comes up with an error saying

Platform error geo_location.flightairmap_feed - cannot import name 'ConfigType' from 'homeassistant.helpers' (/usr/src/homeassistant/homeassistant/helpers/__init__.py) 

when adding in the configuration.yaml?
I am running HASSOS V5.0 and HA113.3 on a PI4. Am I doing something dumb?

Sorry I had fixed it locally on my end but forgot to push my changes. Try again now and it should work.

Thanks! got it in no problem. I am not showing any flights and nothing ahas given me any errors so looks good. Just waiting on a flight to show up.

I’m sorry, I’m a newbie and I’ve got standard Pi24 fr24 installation and another Pi with home assistant; could you please explain how can I use data in home assistant to fetch flights? Thank you.

Anyone know how to add specific callsigns? And when they enter my set radius from my station I can send a notification!

Thanks!

The library I linked just by itself cannot be used directly to integrate a local FR24 instance, but is missing some glue code.

The approach described in the first post should still work, but it requires you to install FlightAirMap to generate the GeoJSON feed, and the custom component code linked in the post.

1 Like

The integration linked in the first post will generate entities with the callsign in their name.
I would create an automation with a geolocation trigger with source flightairmap_feed. And then you add a condition where you compare the entity’s name with the callsign you’re interested in (something like this: condition: "{{ trigger.to_state.name == 'QFA678' }}" - but I haven’t actually tested this).

2 Likes

Hi guys, super excited about this one, so bumping it again after 8(!) months. I have been trying to set up everything according to the initial post, but I ran into some issues. First of all, the mentioned url for getting the json returns a 304. After some tinkering in the development windows of safari I noticed that the flightradar24 pages on my pi used http://[localip]:8754/flights.json as their source, so decided to give that a go.

I see no errors anymore, but I also don’t see any entities appearing on my map. I live close to schiphol airport, so plenty of planes in sight.

Any ideas?

The original integration is based on a specific format (FlightAirMap), so you probably can’t just replace one URL with another one. The reason you don’t see error messages is probably because both end-points produce a JSON output, but the one you now use simply doesn’t contain the expected information and hence no entities are being created.

Thanks for this. I really appreciate your help! The input I am using is from FlightAirMap, just located differently. I’m assuming this might just be because of a newer version of the app? Maybe it is possible to share an example of the format that was used as input originally, so I can check if it is the same or different?

I am trying to somehow create an appdaemon app that would frequently take the raw output from Dump1090 and (preferably in aggregated form) make entities out of them, but I’m a total Python virgin, so having something that works to start with would help a lot…

So in my configuration mine now looks like this:

geo_location:
  - platform: flightairmap_feed
    url: http://192.168.0.200:8080/live/geojson
    radius: 20000

I can get to the standard view for FlightAirMap which has the map, I can search the previous flights and the like from http://192.168.0.200:8080/.

The geojson I get out of this is available at GEOJSON - Pastebin.com although this has been formatted nicely. Each Feature in the Features array is a plane in this case.

The main thing to check with a 304 is if your URL is correct first. Use the default view, and then add live/geojson to the end to see what you get.

Very strange… I have everything installed from Flightradar24 and my feed is live. However, when I try to access /live/geojson, it gives me FORBIDDEN :>… Any suggestions?

is it still live?