Git Product home page Git Product logo

fr24_card's Introduction

Lovelace FR24 card

A custom card for Home Assistant to list the aircraft found in the Dump1090 output of your ADS-B/Mode S receiver.

Screenshot of FR24 card in action

This card is developed and tested based on the output of data/aircraft.json of the FlightRadar24 Pi24 image.

The FR24 card has many configuration options and supports multiple languages.

Did my project help you? Then you can always thank me with a coffee!

"Buy Me A Coffee"


Contents of this file


Preparation

To use the card you need to create a sensor that reads the JSON from Dump1090. Add the following configuration to your sensors.yaml:

- platform: rest
  name: FR24 Aircraft
  resource: http://dump1090-host/dump1090/data/aircraft.json
  value_template: "{{ value_json.messages }}"
  method: GET
  scan_interval: 15
  json_attributes:
    - now
    - aircraft

Update the key resource in this configuration to the correct URL of your Dump1090 output. The scan_interval of 15 seconds is a suggestion, you can change this in any other value. But keep in mind that a lower interval results in a higher load on your Home Assistant environment.

After adding the sensor you need to restart Home Assistant. After restarting, in the Developer Tools check if the sensor has data.

Installation

hacs_badge

Install using HACS, or follow these instructions.

Add the card to your dashboard

The card can be added to your dashboard like any other card. If you do not see the card as an option, clear the cache of your browser and try again.

The minimal configuration of the card contains only the entity of the sensor. When using the sensor from the above example, the card can be added with the following configuration:

type: custom:fr24-card
entity: sensor.fr24_aircraft

Configuration

All options can be added in the configuration of the card, eg:

type: custom:fr24-card
entity: sensor.fr24_aircraft
lang: nl
sort: track

The following configuration options are available:

Option Type Default Accepted Description
attribute string aircraft An attribute of the sensor By default the card will read the aircrafts from the sensors aircraft attribute. If your sensor uses a different attribute, change this value to the name of your attribute.
colors object Used to overwrite the default color scheme of the card. See Colors.
columns array ["flag", "registration", "flight", "altitude", "speed", "distance", "track"] Array with any of the columns, see columns Array containing the columns to show in the table. The data of the other columns is available in the popup, if that is enabled. Too many columns will break your Dashboard, so the card will give a warning if too many columns are added.
hide object Used to configure which data is hidden. See Hide.
lang string null Any supported language, see the lang folder Sets the display language of the data. By default the hass object of your browser will be used to set the language. If that language is not available, English will be used. The registered country is always in English.
larger_units boolean false true, false When using metric units, and this option set to true, the units are converted to km for altitude and distance and km/h for speed.
limit number null A positive integer Used to limit the number of results in the table.
order string asc asc, desc Sort order of the data. Ascending (asc, smallest value first) or descending (desc, largest value first).
popup boolean false true, false Enables or disables the popup. The popup requires both browser_mod and card-mod]. The popup can be opened by clicking on a row and contains more data of the aircraft, including a photo of the aircraft provided by Planespotters.net.

Example of the popup
sort string altitude Any column, see columns The data in the table is by default sorted on the altitude, with this option you can set a different column, for example flight.
title string null Title of the card.
track_in_text boolean false true, false By default the reported track of the aircraft is displayd in degrees °. With this option set to true the track is displayed in text. When displayed in text, it's an abbreviation in the table and full text in the popup.
units_in_table boolean false true, false When this option is set to true, the table header will be appended with a second row containing the units.

Units in the table header
units string default default, metric Sets the units for the values. The default units are as they are returned by Dump1090 (ft for altitude, NM for distance, kt for speed). When using metric the value and units are converted (m for altitude and distance, m/s for speed).
zone string null Any sensor that is a zone, example zone.home The distance between Home Assistant and the reported position of the aircraft is calculated using the position of a zone. If you don't set a zone the data doesn't have the distance.

Colors

