483 lines
44 KiB
YAML
483 lines
44 KiB
YAML
>
|
|
{# Nightly Briefing #}
|
|
{%- macro getReport() -%}
|
|
<p>
|
|
"Good evening. It is {{ now().strftime("%I:%M %p") }}. As the day reaches its end, here are a few items to wrap things up. "
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.tony_streaming_today','on') %}
|
|
"Tony will be streaming tonight. The studio is scheduled to go online at {{ (state_attr('input_datetime.tony_streaming_start_time','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% endif %}
|
|
{% if is_state('sensor.school_tomorrow','on') %}
|
|
{% if is_state('sensor.band_tomorrow','on') %}
|
|
"Collin has school tomorrow, and there will be band practice in the morning at {{ as_timestamp(strptime(state_attr('calendar.kallen_school_days','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%I:%M %p") }}. "
|
|
{% else %}
|
|
"Collin has school tomorrow at {{ as_timestamp(strptime(state_attr('calendar.kallen_school_days','start_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%I:%M %p") }}. "
|
|
{% endif %}
|
|
{% else %}
|
|
"Collin does not have school tomorrow. "
|
|
{% endif %}
|
|
{% set start = (state_attr('binary_sensor.tina_work_tomorrow','start_timestamp') | int) // 1000 %}
|
|
{% set tmrw = (as_timestamp(states('sensor.date')) + 86400) | int %}
|
|
{% set diff = (start - tmrw) %}
|
|
{% if is_state('input_boolean.work_today','on') %}
|
|
"Tina is still at work right now, she will be done at approximately {{ (state_attr('input_datetime.tina_workday_end','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('binary_sensor.tina_work_tomorrow','on') %}
|
|
"Tina has work tomorrow at {{ diff | timestamp_custom('%H:%M %p',false) }}. "
|
|
{% else %}
|
|
"Tina appears to have tomorrow off. "
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if states('sensor.weatheralerts_active_alerts') > '0' %}
|
|
"Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weatheralerts_active_alerts') }}. They are as follows. "
|
|
{% if is_state('sensor.weatheralerts_alert_1','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_1','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_2','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_2','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_3','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_3','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_4','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_4','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_5','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_5','alert_event') }}"
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('sensor.garbage_collection_large_pickup','1') %}
|
|
'Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all large garbage items tonight, and do not forget the trash can!'
|
|
{% elif is_state('sensor.garbage_collection','1') %}
|
|
{{ [
|
|
'Do not forget to take the trash bin to the curb, tomorrow is trash pickup day.',
|
|
'Make sure to take the trash out. No, I do not mean Tony.',
|
|
'Tomorrow is a big day for the garbage men. Make sure you do not let them down! Take the trash out!'
|
|
] | random }}
|
|
{% endif %}
|
|
|
|
{% set gc = state_attr('sensor.garbage_collection','days') %}
|
|
{% if gc == 7 %}
|
|
{{ [
|
|
'Do not forget to bring the trash can back from the curb.',
|
|
'The trash can will feel lonely if you leave it at the curb all night.'
|
|
] | random }}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% 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') %}
|
|
"The Michigan Wolverines will be playing today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} at {{ state_attr('sensor.michigan_wolverines','venue') }}. "
|
|
"Kickoff will be at {{ state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if is_state('sensor.ohio_state_buckeyes','PRE') %}
|
|
{% 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') %}
|
|
{% if date == now().strftime('%m-%d') %}
|
|
"The Ohio State Buckeyes will be playing today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} at {{ state_attr('sensor.ohio_state_buckeyes','venue') }}. "
|
|
"Kickoff will be at {{ state_attr('sensor.ohio_state_buckeyes','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if is_state('sensor.toledo_rockets','PRE') %}
|
|
{% 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 %}
|
|
{% 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') %}
|
|
"The Minnesota Vikings will be playing today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} at {{ state_attr('sensor.minnesota_vikings','venue') }}. "
|
|
"Kickoff will be at {{ state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%I:%M %p') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if is_state('sensor.san_francisco_49ers','PRE') %}
|
|
{% 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 %}
|
|
{% 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') }}. "
|
|
{% 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.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') %}
|
|
{% 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') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% 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 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 %}
|
|
"The Michigan Wolverines lost their game yesterday 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 %}
|
|
{% 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 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 %}
|
|
"The Ohio State Buckeyes lost their game yesterday 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 %}
|
|
{% 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') %}
|
|
{% 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') %}
|
|
{% 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 %}
|
|
"The Toledo Rockets lost their game yesterday 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 %}
|
|
{% elif is_state('sensor.toledo_rockets','IN') %}
|
|
{% 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 %}
|
|
{% 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 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 %}
|
|
"The Minnesota Vikings tied in 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') }}. "
|
|
{% else %}
|
|
"The Minnesota Vikings lost their game yesterday 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 %}
|
|
{% 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') %}
|
|
{% 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') %}
|
|
{% 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 %}
|
|
"The San Francisco 49ers tied in 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') }}. "
|
|
{% else %}
|
|
"The San Francisco 49ers lost their game yesterday 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 %}
|
|
{% elif is_state('sensor.san_francisco_49ers','IN') %}
|
|
{% 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 %}
|
|
{% 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 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 %}
|
|
"The Cleveland Guardians lost their game yesterday 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 %}
|
|
{% 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') %}
|
|
{% 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') %}
|
|
{% 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 %}
|
|
"The Minnesota Twins lost their game yesterday 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 %}
|
|
{% elif is_state('sensor.minnesota_twins','IN') %}
|
|
{% 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 %}
|
|
{% if is_state('sensor.los_angeles_dodgers','POST') %}
|
|
{% 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') %}
|
|
{% 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 %}
|
|
"The Los Angeles Dodgers lost their game yesterday 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 %}
|
|
{% elif is_state('sensor.los_angeles_dodgers','IN') %}
|
|
{% 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 %}
|
|
</p>
|
|
|
|
<p>
|
|
"Bedroom climate scheduling will be as follows. "
|
|
{% if is_state('input_boolean.master_bedroom_aircon_installed','on') %}
|
|
{% if is_state('climate.master_bedroom_aircon','fan_only') %}
|
|
"The master bedroom air conditioner is already running in fan only mode. "
|
|
{% elif states('climate.master_bedroom_aircon') not in ['off','unknown','unavailable'] %}
|
|
"The master bedroom air conditioner is already running in {{ states('climate.master_bedroom_aircon') }} mode. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','AC') and is_state('input_boolean.hot_day','on') %}
|
|
"Today was a hot day, so the master bedroom air conditioner will activate cooling mode a bit earlier tonight at {{ (state_attr('input_datetime.master_bedroom_cooling','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','AC') %}
|
|
"The master bedroom air conditioner will activate cooling mode at {{ (state_attr('input_datetime.master_bedroom_cooling','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','Fan') %}
|
|
"The master bedroom air conditioner will activate fan only mode at {{ (state_attr('input_datetime.master_bedroom_cooling','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','N/A') %}
|
|
"The master bedroom air conditioner will remain inactive tonight. "
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if is_state('fan.master_bedroom_fan_socket_1','on') %}
|
|
"The master bedroom fan is already running. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_fan','Fan') %}
|
|
"The master bedroom fan will activate at {{ (state_attr('input_datetime.master_bedroom_fan','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_fan','N/A') %}
|
|
"The master bedroom fan will remain inactive tonight. "
|
|
{% endif %}
|
|
{% if is_state('input_boolean.kallen_overnight','off') %}
|
|
{% if is_state('fan.kallen_bedroom_fan','on') %}
|
|
"Collin's fan is already running. "
|
|
{% elif is_state('input_boolean.white_noise_kallen_bedroom','on') %}
|
|
"Collin's white noise generator is already running. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_kallen_fan','Fan') %}
|
|
"Collin's fan will activate at {{ (state_attr('input_datetime.kallen_bedtime','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_kallen_fan','White Noise') %}
|
|
"Collin's white noise generator will activate at {{ (state_attr('input_datetime.kallen_bedtime','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_kallen_fan','N/A') %}
|
|
"Collin's room will have no devices activated tonight. "
|
|
{% endif %}
|
|
{% else %}
|
|
"Collin's room will be left alone, as he is spending the night elsewhere tonight. "
|
|
{% endif %}
|
|
{% if is_state('fan.emma_air_conditioner','on') %}
|
|
"Emma's air conditioner is already running. "
|
|
{% elif is_state('input_boolean.white_noise_emma_bedroom','on') %}
|
|
"Emma's white noise generator is already running. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_emma_aircon','AC') %}
|
|
"Emma's air conditioner will be activated at {{ (state_attr('input_datetime.emma_bedtime','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_emma_aircon','White Noise') %}
|
|
"Emma's white noise generator will activate at {{ (state_attr('input_datetime.emma_bedtime','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_emma_aircon','N/A') %}
|
|
"Emma's room will have no devices activated tonight. "
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% set windows = states('sensor.windows_open') %}
|
|
{% set doors = states('sensor.doors_open') %}
|
|
{% if states('sensor.total_faults') > '0' %}
|
|
{% if windows > '0' and doors > '0' %}
|
|
"There are currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}and {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
|
{% else %}
|
|
{% if windows > '0' %}
|
|
"There {% if windows == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}open. "
|
|
{% endif %}
|
|
{% if doors > '0' %}
|
|
"There {% if doors == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
|
{% endif %}
|
|
{% endif %}
|
|
"You will want to close these before the security system is armed for the night. "
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
"For some useless trivia that no one asked for, I present to you the following: "
|
|
{% if (states('sensor.front_door_opened_today') | int) > 0 %}
|
|
"Today, the front door was opened {{ states('sensor.front_door_opened_today') }} times. "
|
|
{% else %}
|
|
"Today, the front door was never opened at all. Wow, did you people seriously not go anywhere? "
|
|
{% endif %}
|
|
{% if (states('sensor.back_door_opened_today') | int) > 0 %}
|
|
{% if (states('sensor.back_door_opened_today') | int) == 1 %}
|
|
"And in a rare and shocking incident, the back door was also opened today! But only just once. There's no telling what could happen otherwise! "
|
|
{% else %}
|
|
"In what has to be considered a near catastrophic incident, the back door was opened multiple times today! {{ states('sensor.back_door_opened_today') }} times, to be precise! "
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
Here is a random dad joke <break time="1s"/> {{ states('sensor.random_joke') }}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.briefing_extras','on') %}
|
|
"And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} "
|
|
{% endif %}
|
|
</p>
|
|
|
|
{%- endmacro -%}
|
|
|
|
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
|
{%- macro cleanup(data) -%}
|
|
{%- for item in data.split("\n") if item | trim != "" -%}
|
|
{{ item | trim }} {% endfor -%}
|
|
{%- endmacro -%}
|
|
|
|
{# a macro to call all macros :) #}
|
|
{%- macro mother_of_all_macros() -%}
|
|
{{ getReport() }}
|
|
{%- endmacro -%}
|
|
|
|
{# Call the macro #}
|
|
{{- cleanup(mother_of_all_macros()) -}} |