@hardy pecan requested I bring this templating issue to you all for assistance. Original thread, https://discord.com/channels/330944238910963714/1054144517370028065. I am wanting to trigger my WLED playlist whenever my football team scores. I have the HACS https://github.com/zacs/ha-nfl working and I see sensor.philadelphia_eagles with various attributes. I only want to trigger the automation when a touchdown is scored, >=6 points and not for a field goal 3 points.
The sensor state IN means game is active and the attribute team_score seems to be what we'll need to use. I don't know how best to store or get the previous value to compare to the new value so I can determine the type of score. How best do you all suggest doing this? Attributes below, but game ended so some values don't apply.
attribution: Data provided by ESPN
date: 2022-12-18T18:00Z
kickoff_in: 3 hours ago
quarter: null
clock: null
venue: Soldier Field
location: Chicago, IL
tv_network: FOX
odds: null
overunder: null
possession: null
last_play: null
down_distance_text: null
team_abbr: PHI
team_id: 21
team_name: Eagles
team_record: 13-1
team_homeaway: away
team_logo: https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/phi.png
team_colors: #06424D, #a5acaf
team_colors_rbg:
- - 6
- 66
- 77
- - 165
- 172
- 175
team_score: 25
team_win_probability: null
team_timeouts: 3
opponent_abbr: CHI
opponent_id: 3
opponent_name: Bears
opponent_record: 3-11
opponent_homeaway: home
opponent_logo: https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/chi.png
opponent_colors: #152644, #0b162a
opponent_colors_rgb:
- - 21
- 38
- 68
- - 11
- 22
- 42
opponent_score: 20
opponent_win_probability: null
opponent_timeouts: 3
last_update: 2022-12-18 16:24:10-05:00
icon: mdi:football
friendly_name: Philadelphia Eagles