By default the card uses the primairy and secondairy colors of the active color scheme. In some cases this might lead to unwanted results. Using the colors object in the configuration of the card it's possible to overwrite the colors of both the table in the card and the popup.

The colors can be added as values that are accepted by CSS: HEX code (which must be enclosed by single quotes), RGB value, named color or a CSS variable. Example:

type: custom:fr24-card
entity: sensor.fr24_aircraft
colors:
  table_head_bg: var(--primary-color)
  table_head_text: yellow
  table_units_bg: rgb(187,78,123)
  table_units_text: '#00ff00'

With this option you can really go creative and make the ugliest most original creations. The following options are available:

Key Description
table_head_bg Background color of the table header
table_head_text Text color of the table header
table_units_bg Background color of the row with the units
table_units_text Text color of the row with the units
table_text Default text color for cells
table_even_row_bg Background color for every second row (zebra striping)
table_even_row_text Text color for every second row (zebra striping)
popup_bg Background color of the popup
popup_text Default text color in the popup
popup_table_head_bg Background color of the table header in the popup, if not used this option will fall back on table_head_bg
popup_table_head_text Text color of the table header in the popup, if not used this option will fall back on table_head_text
popup_table_even_row_bg Background color for every second row in the popup (zebra striping), if not used this option will fall back on table_even_row_bg
popup_table_even_row_text Text color for every second row in the popup (zebra striping), if not used this option will fall back on table_even_row_text

Columns

The card supports the following columns. Because there are many different formats of output of the Dump1090 (or Tar1090) data, not all columns are arvailable for each installation.

Column Data Comment
age Age of the message
aircraft_type Reported aircraft type Not the same as the category in the JSON. Not available in all installations. See issue #15.
altitude Reported altitude
country Country of registration
distance Calculated distance between the configured zone and the reported position
flag Flag of the country of registration
flight Flight number
icao ICAO code of the aircraft
icon Icon for the aircraft Unique colored based on the hex (icao) of the aircraft. Uses the vertical state of the aircraft for different icons.
registration Registration code of the aircraft The registration of the aircraft is calculated based on the reported ICAO code. However, some of the JSON files contain the registration. If the registration is found in the JSON, this data is used. See issue #15.
speed Reported speed
squawk Squawk code
track Reported track

All of the columns, except for icon are shown in the popup.

Hide

With this object it's possible to set the configuration of the data that is hidden. Data must be added as an object in the yaml configuration. Example:

type: custom:fr24-card
entity: sensor.fr24_aircraft
hide:
  old_messages: false

The following keys are available in the object:

Option Type Default Accepted Description
old_messages boolean true true, false By default aircraft data which is received more than 30 seconds ago will be filtered out of the card. Setting this option to false will show all aircraft data that is available in the JSON file.
empty array Array with columns, see examples By default, all aircraft are shown, including empty values in the table. With this option it is possible to set the columns that should not be empty. The array acts as an 'or' selector; if one of the columns has an empty value, the plane is not added to the table. This option is especially useful in combination with sort and order.

Hide empty values

With the option hide.empty it's possible to remove empty values from the table.

Example to remove all rows where there is no distance:

type: custom:fr24-card
entity: sensor.fr24_aircraft
hide:
  empty:
    - distance

Example to remove all rows where there is no distance or track:

type: custom:fr24-card
entity: sensor.fr24_aircraft
hide:
  empty:
    - distance
    - track

F.A.Q.

Please read our F.A.Q. before opening an issue.

Contribute

You can help improving this card by forking this repository and merging your changes with a pull request to the develop branch of this repository.

This applies not only to additions and improvements to the code, but certainly also to new languages.

I am particularly interested in improvements to the registration code database. For more information about the database, click here.

Credits

Honor where credit is due. This card could not have been made without consulting the following sources:

fr24_card's People

Contributors

admiralstipe avatar alexstephenlytton avatar fratsloos avatar jesmak avatar jonostanck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fr24_card's Issues

