ADSB Receiver Notifications

As an avid aviation enthusiast/photographer I wanted a way to know if something of my interest was potentially going to be going over head, or at least near by.

Prerequisites:

  • Local ADSB Receiver running with a dump1090

Within your sensors.yaml you need to create a rest sensor to create an array based on your json file output:

- platform: rest
  name: FR24 Flight Finder
  resource: http://<localip>/<dump1090>/data/aircraft.json
  value_template: "{{ value_json.messages }}"
  json_attributes_path: "$.aircraft[:1]"
  method: GET
  scan_interval: 15
  json_attributes:
    - hex
    - flight
    - alt_baro
    - alt_geom
    - gs
    - emergency
    - category
    - nav_modes
    - lat
    - lon
    - messages
    - seen
    - alert
    - seen-pos

Once this is done in the automation you can then create a trigger based on an event, this is when the state of the aircraft in the arrays HEX code changes (this is built on hex code)in this example from aircraft 1 to aircraft 20.

The action from this is then to send a push notification to my phone to tell me the receiver has picked up something I want to know about :).

Future improvements (if possible?):

  • narrow down the search to a 20nm radius, my receiver is reaching 150nm and not everything comes by, need to work out can I restrict on location radius?
  • when a hex changes from aircraft1 to aircraft5 (for example) it will issue a new notification, that does slightly flood your screen (sometimes) for a while. Need to work out if there is a condition to ā€œholdā€ notifications somehow.

This is a simple and small project, but thought iā€™d share in the matter of interest.

2 Likes

This sort of abuse is why APIs get shut down.

Iā€™m scanning my local IP, local domain - itā€™s not on any API, itā€™s scanning a json file directly.

3 Likes

:+1:

I tried doing something similar within Home Assistant a while back and found the needed code too complex and too rapid at times to work with in Home Assistantā€™s automations and scripts. So I moved it to an external python program. The program keeps track of ā€˜interesting ads-b hex codesā€™ from a Google Docs Spreadsheet (this was a KISS solution to make updating interesting planes easy for user), then does processing to try and determine of the aircraft is landing or taking off from local airports. The resulting ā€˜interesting eventsā€™ are forwarded to MQTT and geoJSON feeds for Home Assistant consumption.

Good hunting!

1 Like

Thanks for sharing!

Has anyone found a solution to scan for flight numbers (I.e. not callsigns)?
I know itā€™s not in the ADS-B data, so maybe there is a website where you can connect to a database?

Interesting way of doing it. Ingesting a spreadsheet of hex codes migth make it easier than me having to manually create an event, hmmmmm.

Can you give an example of what data point you are looking to use as the trigger?

Works pretty well and the user enjoys having the Sonos announce ā€˜Oprahsā€™ ā€˜Landingā€™ :wink: or ā€˜On the way to Mauiā€™ among othersā€¦


I want to trigger on the U25145 flightnumber.
For many flights the callsign equals the flightnumber, but for many others it doesnā€™t (to avoid ā€œcallsign confusionā€).
ADS-B only transmits the callsign though.

This is exactly what I was looking for. A way to get data to HA from external box.

Is there any way to create sensors like current, max, AVG aircrafts?