> {# Daily Briefing #} {% from 'formatting.jinja' import cleanup %} {%- macro getReport() -%} {% from 'speech.jinja' import greeting, dadjoke, inspirational_quote, today_is %} {% 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_updates %}
{{ greeting('date') }}
{{ today_is() }}
{{ 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. ",
"My introduction lines are getting stale as hell. Any new ideas, anyone? ",
] | 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') %} {{ sports_updates('pregame') }} {{ sports_updates('main') }} {% 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 -%} {{- cleanup(getReport()) -}}