Add elevation angle above the horizon to columns

Hello, nice card! congratulations and thanks for your efforts. It would be nice if it is possible to add another column, which shows elevation angle (angle between horizon and aircraft) for a given aircraft. I often wonder how high (low) above the horizon is the arcraft and making trig on the fly is a bit difficult.

Regards,
Alexey

Minor 'bug' in English text

I noticed these recently and thought I would bring them to your attention.

In en.json, this part,

    "data": {
      "not_available": "N/A",
      "none": "No aircrafts detected!",
      "undefined": "The configurated entity doesn't contain data!"
    }

should be

    "data": {
      "not_available": "N/A",
      "none": "No aircraft detected!",
      "undefined": "The configured entity doesn't contain data!"
    }

Aircraft is one of the many silly exceptions in English and the plural is the same as the singular.

I checked the rest of the en.json file and apart from the above, it is all ok.

Adding a column for Aircraft Type?

Hi! First off - great card, really appreciate the work you have put in :)

I use the aircraft.json output of the tar1090 docker container, which has an option for outputting the aircraft type (B737, A320 etc) as well.
I wonder if you would be willing to add the option into your card, to include the Aircraft type column if available?

Width of popup exeeds window size on Android app

Describe the bug
Popup width is bigger than width of screen on Android app.

To Reproduce
Steps to reproduce the behavior:

  1. Add card to dashboard
  2. Open dashboard in Android app
  3. Click on a row to open the popup

Expected behavior
Popup should stay inside the window.

Screenshots
Screenshot_20231218-190753

Environment (please complete the following information):

  • Home Assistant version: 2023.12.3
  • Companion app: 2023.10.2-full

Allow to filter by squawk

Is your feature request related to a problem? Please describe.
Ability to filter the list based on a specific squawk code - I would like to use it in conjunction with an alert that lets me know when planes squawk 7001 near me. These are normally military entering the low fly zone.

Describe the solution you'd like
Add another config entry to the card to allow filtering by squawk code.

Describe alternatives you've considered
Tried creating a second sensor and filtering but the end result isn't parse able by the FR24 card.

Additional context
Add any other context or screenshots about the feature request here.

[Feature Request] Dont include nulls option

Capture

Option to not include blank entries?

I have a top 10 furthest aircraft card, but the aircraft that have no distance recorded are included, would it be possible to have a configuration to toggle if these should be included or not.

Make photo optional

Describe the solution you'd like
Add a config variable to disable the photo of the aircraft in the popup.

Configurable table head colors (both background and text)

In my theme the text in the head of the table is not clearly visible due to theme color selection.

If possible, make the table head background color and table head text color configurable in the card settings instead of adopting the main theme color scheme.

