Trying to create a Team Tracker trigger for game notifications

I have the Team Tracker integration (and Team Tracker card) configured. I have a text message configured below with information about the current game which works fine. But what I don’t see how to do is create a trigger based on a game being played that day, and sending the text message. So if a game was in say 5 hours from now I’d get the text. In the developer tools the state of the team tracker shows a “date” parameter which is currently “date: 2026-04-12T17:35Z”. I’m not sure how far in advance this would be available though.

Any help would be appreciated!

-Thanks

alias: Philles Alert
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.team_tracker_phillies
    to: null
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - game starting
        sequence:
          - action: script.notification_text_message_to_pixel_8
            metadata: {}
            data:
              message: >-
                ⚾ {{ state_attr('sensor.team_tracker_phillies',
                'team_long_name') }}

                Opponent: {{ state_attr('sensor.team_tracker_phillies',
                'opponent_name') }}

                Date: {{
                as_local(as_datetime(state_attr('sensor.team_tracker_phillies',
                'date'))).strftime('%m/%d/%Y %I:%M %p') }}

                Game Time: {{ state_attr('sensor.team_tracker_phillies',
                'kickoff_in') }}

                Venue: {{ state_attr('sensor.team_tracker_phillies', 'venue') }}

                TV Network: {{ state_attr('sensor.team_tracker_phillies',
                'tv_network') }}
mode: single

I don’t use that integration, but your notification and it’s docs shows it has an attribute kickoff_in. Could you just trigger off the attribute value reaching your desired pre-time phrase?

triggers:
  - trigger: state
    entity_id: sensor.team_tracker_phillies
    attribute: kickoff_in
    to: "in 5 hours"
    id: game starting
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - game starting
        sequence:
          - action: script.notification_text_message_to_pixel_8
            metadata: {}
            data:
              message: >-
                ⚾ {{ trigger.to_state.attributes.team_long_name }}

                Opponent: {{ trigger.to_state.attributes.opponent_name }}

                Date: {{ (trigger.to_state.attributes.date|as_datetime|as_local).strftime('%m/%d/%Y %I:%M %p') }}

                Game Time: {{ trigger.to_state.attributes.kickoff_in }}

                Venue: {{ trigger.to_state.attributes.venue }}

                TV Network: {{ trigger.to_state.attributes.tv_network }}
mode: single

Thanks. I read the docs and I’m trying to use “tomorrow” (from the docs) for the kickoff_in attribute.

I’ve found a template trigger to be the easiest and most reliable way, comparing the game time versus the current time. An example for 30 minutes before.

value_template: >-
  {{ ((as_timestamp(state_attr('sensor.chiefs', 'date')) - as_timestamp(now()) )
  / 60 )|int < 30}}
trigger: template

I remember trying to use the kickoff_in attribute and ran into issues, but don’t remember the details since that was years ago. :slight_smile:

1 Like

Thank you! I’ll certainly give this a try. I currently have a trigger in place based on kickoff_in attribute and a value of “tomorrow”.

I’m an Eagles fan, so please give my regards to Andy Reed! :slight_smile:

1 Like