> {# Daily Briefing #} {%- macro getReport() -%} {% from 'speech.jinja' import greeting, dadjoke, inspirational_quote %} {% from 'status.jinja' import houseStatusReport, tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %} {% from 'easy_time.jinja' import count_the_days %} {% from 'weather.jinja' import weatherReport %} {% from 'sports.jinja' import sports_pregame, sports_main %}
{{ greeting() }}
{{ weatherReport('full','tts','day') }}
{% if is_state('sun.sun','below_horizon') %} You have {% set seconds = as_timestamp(states.sun.sun.attributes.next_rising)-now().timestamp() %} {% set hours = seconds / 60 %} {% if seconds / ( 60 * 60 ) > 1 %} {{ (seconds // ( 60 * 60 )) | int }} hours {% else %} {{ (seconds // 60) | int }} minutes {% endif %} {{ [ 'until the sun rises.', 'until the sun is up', 'before the sun officially rises.' ] | random }} {% else %} You have {% set seconds = as_timestamp(states.sun.sun.attributes.next_setting)-now().timestamp() %} {% set hours = seconds / 60 %} {% if seconds / ( 60 * 60 ) > 1 %} {{ (seconds // ( 60 * 60 )) | int }} hours {% else %} {{ (seconds // 60) | int }} minutes {% endif %} {{ [ 'until the sun sets for the day.', 'until the sun slips below the horizon.', 'before the sun officially sets. ' ]|random }} {% endif %}
{% set dow = as_timestamp(now()) | timestamp_custom('%A') %}
{{ [
"On today's agenda, we have the following. ",
"Today's announcements include the following. ",
"Given that you are well into your day, here is a bit of helpful information. ",
"You are past the point of no return and must finish your day, so I am here to help you out. ",
"The developer has informed me that I must inform you of the following informational information. ",
] | random }}
{% if is_state('binary_sensor.evening','on') %}
{% if is_state('sensor.anniversary_tony_s_birthday','0') %}
Hope you had a happy birthday Tony!
{% endif %}
{% if is_state('sensor.anniversary_tina_s_birthday','0') %}
Hope you had a happy birthday Tina!
{% endif %}
{% if is_state('sensor.anniversary_kallen_s_birthday','0') %}
Hope you had a happy birthday Collin!
{% endif %}
{% if is_state('sensor.anniversary_emmalynn_s_birthday','0') %}
Hope you had a happy birthday Emmalynn!
{% endif %}
{% if states.sensor.halloween_countdown.state | int == 1 %}
Tomorrow is Halloween. I hope you have picked out a costume. I will be going as Tony. I am scared just thinking about it!
{% elif states.sensor.halloween_countdown.state | int < 30 %}
There are only {{states.sensor.halloween_countdown.state}} days
{{ [ 'until Halloween.',
'until Halloween. It might not be enough time.',
'until you need a costume.'
] | random }}
{% endif %}
{% if states.sensor.christmas_countdown.state | int == 1 %}
Tomorrow is Christmas.
{{ houseStatusReport('full','tts') }}
{% if state_attr('calendar.garbage_collection','start_time') != none %} {% if count_the_days('calendar.garbage_collection','start_time') | int == 1 %} {% if state_attr('calendar.garbage_collection','message') == 'Large Garbage Pickup' %} Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all regular trash, as well as any larger items that need to be disposed of. {% else %} Tomorrow is regular garbage pickup. Make sure that all trash cans are emptied and the outside bin has been wheeled to the curb. {% endif %} {% elif is_state('calendar.garbage_collection','on') %} Today is garbage day. Please make sure to wheel the garbage bin back to the house. {% endif %} {% endif %}
{% if is_state('input_boolean.sports_updates','on') %} {% if is_state('binary_sensor.michigan_wolverines_inhibit','off') %} {{ sports_pregame('sensor.michigan_wolverines') }} {% endif %} {% if is_state('binary_sensor.ohio_state_buckeyes_inhibit','off') %} {{ sports_pregame('sensor.ohio_state_buckeyes') }} {% endif %} {% if is_state('binary_sensor.toledo_rockets_inhibit','off') %} {{ sports_pregame('sensor.toledo_rockets') }} {% endif %} {% if is_state('binary_sensor.minnesota_vikings_inhibit','off') %} {{ sports_pregame('sensor.minnesota_vikings') }} {% endif %} {% if is_state('binary_sensor.san_francisco_49ers_inhibit','off') %} {{ sports_pregame('sensor.san_francisco_49ers') }} {% endif %} {% if is_state('binary_sensor.cleveland_guardians_inhibit','off') %} {{ sports_pregame('sensor.cleveland_guardians') }} {% endif %} {% if is_state('binary_sensor.minnesota_twins_inhibit','off') %} {{ sports_pregame('sensor.minnesota_twins') }} {% endif %} {% if is_state('binary_sensor.los_angeles_dodgers_inhibit','off') %} {{ sports_pregame('sensor.los_angeles_dodgers') }} {% endif %} {% endif %}
{% if is_state('input_boolean.sports_updates','on') %} {% if is_state('binary_sensor.michigan_wolverines_inhibit','off') %} {{ sports_main('sensor.michigan_wolverines') }} {% endif %} {% if is_state('binary_sensor.ohio_state_buckeyes_inhibit','off') %} {{ sports_main('sensor.ohio_state_buckeyes') }} {% endif %} {% if is_state('binary_sensor.toledo_rockets_inhibit','off') %} {{ sports_main('sensor.toledo_rockets') }} {% endif %} {% if is_state('binary_sensor.minnesota_vikings_inhibit','off') %} {{ sports_main('sensor.minnesota_vikings') }} {% endif %} {% if is_state('binary_sensor.san_francisco_49ers_inhibit','off') %} {{ sports_main('sensor.san_francisco_49ers') }} {% endif %} {% if is_state('binary_sensor.cleveland_guardians_inhibit','off') %} {{ sports_main('sensor.cleveland_guardians') }} {% endif %} {% if is_state('binary_sensor.minnesota_twins_inhibit','off') %} {{ sports_main('sensor.minnesota_twins') }} {% endif %} {% if is_state('binary_sensor.los_angeles_dodgers_inhibit','off') %} {{ sports_main('sensor.los_angeles_dodgers') }} {% endif %} {% endif %}
{{ dadjoke() }}
{% 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 %}
And now, one more thing before I go. {{ inspirational_quote() }}
{%- 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()) -}}