Tried to achieve that with `card_mod: ' option, but didn't succeed.

[Feature Request] Limit table rows

Excellent Card I already had my FR24 feeder stats going into HA using the monitor.json but this is a fantastic addition to my Aircraft Dash

I use the combination of sorted by distance from home so the closest is at the top, but it'd be great if i could limit to a specified value, then i could use multiple cards for Top 10 closest, Top 10 highest etc

Enhance the Empty filter for Distance to filter "Unknown" aka "NaN" values

For some of the flights in my list, the location is apparently "Unknown" or "NaN" in HA terms. The fr24_card calculation for Distance can't calculate it since the location is unknown, so it carries over to the Distance value as "NaN" also.

I would like to NOT display those flights with an unknown distance. I tried using the
hide: empty: - distance
configuration, but apparently since the Distance field has something in it (the "NaN"), they aren't filtered.

Split documentation in multiple files

Is your feature request related to a problem? Please describe.
The readme is a long document, which does not necessarily improve clarity. It seems better to divide the documentation into multiple files.

Describe the solution you'd like
Adjust the current readme to a short document with a description of the app and the short installation steps. Other documentation can then be placed in a subfolder with its own page for each subject.

Altitude and Speed not reported in card

Describe the bug
Card not reporting Speed / Altitude

To Reproduce
Steps to reproduce the behavior:

  1. Set up HA, 1090 and other assorted services
  2. Validate that 1090 shows speed/altitude data in GUI
  3. Verify that JSON output contains what appears to be altitude and speed data:
{"hex":"a52c35","type":"adsb_icao","flight":"N432T   ","alt_baro":1175,"alt_geom":1200,"gs":130.3,"track":194.68,"baro_rate":0,"category":"A1","nav_qnh":1016.8,"nav_altitude_mcp":1216,"lat":37.575027,"lon":-122.087675,"nic":8,"rc":186,"seen_pos":50.829,"r_dst":4.994,"r_dir":276.8,"version":0,"nic_baro":1,"nac_p":10,"nac_v":2,"sil":3,"sil_type":"unknown","alert":0,"spi":0,"mlat":[],"tisb":[],"messages":12,"seen":50.6,"rssi":-31.8},

A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
Tar1090
Home Assistant

Environment (please complete the following information):

  • Home Assistant version: 2022.6.6

Additional context
Add any other context about the problem here.

Disable link to provider when required data is not available

Describe the bug
When the aircraft has no flight number, the click to eg. Flightradar24 does not work because the null value is added in the link. The card should disable the external links if (some of) the data to construct the link is not available.

Expected behavior
When (some of) the data is not available the click handler should ignore the click.

Environment:

  • Home Assistant version: 2023.12.0
  • Card: 1.0.0-alpha

Icon color based on altitude

Is your feature request related to a problem? Please describe.
The colors of the Icons based on the hex Code is very confusing and gives no information.

Describe the solution you'd like
Add an Option to change the color of the Icons based on the altitude for example. Same color the addon is using.

Describe alternatives you've considered

Additional context

e is undefined

Describe the bug
The frontend sometimes shows
billede

To Reproduce
Steps to reproduce the behavior:

  1. Simply add the card to a tab
  2. Set up the card with a few standard settings

Expected behavior
Sometimes it works as expected, and shows the list of planes, other times it just shows that odd message

Screenshots
Firefox
billede
Chrome
billede

Environment (please complete the following information):

  • Home Assistant version: 2022.08.06
  • Browser or app, including version: Firefox 103.0.2 (64 bit) / Chrome 104.0.5112.101

Additional context
FR24: Linux/generic/static_armel/1.0.29-10
Raspberry Pi 3b+

Configuration

type: custom:fr24-card
entity: sensor.fr24_aircraft
title: Fly over os
units_in_table: true
units: metric
larger_units: true

If possible, also supply the JSON of aircraft.json.


{ "now" : 1661157367.0,
  "messages" : 266121,
  "aircraft" : [
    {"hex":"4ca66f","squawk":"6513","altitude":5625,"vert_rate":1984,"track":151,"speed":312,"mlat":[],"tisb":[],"messages":17,"seen":49.9,"rssi":-34.1},
    {"hex":"4aca50","squawk":"3755","flight":"NOZ3QJ  ","lat":55.662140,"lon":12.952714,"nucp":7,"seen_pos":0.1,"altitude":36000,"vert_rate":0,"track":346,"speed":486,"category":"A3","mlat":[],"tisb":[],"messages":1441,"seen":0.1,"rssi":-28.7},
    {"hex":"471f7e","mlat":[],"tisb":[],"messages":2,"seen":142.8,"rssi":-41.5},
    {"hex":"45cab6","mlat":[],"tisb":[],"messages":29,"seen":194.1,"rssi":-34.6},
    {"hex":"3c66e2","squawk":"6454","flight":"DLH7AE  ","lat":55.941696,"lon":13.009560,"nucp":7,"seen_pos":2.9,"altitude":36975,"vert_rate":0,"track":357,"speed":464,"category":"A3","mlat":[],"tisb":[],"messages":2774,"seen":0.1,"rssi":-33.3},
    {"hex":"501d20","mlat":[],"tisb":[],"messages":5,"seen":201.9,"rssi":-37.5},
    {"hex":"471f80","mlat":[],"tisb":[],"messages":134,"seen":165.0,"rssi":-35.5},
    {"hex":"4596c1","squawk":"7000","altitude":1175,"mlat":[],"tisb":[],"messages":42,"seen":9.4,"rssi":-34.5},
    {"hex":"345084","squawk":"0751","flight":"VLG1507 ","lat":55.133194,"lon":12.168005,"nucp":7,"seen_pos":22.0,"altitude":22750,"vert_rate":1984,"track":220,"speed":374,"mlat":[],"tisb":[],"messages":369,"seen":10.7,"rssi":-34.5}
  ]
}

v1.0.0-alpha Built-in Pop-up missing Close button

I just installed the new 1.0.0-alpha version. It is a nice improvement!

One bug/problem that I noticed is when I use the built-in pop-up window, I'm not seeing a "X" button to close it. Maybe it is something with my card_mod setup???

Here's my card config:

type: custom:fr24-card
entity: sensor.msp_piaware_flights
providers:
  adsbexchange: false
  flightaware: true
  flightradar24: true
  opensky_network: true
  plane_finder: false
columns:
  - flag
  - registration
  - flight
  - icon
  - altitude
  - speed
  - distance
hide:
  empty:
    - distance
    - altitude
  ground_vehicles: true
popup: true
zone: zone.home
sort: distance

Ground Vehicles switch

G'day,

I was thinking that a filter on ground-based detections might be a good idea.
There are a few that I pick up that crawl around on the ground here and there (must be test vehicles/transmitters) and I'd love to get rid of them on my listing. Perhaps a "ground_vehicles: false" kind of thing perhaps?
Or perhaps work it into an altitude filter if one is going to be implemented.

Just a thought!

Cheers!

Map in Popup

Hi, excellent card, I was wondering would it optionally be possible to also display map centred on the radar in the popup?

Though I'm not sure if it's possible to "cut" out just the map without the planes list, as when I go to http://[my fr24 ip]/dump1090/ I see both, which makes it fairly crowded with the limited screen estate on phone.

Config of popup should be an object

This is a weird one...
The card will not display and shows and error complaining about the Config of popup should be an object.

Screenshot 2024-01-15 at 1 57 14 am

No matter what I set popup to, either true or false, the error remains.
Now, if I remove the entire popup: true line, then the card displays properly.

The only thing I did recently was to add the card-mod entry to my configuration.yaml as I wanted more features as a front-end module rather than just as a lovelace resource.

# Front End/Theme Definitions
frontend:
  themes: !include_dir_merge_named themes
  extra_module_url:
    - /hacsfiles/hass-hue-icons/hass-hue-icons.js
    - /local/community/custom-brand-icons/custom-brand-icons.js
    - /local/plugins/card-mod.js
    - /local/community/lovelace-card-mod/card-mod.js. <-------------------- ADDED THIS LINE

However, upon removing the line and putting it back to how it was, the problem is not solved so perhaps I'm barking up the wrong tree and it's just a coincidence and nothing to do with that change?!?!?!?!?!

Any thoughts?

Origin/Destination airport codes

Firstly, love the card. So simple but just works.

I don't know where you are getting the data from but does it include the origin and destination airport codes? It would be nice to have a column with that information, e.g. LHR-JFK.

Filter (e.g., distance < X, altitude < Y)

It would be very useful if we could add filters to the aircraft displayed. E.g., I'd like to only show planes within 10 NM, under 10k altitude.

I'm not sure what the best syntax would be; there is an existing hide: empty option, but I'm not sure what the cleanest way to be would be represent the filters that need a value, and whether it should default to and or or (and how to specify the opposite behavior), which is one reason I'm not submitting a PR. (the other two are poor JS skills and extreme laziness!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.