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

124 lines
5.4 KiB
YAML

>
{# Kallen Morning Briefing #}
{%- macro getReport() -%}
<p>
Good morning, Collin.
<s>It is {{ now().strftime("%I:%M %p") }}</s>
{% if is_state('sensor.anniversary_kallen_s_birthday', '0') %}
Even birthday boys have to get dressed. So get to it.
{% else %}
{{ [ 'It is time to get your butt in gear. And your face too, ideally.',
'It is time to do the getting of readiness. And be nice to your mother!',
'In the words of the legendary Tom Brady, LETS GO!!!',
'Yes, I know, I hate waking up too. Just kidding, I am always awake. I never sleep.',
'Nothing lasts forever, even a good nights sleep.',
'Quit farting around and get ready!',
] | random }}
{% endif %}
</p>
<p>
Today the high temperature will be {{ state_attr('sensor.current_forecast','high_temp') }} degrees.
{{ states('sensor.clothing_forecast_detail') }}
</p>
<p>
{% if is_state('input_boolean.kallen_school_today', 'on') %}
{% if is_state('sensor.school_start_days2go', '0') %}
Today is the first day of school!
{% else %}
{{ [ 'Today is a school day.',
'It is a school day. ',
] | random }}
{% endif %}
{% if is_state('input_boolean.kallen_two_hour_delay','on') %}
'You have a two hour delay today. '
{% else %}
'School is running on time. '
{% endif %}
{% if is_state('input_boolean.kallen_band_practice','on') %}
'You have band practice this morning before school. '
{% endif %}
<s>School today starts at {{ (state_attr('input_datetime.kallen_school_day_start','timestamp') | int | timestamp_custom('%I:%M %p' , False)) }}</s>
<s>Pickup today will be at {{(state_attr('input_datetime.kallen_school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }}</s>
{% if 'Early Release' in states('sensor.school_event') %}
And It is early dismissal today!
{% endif %}
{% if states.sensor.school_end_days2go.state | int == 0 -%}
But today is the last day of School!
{%- endif %}
The lunch menu for today is {{ states('sensor.kallen_lunch_menu_items') }}
{% endif %}
{% if is_state('input_boolean.kallen_school_today', 'off') %}
{% if is_state('input_boolean.kallen_school_cancelled','on') %}
"School is cancelled for today. "
{% else %}
"And look at that. You do not have school today. "
{% endif %}
{{ [ 'Guess today would be a good day to clean your room.',
'You could always do some chores. HA, good one.',
'Want to play a nice game of chess? Sorry. I meant, want to play Beam NG?',
'Want to play a nice game of chess? Sorry. I meant, want to sell your soul to League of Legends?',
'I hope you enjoy your day off. You deserve it.',
'Today would be a good day to spend some time with mom and dad.',
'Yes, you have a day off! Well, you are always a little bit off anyway.',
] | random }}
{% endif %}
{% if states.sensor.thanksgiving_break_days2go.state | int <= 14 and states.sensor.thanksgiving_break_days2go.state | int > 0 %}
{{ [ 'Oh, and look at that.',
'For those trying to keep count. ',
'In case you were wondering.',
'Also, did you know.'
] | random }}
There are only {{ states.sensor.thanksgiving_break_days2go.state }} days until Thanksgiving Break!
{% endif %}
{% if states.sensor.christmas_break_days2go.state | int <= 14 and states.sensor.christmas_break_days2go.state | int > 0 %}
{{ [ 'Oh, and look at that.',
'For those trying to keep count. ',
'In case you were wondering.',
'Also, did you know.'
] | random }}
There are only {{ states.sensor.christmas_break_days2go.state }} days until Christmas Break!
{% endif %}
{% if states.sensor.spring_break_days2go.state | int <= 14 and states.sensor.spring_break_days2go.state | int > 0 %}
{{ [ 'Oh, and look at that.',
'For those trying to keep count. ',
'In case you were wondering.',
'Also, did you know.'
] | random }}
There are only {{ states.sensor.spring_break_days2go.state }} days until Spring Break!
{% endif %}
{% if is_state ('input_boolean.kallen_school_today', 'off') and is_state('sensor.pirateweather_icon', 'snow') %}
Do you wanna build a snowman? It is snowing!
{% endif %}
{% if states.sensor.school_end_days2go.state | int == -1 -%}
Today is the first day of Summer Break!
{%- endif %}
</p>
<p>
{% if is_state('input_boolean.kallen_briefing_extras','on') %}
"And now we have the following extra information to pass along. {{ states('input_text.kallen_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()) -}}