From 4b7d8b7003e2f9c29b5096cea6e7c52c0bef4c86 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 13 Nov 2022 19:50:16 -0500 Subject: [PATCH] Sports updates now only read out for games on same day --- templates/speech/daily_briefing.yaml | 104 +++++++++++++++---------- templates/speech/nightly_briefing.yaml | 104 +++++++++++++++---------- 2 files changed, 128 insertions(+), 80 deletions(-) diff --git a/templates/speech/daily_briefing.yaml b/templates/speech/daily_briefing.yaml index 54caf57..9129f72 100644 --- a/templates/speech/daily_briefing.yaml +++ b/templates/speech/daily_briefing.yaml @@ -352,12 +352,15 @@

{% if is_state('sensor.michigan_wolverines','POST') %} - {% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %} - "The Michigan Wolverines won their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. " - {% else %} - "The Michigan Wolverines lost their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. " + {% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %} + "The Michigan Wolverines won their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. " + {% else %} + "The Michigan Wolverines lost their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.michigan_wolverines','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.michigan_wolverines','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.michigan_wolverines','IN') %} {% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %} "The Michigan Wolverines are currently winning their game against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} with a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. " @@ -366,12 +369,15 @@ {% endif %} {% endif %} {% if is_state('sensor.ohio_state_buckeyes','POST') %} - {% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %} - "The Ohio State Buckeyes won their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. " - {% else %} - "The Ohio State Buckeyes lost their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. " + {% set date = state_attr('sensor.ohio_state_buckeyes','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %} + "The Ohio State Buckeyes won their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. " + {% else %} + "The Ohio State Buckeyes lost their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.ohio_state_buckeyes','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.ohio_state_buckeyes','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.ohio_state_buckeyes','IN') %} {% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %} "The Ohio State Buckeyes are currently winning their game against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} with a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. " @@ -380,12 +386,15 @@ {% endif %} {% endif %} {% if is_state('sensor.toledo_rockets','POST') %} - {% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %} - "The Toledo Rockets won their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. " - {% else %} - "The Toledo Rockets lost their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. " + {% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %} + "The Toledo Rockets won their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. " + {% else %} + "The Toledo Rockets lost their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.toledo_rockets','IN') %} {% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %} "The Toledo Rockets are currently winning their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. " @@ -394,12 +403,15 @@ {% endif %} {% endif %} {% if is_state('sensor.minnesota_vikings','POST') %} - {% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %} - "The Minnesota Vikings won their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. " - {% else %} - "The Minnesota Vikings lost their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. " + {% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %} + "The Minnesota Vikings won their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. " + {% else %} + "The Minnesota Vikings lost their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.minnesota_vikings','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.minnesota_vikings','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.minnesota_vikings','IN') %} {% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %} "The Minnesota Vikings are currently winning their game against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. " @@ -408,12 +420,15 @@ {% endif %} {% endif %} {% if is_state('sensor.san_francisco_49ers','POST') %} - {% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %} - "The San Francisco 49ers won their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. " - {% else %} - "The San Francisco 49ers lost their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. " + {% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %} + "The San Francisco 49ers won their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. " + {% else %} + "The San Francisco 49ers lost their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.san_francisco_49ers','IN') %} {% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %} "The San Francisco 49ers are currently winning their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. " @@ -422,12 +437,15 @@ {% endif %} {% endif %} {% if is_state('sensor.cleveland_guardians','POST') %} - {% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %} - "The Cleveland Guardians won their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. " - {% else %} - "The Cleveland Guardians lost their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. " + {% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %} + "The Cleveland Guardians won their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. " + {% else %} + "The Cleveland Guardians lost their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.cleveland_guardians','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.cleveland_guardians','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.cleveland_guardians','IN') %} {% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %} "The Cleveland Guardians are currently winning their game against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} with a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. " @@ -436,12 +454,15 @@ {% endif %} {% endif %} {% if is_state('sensor.minnesota_twins','POST') %} - {% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %} - "The Minnesota Twins won their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. " - {% else %} - "The Minnesota Twins lost their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. " + {% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %} + "The Minnesota Twins won their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. " + {% else %} + "The Minnesota Twins lost their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.minnesota_twins','IN') %} {% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %} "The Minnesota Twins are currently winning their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. " @@ -450,12 +471,15 @@ {% endif %} {% endif %} {% if is_state('sensor.los_angeles_dodgers','POST') %} - {% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %} - "The Los Angeles Dodgers won their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. " - {% else %} - "The Los Angeles Dodgers lost their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. " + {% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %} + "The Los Angeles Dodgers won their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. " + {% else %} + "The Los Angeles Dodgers lost their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.los_angeles_dodgers','IN') %} {% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %} "The Los Angeles Dodgers are currently winning their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. " diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index 7d7ce73..67fe9fc 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -64,12 +64,15 @@

