Get app name from cast devices

Not sure if this is the right place to ask, but here goes:
I have some Nest hubs I’m using with an Automation to recast. I used this script as a base:

  initial_state: on
  trigger:
    - platform: time_pattern
      minutes: "/1"
    - platform: template
      value_template: "{{ state_attr('media_player.nesthub', 'app_name') != 'DashCast' }}"
  condition: 
    - condition: template
      value_template: "{{ state_attr('media_player.nesthub', 'app_name') != 'Spotify' }}"
    - condition: template
      value_template: "{{ state_attr('media_player.nesthub', 'app_name') != 'DashCast' }}"
  action:
    - delay:
        seconds: 5
    - service: script.cast_ha_nesthub

I would like to add Jellyfin as another exception, how do I poll the live value of the attribute?