AlexandrErohin / home-assistant-flightradar24

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

Getting links to open in FlightRadar24 app from iOS notifications #49

Closed ShawnCBerg closed 2 months ago

ShawnCBerg commented 2 months ago

I've been using this plugin today and was having difficulty getting links from notifications to open in the FR24 iOS app. They would always open the app and the app would immediately forward the request to the browser. It turns out you need to add the ID to the URL. Updating the URL for the notification to be as follows fixed it so they now open natively in the app on iOS. I didn't see the id value in the documentation but found it by looking at the automation trace. I figured I'd share so maybe you could update the documentation if you felt it was relevant for others. Here's the YAML I'm using for the automation now:

alias: Flight entry notification
trigger:
  - platform: event
    event_type: flightradar24_entry
action:
  - data:
      message: >-
        {{ trigger.event.data.airline }} {{ trigger.event.data.flight_number }}
        ({{ trigger.event.data.callsign }}) from {{
        trigger.event.data.airport_origin_city }} to {{
        trigger.event.data.airport_destination_city }} {{
        trigger.event.data.ground_speed }} knots {{ trigger.event.data.altitude
        }} ft. overhead.
      data:
        url: >-
          https://fr24.com/{{ trigger.event.data.callsign }}/{{
          trigger.event.data.id }}
        image: "{{ trigger.event.data.aircraft_photo_medium }}"
    action: notify.mobile_app_myiphone
AlexandrErohin commented 2 months ago

@ShawnCBerg Thank you!

AlexandrErohin commented 2 months ago

@ShawnCBerg Added to README Dont forget please to give a star to the repo :)