Files
Home-Assistant-Configs/templates/speech/morning_briefing.yaml

138 lines
5.6 KiB
YAML

>
{# Morning Briefing #}
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% from 'speech.jinja' import greeting, dadjoke, inspirational_quote, today_is %}
{% from 'status.jinja' import tony_status_report, tina_status_report, kallen_status_report, emma_status_report, morning_annc %}
{% from 'easy_time.jinja' import count_the_days %}
{% from 'weather.jinja' import weatherReport %}
{% from 'sports.jinja' import sports_updates %}
<p>
{{ greeting('nodate') }}
</p>
<p>
{{ today_is() }}
</p>
<p>
{{ morning_annc('full','tts') }}
</p>
<p>
{{ weatherReport('full','tts','morning') }}
</p>
<p>
{% if is_state('sensor.halloween_countdown','0') %}
Happy Halloween!
{% endif %}
{% if is_state('sensor.christmas_countdown','0') %}
Merry Christmas Everyone!
{% endif %}
{% if is_state('sensor.anniversary_wedding_anniversary','0') %}
Happy Anniversary! It been an amazing {{ states.sensor.anniversary_wedding_anniversary.attributes.years }} years!
{% endif %}
{% if is_state('calendar.holidays_in_united_states', 'on') %}
Today is {{states.calendar.holidays_in_united_states.attributes.message}}.
{% endif %}
{% if states.calendar.birthdays.state == 'on' %}
Today is {{ states.calendar.birthdays.attributes.message }}! So Happy Birthday! The confetti cannon is not working otherwise I would shower you in paper garbage that someone else would have to pick up.
{% endif %}
{%- set event=states.calendar.national_holidays.attributes.message %}
{% if 'Day' in event and 'National' in event%}
{{ [
'And a very special Happy ',
'It is also ',
'Today is also known as ',
'Oh <emphasis>Look</emphasis>. Today is ',
'Want to know a fact? Today is ',
'Everyday can be a holiday. So today is '
]|random }}
{{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}.
{%- endif -%}
</p>
<p>
{% if count_the_days('input_datetime.school_last_day') | int == 0 %}
Congratulations, today is the last day of school! Have an awesome day!
{% endif %}
</p>
<p>
{{ tina_status_report('work','tts') }}
</p>
<p>
{% if is_state('input_boolean.kallen_school_today','on') and is_state('input_boolean.work_today','on') %}
{% set diff = (state_attr('input_datetime.tina_workday_start','timestamp') - state_attr('input_datetime.kallen_school_day_start','timestamp')) %}
{%- if states.sensor.home_to_school.state|round > 12 %}
Traffic to the school appears heavier than normal.
{% else %}
Traffic to the school is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_school.state|round}} minutes to get to the school.
{%- if diff <= 3600 %}
{%- if states.sensor.school_to_bob_evans.state|round > 15 %}
Traffic from the school to Bob Evans appears heavier than normal.
{% else %}
Traffic from the school to Bob Evans is normal.
{% endif %}
Currently it will take {{states.sensor.school_to_bob_evans.state|round}} minutes to get to Bob Evans from the school.
{% endif %}
{% elif is_state('input_boolean.work_today','on') %}
{%- if states.sensor.home_to_bob_evans.state|round > 8 %}
Traffic to Bob Evans appears heavier than normal.
{% else %}
Traffic to Bob Evans is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_bob_evans.state|round}} minutes to get to Bob Evans.
{% elif is_state('input_boolean.kallen_school_today','on') %}
{%- if states.sensor.home_to_school.state|round > 12 %}
Traffic to the school appears heavier than normal.
{% else %}
Traffic to the school is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_school.state|round}} minutes to get to the school.
{% else %}
It appears no traffic reports are needed today. Enjoy your day off!
{% endif %}
</p>
<p>
{{ tony_status_report('stream','tts') }}
</p>
<p>
{% 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 %}
</p>
<p>
{% if is_state('input_boolean.sports_updates','on') %}
{{ sports_updates('pregame') }}
{{ sports_updates('main') }}
{% endif %}
</p>
<p>
{{ dadjoke() }}
</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>
<p>
And finally, here is a bit of inspiration to start your day. {{ inspirational_quote() }}
</p>
{%- endmacro -%}
{{- cleanup(getReport()) -}}