Sports briefing updates

This commit is contained in:
2023-02-25 12:50:34 -05:00
parent 6956483594
commit fb6785d30a
4 changed files with 828 additions and 634 deletions

View File

@ -1,6 +1,11 @@
# Right now this is just to provide binary sensors to control the conditional cards on our dashboard.
# These are needed in order to prevent cards showing for events that are several months in the future...
input_boolean:
sports_updates:
name: Sports Updates
icon: mdi:strategy
template:
- binary_sensor:
- name: Michigan Wolverines Inhibit

View File

@ -357,6 +357,7 @@
</p>
<p>
{% if is_state('input_boolean.sports_updates','on') %}
{% if is_state('sensor.michigan_wolverines','PRE') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -374,12 +375,14 @@
{% endif %}
{% endif %}
{% if is_state('sensor.toledo_rockets','PRE') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Toledo Rockets will be playing today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} at {{ state_attr('sensor.toledo_rockets','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_vikings','PRE') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -388,43 +391,44 @@
{% endif %}
{% endif %}
{% if is_state('sensor.san_francisco_49ers','PRE') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The San Francisco 49ers will be playing today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} at {{ state_attr('sensor.san_francisco_49ers','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.cleveland_guardians','PRE') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Cleveland Guardians will be playing today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} at {{ state_attr('sensor.cleveland_guardians','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','PRE') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Minnesota Twins will be playing today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} at {{ state_attr('sensor.minnesota_twins','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','PRE') %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Minnesota Twins will be playing today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} at {{ state_attr('sensor.minnesota_twins','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.los_angeles_dodgers','PRE') %}
{% if state_attr('sensor.los_angeles_dodgers','opponent_abbr') not in ['CLE'] %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Los Angeles Dodgers will be playing today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} at {{ state_attr('sensor.los_angeles_dodgers','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</p>
<p>
{% if is_state('input_boolean.sports_updates','on') %}
{% if is_state('sensor.michigan_wolverines','POST') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
@ -484,6 +488,7 @@
{% endif %}
{% endif %}
{% if is_state('sensor.toledo_rockets','POST') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -501,7 +506,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.toledo_rockets','IN') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.toledo_rockets','team_score') | int) == (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
@ -510,6 +517,7 @@
"The Toledo Rockets are currently losing their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_vikings','POST') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
@ -542,6 +550,7 @@
{% endif %}
{% endif %}
{% if is_state('sensor.san_francisco_49ers','POST') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -563,7 +572,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.san_francisco_49ers','IN') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.san_francisco_49ers','team_score') | int) == (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
@ -572,6 +583,7 @@
"The San Francisco 49ers are currently losing their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.cleveland_guardians','POST') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
@ -600,6 +612,7 @@
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','POST') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -617,7 +630,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.minnesota_twins','IN') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.minnesota_twins','team_score') | int) == (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
@ -626,7 +641,9 @@
"The Minnesota Twins are currently losing their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.los_angeles_dodgers','POST') %}
{% if state_attr('sensor.los_angeles_dodgerts','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -644,7 +661,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.los_angeles_dodgers','IN') %}
{% if state_attr('sensor.los_angeles_dodgers','opponent_abbr') not in ['MIN'] %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.los_angeles_dodgers','team_score') | int) == (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
@ -653,6 +672,8 @@
"The Los Angeles Dodgers are currently losing their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</p>
<p>

View File

@ -167,6 +167,7 @@
</p>
<p>
{% if is_state('input_boolean.sports_updates','on') %}
{% if is_state('sensor.michigan_wolverines','PRE') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -184,12 +185,14 @@
{% endif %}
{% endif %}
{% if is_state('sensor.toledo_rockets','PRE') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Toledo Rockets will be playing today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} at {{ state_attr('sensor.toledo_rockets','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_vikings','PRE') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -198,47 +201,55 @@
{% endif %}
{% endif %}
{% if is_state('sensor.san_francisco_49ers','PRE') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The San Francisco 49ers will be playing today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} at {{ state_attr('sensor.san_francisco_49ers','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.cleveland_guardians','PRE') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Cleveland Guardians will be playing today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} at {{ state_attr('sensor.cleveland_guardians','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','PRE') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Minnesota Twins will be playing today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} at {{ state_attr('sensor.minnesota_twins','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','PRE') %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Minnesota Twins will be playing today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} at {{ state_attr('sensor.minnesota_twins','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.los_angeles_dodgers','PRE') %}
{% if state_attr('sensor.los_angeles_dodgers','opponent_abbr') not in ['CLE'] %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Los Angeles Dodgers will be playing today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} at {{ state_attr('sensor.los_angeles_dodgers','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</p>
<p>
{% if is_state('input_boolean.sports_updates','on') %}
{% if is_state('sensor.michigan_wolverines','POST') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.michigan_wolverines','team_score') | int) > (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"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. "
{% elif yday == date %}
{% if (state_attr('sensor.michigan_wolverines','team_score') | int) > (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"The Michigan Wolverines won their game yesterday 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 %}
@ -246,12 +257,27 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.michigan_wolverines','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.michigan_wolverines','IN') %}
{% if (state_attr('sensor.michigan_wolverines','team_score') | int) > (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.michigan_wolverines','team_score') | int) == (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"The Michigan Wolverines are currently tied in 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') }}. "
{% else %}
"The Michigan Wolverines are currently losing their game against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} with a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.ohio_state_buckeyes','POST') %}
{% if state_attr('sensor.ohio_state_buckeyes','opponent_abbr') not in ['MICH'] %}
{% set date = state_attr('sensor.ohio_state_buckeyes','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.ohio_state_buckeyes','team_score') | int) > (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"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. "
{% elif yday == date %}
{% if (state_attr('sensor.ohio_state_buckeyes','team_score') | int) > (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"The Ohio State Buckeyes won their game yesterday 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 %}
@ -260,11 +286,29 @@
"This brings their record to {{ state_attr('sensor.ohio_state_buckeyes','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.ohio_state_buckeyes','IN') %}
{% if state_attr('sensor.ohio_state_buckeyes','opponent_abbr') not in ['MICH'] %}
{% if (state_attr('sensor.ohio_state_buckeyes','team_score') | int) > (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.ohio_state_buckeyes','team_score') | int) == (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"The Ohio State Buckeyes are currently tied in 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') }}. "
{% else %}
"The Ohio State Buckeyes are currently losing their game against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} with a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.toledo_rockets','POST') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"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. "
{% elif yday == date %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"The Toledo Rockets won their game yesterday 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 %}
@ -273,10 +317,30 @@
"This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.toledo_rockets','IN') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.toledo_rockets','team_score') | int) == (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"The Toledo Rockets are currently tied in 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') }}. "
{% else %}
"The Toledo Rockets are currently losing their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_vikings','POST') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.minnesota_vikings','team_score') | int) > (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.minnesota_vikings','team_score') | int) == state_attr('sensor.minnesota_vikings','opponent_score') | int %}
"The Minnesota Vikings tied in 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. "
{% elif yday == date %}
{% if (state_attr('sensor.minnesota_vikings','team_score') | int) > (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"The Minnesota Vikings won their game yesterday 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') }}. "
{% elif (state_attr('sensor.minnesota_vikings','team_score') | int) == state_attr('sensor.minnesota_vikings','opponent_score') | int %}
@ -286,11 +350,29 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.minnesota_vikings','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.minnesota_vikings','IN') %}
{% if (state_attr('sensor.minnesota_vikings','team_score') | int) > (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.minnesota_vikings','team_score') | int) == (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"The Minnesota Vikings are currently tied in 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') }}. "
{% else %}
"The Minnesota Vikings are currently losing their game against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.san_francisco_49ers','POST') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.san_francisco_49ers','team_score') | int) == state_attr('sensor.san_francisco_49ers','opponent_score') | int %}
"The San Francisco 49ers tied in 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. "
{% elif yday == date %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"The San Francisco 49ers won their game yesterday 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') }}. "
{% elif (state_attr('sensor.san_francisco_49ers','team_score') | int) == state_attr('sensor.san_francisco_49ers','opponent_score') | int %}
@ -301,10 +383,28 @@
"This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.san_francisco_49ers','IN') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.san_francisco_49ers','team_score') | int) == (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"The San Francisco 49ers are currently tied in 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') }}. "
{% else %}
"The San Francisco 49ers are currently losing their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.cleveland_guardians','POST') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.cleveland_guardians','team_score') | int) > (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"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. "
{% elif yday == date %}
{% if (state_attr('sensor.cleveland_guardians','team_score') | int) > (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"The Cleveland Guardians won their game yesterday 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 %}
@ -312,11 +412,27 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.cleveland_guardians','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.cleveland_guardians','IN') %}
{% if (state_attr('sensor.cleveland_guardians','team_score') | int) > (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.cleveland_guardians','team_score') | int) == (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"The Cleveland Guardians are currently tied in 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') }}. "
{% else %}
"The Cleveland Guardians are currently losing their game against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} with a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','POST') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"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. "
{% elif yday == date %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"The Minnesota Twins won their game yesterday 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 %}
@ -325,10 +441,29 @@
"This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.minnesota_twins','IN') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.minnesota_twins','team_score') | int) == (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"The Minnesota Twins are currently tied in 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') }}. "
{% else %}
"The Minnesota Twins are currently losing their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.los_angeles_dodgers','POST') %}
{% if state_attr('sensor.los_angeles_dodgerts','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if yday == date %}
{% if date == now().strftime('%m-%d') %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"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. "
{% elif yday == date %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"The Los Angeles Dodgers won their game yesterday 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 %}
@ -337,6 +472,18 @@
"This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.los_angeles_dodgers','IN') %}
{% if state_attr('sensor.los_angeles_dodgers','opponent_abbr') not in ['MIN'] %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.los_angeles_dodgers','team_score') | int) == (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"The Los Angeles Dodgers are currently tied in 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') }}. "
{% else %}
"The Los Angeles Dodgers are currently losing their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</p>
<p>

View File

@ -72,6 +72,7 @@
</p>
<p>
{% if is_state('input_boolean.sports_updates','on') %}
{% if is_state('sensor.michigan_wolverines','PRE') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -89,12 +90,14 @@
{% endif %}
{% endif %}
{% if is_state('sensor.toledo_rockets','PRE') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Toledo Rockets will be playing today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} at {{ state_attr('sensor.toledo_rockets','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_vikings','PRE') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -103,43 +106,44 @@
{% endif %}
{% endif %}
{% if is_state('sensor.san_francisco_49ers','PRE') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The San Francisco 49ers will be playing today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} at {{ state_attr('sensor.san_francisco_49ers','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.cleveland_guardians','PRE') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Cleveland Guardians will be playing today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} at {{ state_attr('sensor.cleveland_guardians','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','PRE') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Minnesota Twins will be playing today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} at {{ state_attr('sensor.minnesota_twins','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','PRE') %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Minnesota Twins will be playing today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} at {{ state_attr('sensor.minnesota_twins','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% if is_state('sensor.los_angeles_dodgers','PRE') %}
{% if state_attr('sensor.los_angeles_dodgers','opponent_abbr') not in ['CLE'] %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
"The Los Angeles Dodgers will be playing today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} at {{ state_attr('sensor.los_angeles_dodgers','venue') }}. "
"Kickoff will be at {{ state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
"First pitch will be at {{ state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</p>
<p>
{% if is_state('input_boolean.sports_updates','on') %}
{% if is_state('sensor.michigan_wolverines','POST') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
@ -199,6 +203,7 @@
{% endif %}
{% endif %}
{% if is_state('sensor.toledo_rockets','POST') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -216,7 +221,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.toledo_rockets','IN') %}
{% if state_attr('sensor.toledo_rockets','opponent_abbr') not in ['OSU','MICH'] %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.toledo_rockets','team_score') | int) == (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
@ -225,6 +232,7 @@
"The Toledo Rockets are currently losing their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_vikings','POST') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
@ -257,6 +265,7 @@
{% endif %}
{% endif %}
{% if is_state('sensor.san_francisco_49ers','POST') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -278,7 +287,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.san_francisco_49ers','IN') %}
{% if state_attr('sensor.san_francisco_49ers','opponent_abbr') not in ['MIN'] %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.san_francisco_49ers','team_score') | int) == (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
@ -287,6 +298,7 @@
"The San Francisco 49ers are currently losing their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.cleveland_guardians','POST') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
@ -315,6 +327,7 @@
{% endif %}
{% endif %}
{% if is_state('sensor.minnesota_twins','POST') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -332,7 +345,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.minnesota_twins','IN') %}
{% if state_attr('sensor.minnesota_twins','opponent_abbr') not in ['CLE','LAD'] %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.minnesota_twins','team_score') | int) == (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
@ -341,7 +356,9 @@
"The Minnesota Twins are currently losing their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% if is_state('sensor.los_angeles_dodgers','POST') %}
{% if state_attr('sensor.los_angeles_dodgerts','opponent_abbr') not in ['MIN'] %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% set yday = (as_timestamp(now()) - (24*3600)) | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
@ -359,7 +376,9 @@
{% endif %}
"This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% endif %}
{% elif is_state('sensor.los_angeles_dodgers','IN') %}
{% if state_attr('sensor.los_angeles_dodgers','opponent_abbr') not in ['MIN'] %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"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') }}. "
{% elif (state_attr('sensor.los_angeles_dodgers','team_score') | int) == (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
@ -368,6 +387,8 @@
"The Los Angeles Dodgers are currently losing their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. "
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</p>
<p>