How do you make a tap_action URL dynamic based on a sensor value?

This is probably the wrong way to do what I want to do, but it is the best I can do so far. I want to look up aircraft data on the FAA website. I use the OpenSky integration to get the call sign of the aircraft, and want to create a URL that will append that call sign to the end of that lookup URL, and then use a tap action on a Lovelace card that will bring up the FAA page with that call sign appended to the end. I made a template sensor that creates the URL with the call sign, but I cannot figure out how to use that sensor value in a tap action. Does anyone know a way to make this work?

This is the (probably silly) way I am trying to do this:

type: picture-elements
tap_action:
  action: url
  url_path:  sensor.aircraft_lookup_url
elements:
  - type: image
    image: /local/images/background_sky.jpg
    style:
      width: 100%
      top: 40%
      left: 50%
      filter: blur(3px) brightness(80%)
  - type: state-label
    entity: sensor.opensky_time
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 61%
      left: 15%
      font-size: 16px
      filter: brightness(140%)
  - type: state-icon
    entity: sensor.opensky_time
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    icon: 'mdi:clock-outline'
    style:
      top: 32%
      left: 13%
      '--mdc-icon-size': 60px
      '--paper-item-icon-color': orange
  - type: state-label
    entity: sensor.opensky_callsign
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 60%
      left: 50%
      font-size: 14px
      filter: brightness(140%)
  - type: state-label
    entity: sensor.opensky_altitude
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 14%
      left: 50%
      font-size: 14px
      filter: brightness(140%)
  - type: state-icon
    entity: sensor.opensky_callsign
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    icon: 'mdi:airplane'
    style:
      top: 32%
      left: 48%
      '--mdc-icon-size': 60px
      '--paper-item-icon-color': yellow
  - type: state-label
    entity: sensor.opensky_origin
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 60%
      left: 82%
      font-size: 14px
      filter: brightness(140%)
  - type: state-icon
    entity: sensor.opensky_origin
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    icon: 'mdi:compass'
    style:
      top: 30%
      left: 80%
      '--mdc-icon-size': 60px
      '--paper-item-icon-color': red
image: /local/images/background_color.jpg

I would be grateful for a nudge in the right direction.

Hey! Did you ever figure this out?

I wasn’t able to get it to work with a tap-action on a button, but I was able to do what I need with the
html-card and build the URL with a html link. Making this a clickable image should be trivial.

type: custom:html-card
name: Feeder Configuration Webpage
content: |
  <a href="http://[[sensor.feeder_ip]]">Link</a>
1 Like