AlexandrErohin / home-assistant-flightradar24

Flightradar24 integration for Home Assistant
https://community.home-assistant.io/t/custom-component-flightradar24
MIT License
113 stars 9 forks source link

Feature Request: Configurable single aircraft sensor #22

Open motoridersd opened 6 months ago

motoridersd commented 6 months ago

I can do a lot of powerful filtering and display in Home Assistant to get exactly the type of aircraft I care about. For example I have a small area that only looks for Helicopters, and another that only displays commercial aircraft.

This is done by adding entries to the if statement in the for loop used for the lovelace card.

I want to use the data that the integration provides to generate an image on my Tidbyt. The Tidbyt doesn't have official Home Assistant integration, but I've been able to make a lot of things work by running their pixlet binary (to generate the screens) locally and query Home Assistant for data from Media Players for example.

I have an app that tracks flights, but it uses a RapidAPI API that is paid and I can't do a lot of filtering on it (or I can, but I am a lot more comfortable with Home Assistant templates than the Tidbyt Skylark code).

It would be nice if the integration could create a sensor based on user specified parameters. This could be a new sensor, or have an option to make sensor.flightradar24_current_in_area use the filters.

Filters would be maybe common things like:

Again, this can all be done with if statements, but I think it would be pretty user friendly to have the above settings in the Integration configuration. This is by no means urgent, but just wanted to put it out there.

Thank you for all your work. I love this integration.

AlexandrErohin commented 6 months ago

Hi Thank you for your suggestions!

I think it is better to keep the integration configuration simple to make it easy to use. As most users just install it without filtering flights at all.

But the integration also has a lot of parameters to allow a user make his own views or automation with different filters to succeed any user goals.

By the way, I see more users use altitude filter. So lets start with altitude filter and then look how it goes.

Ill add this feature in the next release

AlexandrErohin commented 6 months ago

Added filter by altitude via configuration. In Edit configuration edit the minimum and maximum altitudes in foots between which the aircraft will be tracked

motoridersd commented 6 months ago

Thank you! This helps clean up the sensor data a lot

AlexandrErohin commented 5 months ago

@motoridersd Added tracking a particular plane or planes by aircraft registration number Now you may add an automation to add for tracking only flights filtered by your needs. And these flights will be in one sensor sensor.flightradar24_tracked I have added the example for the automation

sssushi commented 4 months ago

Hey, is there a possipility to track a number of callsigns all the time and set up an Automation for it ?

I.e. i want to track one airline carrier all the time and get notifications about entering to Frankfurt…. Perhaps even with a wildcard ?

AlexandrErohin commented 4 months ago

@sssushi You just need to 1) Set latitude and longitude to Frankfurt 2) create an Automation similar with the one from README

alias: Flight Radar
description: ""
trigger:
  - platform: event
    event_type: flightradar24_entry
condition:
  - condition: template
    value_template: "{{ trigger.event.data.callsign in ('RRR','BOE','AIB','NASA','000','ZZZ') }}"
action:
  - service: notify.mobile_app_<device_name>
    data:
        content: >-
          Flight entry of {{ trigger.event.data.callsign }} to {{ trigger.event.data.airport_destination_city }}
          [Open FlightRadar](https://www.flightradar24.com/{{ trigger.event.data.callsign }})
sssushi commented 4 months ago

@sssushi You just need to

  1. Set latitude and longitude to Frankfurt
  2. create an Automation similar with the one from README
alias: Flight Radar
description: ""
trigger:
  - platform: event
    event_type: flightradar24_entry
condition:
  - condition: template
    value_template: "{{ trigger.event.data.callsign in ('RRR','BOE','AIB','NASA','000','ZZZ') }}"
action:
  - service: notify.mobile_app_<device_name>
    data:
        content: >-
          Flight entry of {{ trigger.event.data.callsign }} to {{ trigger.event.data.airport_destination_city }}
          [Open FlightRadar](https://www.flightradar24.com/{{ trigger.event.data.callsign }})

Thank you a lot ! Looks pretty easy ! Keep up the great work.