Custom Component: Flightradar24

It’s hidden when it does not exist via it conditions.

1 Like

Cheers…makes sense…so using the same code for cards for both Local Flights and “top 10”…

So now my query becomes if it’s possible to add the extra attributes to the Top 10 sensor that are already available via sensor.flightradar24_current_in_area
@AlexandrErohin do you think that’s an option?

@mountainbikert What is your automation for take off notification?

@Gav_in top 10 sensor has all attributes which gives FlightRadar. Attributes for top 10 sensor and current_in_area sensor are different

1 Like

Hi @AlexandrErohin

alias: LIFELN3 opgestegen
description: ""
trigger:
  - platform: event
    event_type: flightradar24_exit
condition:
  - condition: template
    value_template: "{{ trigger.event.data.aircraft_registration == 'PH-LLN' }}"
action:
  - service: notify.mobile_app_mymobilephone
    data:
      message: >-
        {{ trigger.event.data.aircraft_registration }} (LifeLiner 3) bezig met
        opstijgen van Volkel Airbase.
      title: LifeLiner 3 Alert
      data:
        ttl: 0
        priority: high
mode: single

@mountainbikert how you differentiate between taking off and landing? if by entering or exiting the area - try to increase the radius

@AlexandrErohin Thanks, I had it set at 2000 meter, I’ll try 4000 meter now.

Hey @AlexandrErohin ,

Thanks very much for your reply! I gave it a go and have it sort of working.

I have a trigger condition that monitors my calendar and filters for my flight numbers. The issue seems that the flight will only populate if the flight has already departed, as you alluded to. So I set the automation to run at departure time +5 minutes. So long as my flight departs on time, all is well. However, if my flight is delayed, it is not added to the additional tracked flights. Is there any way that you can think of to work around this? I could have it fire to add the flight every couple of minutes after departure time for a little while, but that seems clumsy? Any ideas?

Here’s what I have so far.

alias: Flight Radar 24 Test Level 1
description: ""
trigger:
  - platform: calendar
    event: start
    offset: "0:5:0"
    entity_id: calendar.my_access_mycalendar
condition:
  - condition: template
    value_template: "{{ trigger.calendar_event.summary | regex_match('^(?!T).*\\\\d{3,4}.*') }}"
action:
  - service: notify.mobile_app_my_phone
    metadata: {}
    data:
      message: Flight Radar 24 test. Are you going flying?
      title: FT24 Test Title
  - service: text.set_value
    metadata: {}
    data:
      value: DL{{ trigger.event.data.aircraft_registration }}
    target:
      entity_id: text.flightradar24_add_to_track
    enabled: true
mode: single

Thanks again for all of your work!

EDIT: I’ve also been playing around with the map card as well. I’ll set the lat/lon/zoom to see most of North America, as that’s where most of my flying is. Of course, the map is cluttered with all active flights. Is there any way to only display the additional.tracked.flights parameter? I see on Flightradar24, you can filter based on callsign for subscribers. I’d pay the $15/yr to add this functionality. Is this possible? I see there is parameter of {{ flight.flight_number }} in the map card’s code, not sure it’s for what we’re looking to do though.

I will think about scheduled flights

Unfortunately, I dont have Flightradar24 subscription, so I can suggestion you nothing on this :frowning:
You may play with the url. There is filter called filter_callsign for airline filter

https://www.flightradar24.com/simple?lat=LATITUDE&lon=LONGITUDE&z=ZOOM&label1=reg&size=small&filter_callsign=DLH

@AlexandrErohin I tried a radius of 4000 and 5000 meter but I keep getting the same messages. Is there any other way to solve this?

@mountainbikert The integration doesnt have taking off and landing notifications. How do you define these states?

I assume that when it leaves the airport, it takes off and when it returns it lands. I checked on the location and added a circle around the location with a 5000 meter radius. Sometimes they have to go around the airport and they may leave the circle and get back in immediately. That could cause 2 notifications. But now a flight taking of causes 2 notifications. If you use my automation you can check, I can supply you with the exact coordinates if needed.

Here’s my dashboard based on this integration!

@AlexandrErohin

The url shows a lot of promise! I can display a single flight with the call sign. I’ll look into this some more. Thanks!

I’ve been able to make some progress with the automation to add a flight from my schedule. However, I’m running into a problem of passing the flight number into the variable that will add the additional_tracked flight. Any chance you could take a look for me please?

alias: Flight Radar 24 Test Level 1
description: ""
trigger:
  - platform: calendar
    event: start
    offset: "0:05:0"
    entity_id: calendar.my_access_mycalendar
condition:
  - condition: template
    value_template: "{{ trigger.calendar_event.summary | regex_match('^(?!T).*\\d{3,4}.*') }}"
action:
  - service: notify.mobile_app_steve_s_s22
    data:
      message: >-
        DAL{{ trigger.calendar_event.summary | regex_findall('\\d{3,4}\\b') |
        first }}
      title: FT24 Test Title
  - service: text.set_value
    data_template: >-
      DAL{{ trigger.calendar_event.summary | regex_findall('\d{3,4}\b') | first
      }}
    target:
      entity_id: text.flightradar24_add_to_track
    enabled: true
mode: single

Basically, my calendar just has the flight numbers, so I have to append the airline code to the beginning of the number.
I have the notification go to my phone for now just to make sure it’s parsing the flight number correctly, which it does, everytime. It just fails when I try to pass the flight number into the additional_tracked. I’m messing up the syntax somehow.

v1.9.1 Released

Changelog

  • Translation into Spanish language
  • Fixed Deprecated config entry data update method
1 Like

@chintito4ever Great dashboard
Could you share your dashboard code and how you have set up hourly sensors?

2 Likes

I used HA’s built in Utility Meter (under settings/config/helpers) to track flights above my home hourly/daily/monthly etc.

Here’s the code for hourly flights data card, let me know if you need any other card’s codes.

type: custom:stack-in-card
mode: vertical
cards:
  - type: custom:bubble-card
    card_type: separator
    name: Hourly Flights
    icon: mdi:airplane
  - type: custom:apexcharts-card
    graph_span: 1d
    span:
      start: day
    yaxis:
      - id: tv
        show: false
    series:
      - entity: sensor.flights_above_hourly
        color: teal
        type: column
        group_by:
          func: last
          duration: 1h
        show:
          as_duration: hour
          datalabels: true
        yaxis_id: tv
    apex_config:
      grid:
        show: false
      dataLabels:
        offsetY: -10
        background:
          enabled: false
        style:
          colors:
            - var(--primary-text-color)
      plotOptions:
        bar:
          columnWidth: 60%
          borderRadius: 4
      xaxis:
        axisTicks:
          show: false
        axisBorder:
          show: false
        labels:
          offsetY: -5
          datetimeFormatter:
            day: hh
      yaxis:
        decimals: 0
        crosshairs:
          show: true
        axisTicks:
          show: true
        tickAmount: 5
        labels:
          show: true
          maxwidth: 4
      tooltip:
        enabled: false

2 Likes

@chintito4ever Thanks!

@steve1123 What is the error you get?

@AlexandrErohin The error I got was “Error rendering data template: Result is not a Dictionary”.