{% if is_state('sensor.michigan_wolverines','POST') %} - {% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %} - "The Michigan Wolverines won their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. " - {% else %} - "The Michigan Wolverines lost their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. " + {% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %} + "The Michigan Wolverines won their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. " + {% else %} + "The Michigan Wolverines lost their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.michigan_wolverines','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.michigan_wolverines','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.michigan_wolverines','IN') %} {% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %} "The Michigan Wolverines are currently winning their game against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} with a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. " @@ -78,12 +81,15 @@ {% endif %} {% endif %} {% if is_state('sensor.ohio_state_buckeyes','POST') %} - {% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %} - "The Ohio State Buckeyes won their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. " - {% else %} - "The Ohio State Buckeyes lost their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. " + {% set date = state_attr('sensor.ohio_state_buckeyes','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %} + "The Ohio State Buckeyes won their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. " + {% else %} + "The Ohio State Buckeyes lost their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.ohio_state_buckeyes','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.ohio_state_buckeyes','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.ohio_state_buckeyes','IN') %} {% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %} "The Ohio State Buckeyes are currently winning their game against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} with a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. " @@ -92,12 +98,15 @@ {% endif %} {% endif %} {% if is_state('sensor.toledo_rockets','POST') %} - {% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %} - "The Toledo Rockets won their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. " - {% else %} - "The Toledo Rockets lost their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. " + {% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %} + "The Toledo Rockets won their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. " + {% else %} + "The Toledo Rockets lost their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.toledo_rockets','IN') %} {% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %} "The Toledo Rockets are currently winning their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. " @@ -106,12 +115,15 @@ {% endif %} {% endif %} {% if is_state('sensor.minnesota_vikings','POST') %} - {% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %} - "The Minnesota Vikings won their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. " - {% else %} - "The Minnesota Vikings lost their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. " + {% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %} + "The Minnesota Vikings won their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. " + {% else %} + "The Minnesota Vikings lost their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.minnesota_vikings','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.minnesota_vikings','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.minnesota_vikings','IN') %} {% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %} "The Minnesota Vikings are currently winning their game against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. " @@ -120,12 +132,15 @@ {% endif %} {% endif %} {% if is_state('sensor.san_francisco_49ers','POST') %} - {% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %} - "The San Francisco 49ers won their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. " - {% else %} - "The San Francisco 49ers lost their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. " + {% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %} + "The San Francisco 49ers won their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. " + {% else %} + "The San Francisco 49ers lost their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.san_francisco_49ers','IN') %} {% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %} "The San Francisco 49ers are currently winning their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. " @@ -134,12 +149,15 @@ {% endif %} {% endif %} {% if is_state('sensor.cleveland_guardians','POST') %} - {% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %} - "The Cleveland Guardians won their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. " - {% else %} - "The Cleveland Guardians lost their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. " + {% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %} + "The Cleveland Guardians won their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. " + {% else %} + "The Cleveland Guardians lost their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.cleveland_guardians','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.cleveland_guardians','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.cleveland_guardians','IN') %} {% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %} "The Cleveland Guardians are currently winning their game against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} with a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. " @@ -148,12 +166,15 @@ {% endif %} {% endif %} {% if is_state('sensor.minnesota_twins','POST') %} - {% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %} - "The Minnesota Twins won their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. " - {% else %} - "The Minnesota Twins lost their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. " + {% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %} + "The Minnesota Twins won their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. " + {% else %} + "The Minnesota Twins lost their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.minnesota_twins','IN') %} {% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %} "The Minnesota Twins are currently winning their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. " @@ -162,12 +183,15 @@ {% endif %} {% endif %} {% if is_state('sensor.los_angeles_dodgers','POST') %} - {% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %} - "The Los Angeles Dodgers won their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. " - {% else %} - "The Los Angeles Dodgers lost their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. " + {% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d',false) %} + {% if date == now().strftime('%m-%d') %} + {% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %} + "The Los Angeles Dodgers won their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. " + {% else %} + "The Los Angeles Dodgers lost their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. " + {% endif %} + "This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. " {% endif %} - "This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. " {% elif is_state('sensor.los_angeles_dodgers','IN') %} {% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %} "The Los Angeles Dodgers are currently winning their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. "