You can trigger off of attributes as well. This isn’t exactly what @Corey_Maxim is looking for, but it might serve as a starting point: Here’s my automation that tracks multiple games each week. I’ll add and remove teams from the integration and change the entity_ids in the automation once a week for my wife, sister and brother-in-law’s survivor pool. End result is that our phones get regularly updating notifications, one for each game with the scores, timeouts, and win probability, and eventually final score.
alias: NFL Game Score
description: >-
(add nfl sensors to each of the 3 triggers to keep track of the relevant
games)
trigger:
- platform: state
entity_id: >-
sensor.nfl_phi, sensor.nfl_dal, sensor.nfl_bal, sensor.nfl_pit,
sensor.nfl_buf
attribute: team_score
- platform: state
entity_id: >-
sensor.nfl_phi, sensor.nfl_dal, sensor.nfl_bal, sensor.nfl_pit,
sensor.nfl_buf
attribute: opponent_score
- platform: state
entity_id: >-
sensor.nfl_phi, sensor.nfl_dal, sensor.nfl_bal, sensor.nfl_pit,
sensor.nfl_buf
to: POST
condition:
- condition: template
value_template: '{{ states(trigger.entity_id) in [ "IN", "POST" ] }}'
action:
- service: notify.phones
data:
title: >-
{{ state_attr(trigger.entity_id, "team_name") }} / {{
state_attr(trigger.entity_id, "opponent_name") }}
message: >-
{{ state_attr(trigger.entity_id,"team_abbr") }} {{
state_attr(trigger.entity_id,"team_score") }} {{ ("•••" if
state_attr(trigger.entity_id,"team_timeouts")|int == 3 else "••" if
state_attr(trigger.entity_id,"team_timeouts")|int == 2 else "•" if
state_attr(trigger.entity_id,"team_timeouts")|int == 1 else "" ) if
state_attr(trigger.entity_id,"team_timeouts") else ""}}
{{ state_attr(trigger.entity_id,"opponent_abbr") }} {{
state_attr(trigger.entity_id,"opponent_score") }} {{ ("•••" if
state_attr(trigger.entity_id,"opponent_timeouts")|int == 3 else "••" if
state_attr(trigger.entity_id,"opponent_timeouts")|int == 2 else "•" if
state_attr(trigger.entity_id,"opponent_timeouts")|int == 1 else "" ) if
state_attr(trigger.entity_id,"opponent_timeouts") else ""}}
{{ "Q" ~ state_attr(trigger.entity_id, "quarter") if
state_attr(trigger.entity_id, "quarter") else "" }} {{ " - " ~
state_attr(trigger.entity_id, "clock") if state_attr(trigger.entity_id,
"clock") else "" }}
{{ "Final" if states(trigger.entity_id) == "POST" else
(state_attr(trigger.entity_id, "team_win_probability") * 100 | int) ~ "%
chance of winning" if state_attr(trigger.entity_id,
"team_win_probability") else ""}}
data:
tag: '{{ state_attr(trigger.entity_id,"team_abbr")|lower }}-score'
url: /lovelace/football
group: football
mode: parallel
max: 15
This does trigger a little more often than it needs – for instance, sometimes they might roll the score back after a challenge, and I noticed today after the nationwide Comcast outage that the scores all updated (you can see this in the times in the screenshot I just took) – but mostly it ‘just works’.
Note the tag and group fields in the notification data. The tag field will replace a specific notification with a new one, so the scores just update rather than my notification center being filled with Home Assistant entries by the end of the game). And grouping lets me keep the couple of games I’m tracking all together, and separate from the laundry, geo-location, doorbell, phone, and half dozen other things I have HA notify me for :-). And the url field goes to the HA dashboard page with the nfl cards :-), of course!