203 lines
10 KiB
YAML
203 lines
10 KiB
YAML
>
|
|
{# Kallen Morning Briefing #}
|
|
{% from 'formatting.jinja' import cleanup %}
|
|
{%- macro getReport() -%}
|
|
{% from 'time.jinja' import current_time, current_date_readout, input_datetime_read %}
|
|
{% from 'speech.jinja' import dadjoke, inspirational_quote %}
|
|
{% from 'easy_time.jinja' import count_the_days, custom_time %}
|
|
{% set precipTypes = [
|
|
states.sensor.pirateweather_precip,
|
|
states.sensor.openweathermap_precipitation_kind,
|
|
states.sensor.tomorrow_io_stratton_ave_precipitation_type
|
|
] %}
|
|
{% set snowing = precipTypes | selectattr('state','eq','snow') | map(attribute='state') | list | count | int %}
|
|
<p>
|
|
Good morning, Collin.
|
|
|
|
{% if is_state('binary_sensor.morning','on') %}
|
|
<s>Today is {{ current_date_readout() }}.</s>
|
|
{% else %}
|
|
<s>It is {{ current_time('time',12) }}.</s>
|
|
{% endif %}
|
|
|
|
{% 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!',
|
|
'I like cheese. And you are not awake yet. These things have nothing to do with each other. Farts. ',
|
|
'No more mister nice Joanna. Engaging shock turrets in five seconds. ',
|
|
'The developer sucks at his job, so you get this stupid line today. Wake up butthead. ',
|
|
] | random }}
|
|
{% endif %}
|
|
</p>
|
|
<p>
|
|
{% if is_state('binary_sensor.lightning_warning','on') %}
|
|
{% set ltgdist = (states('sensor.blitzortung_lightning_distance') | int) / 1.609 | round %}
|
|
{{ [
|
|
"There are reports of lightning in the area, please stay safe. ",
|
|
"My sensors detect the presence of lightning nearby, so you should prepare to take shelter if needed. ",
|
|
"A little birdy told me there is lightning nearby. His feathers were all sticking up, I have no idea why. ",
|
|
"Please exercise caution, as there is lightning in the area. ",
|
|
"That flashing in the sky is not interstellar warfare, it is simply lightning. But you should still be careful outside. ",
|
|
] | random }}
|
|
"The nearest lightning strike is {{ ltgdist }} miles away. "
|
|
{% endif %}
|
|
</p>
|
|
<p>
|
|
Today the high temperature will be {{ states('sensor.todays_high_temp') }} degrees.
|
|
{{ states('sensor.clothing_forecast_detail') }}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.school_in_session','off') and is_state('input_boolean.kallen_btb','on') %}
|
|
You have Beyond The Bells today. It is scheduled to end at {{ input_datetime_read('input_datetime.kallen_school_day_end') | trim }}.
|
|
{% elif is_state('input_boolean.school_in_session','on') %}
|
|
{% if is_state('input_boolean.kallen_school_today', 'on') %}
|
|
{% if count_the_days('input_datetime.school_first_day') | int == 0 %}
|
|
Today is the first day of school!
|
|
{% else %}
|
|
{{ [ 'Today is a school day.',
|
|
'It is a school day. ',
|
|
'There is school today. ',
|
|
'You must attend school today. ',
|
|
'Today, you get to attend your favorite place. Just kidding. It is a school day. ',
|
|
] | random }}
|
|
{% endif %}
|
|
{% if is_state('input_boolean.two_hour_delay','on') %}
|
|
{{ [
|
|
'School will be starting two hours late today, as you are likely already aware. ',
|
|
'Your school superintendant has decided to sleep in this morning. He also decided to let you do the same. What a guy! ',
|
|
'The weather dictates that you must wait two hours to go to school. I know you are totally bummed out, but it is for your safety. ',
|
|
] | random }}
|
|
{% else %}
|
|
{{ [
|
|
'I regret to inform you that your school is running on time today. ',
|
|
'My sensors detect that your school expects you at the usual time today. ',
|
|
'Unfortunately, your school has not decided to embrace the power of sleep. They are running on time today. ',
|
|
] | random }}
|
|
{% endif %}
|
|
{% if is_state('input_boolean.kallen_school_early_release','on') %}
|
|
{{ [
|
|
"And it is early dismissal today!",
|
|
"And you get out of school early today!",
|
|
"And school is releasing you into the wild earlier than usual today!",
|
|
"And you even get to come home a little earlier today!",
|
|
] | random }}
|
|
{% endif %}
|
|
<s>School today starts at {{ input_datetime_read('input_datetime.kallen_school_day_start') }}</s>
|
|
{% if is_state('binary_sensor.raining','on') %}
|
|
It appears to be raining right now, so you might get wet on your way to school.
|
|
{% endif %}
|
|
{% if is_state('input_boolean.kallen_btb','on') %}
|
|
You have Beyond The Bells today after school.
|
|
{% endif %}
|
|
{% if is_state('input_boolean.kallen_alternate_pickup','on') %}
|
|
Today, you will be picked up from school by {{ states('input_text.kallen_pickup') }}.
|
|
{% endif %}
|
|
{% if count_the_days('input_datetime.school_last_day') | int == 0 -%}
|
|
But today is the last day of School!
|
|
{%- endif %}
|
|
{{ [
|
|
"The lunch menu for today is ",
|
|
"Today's cuisine will be ",
|
|
"On today's episode of fine dining at school, we have ",
|
|
"Today, your lovely cafeteria workers will be serving up ",
|
|
"If you are wondering what you will be fooding today, it is ",
|
|
] | random }} {{ states('sensor.school_lunch_menu_items') }}.
|
|
{% endif %}
|
|
{% if is_state('input_boolean.kallen_school_today', 'off') %}
|
|
{% if is_state('input_boolean.school_cancelled','on') %}
|
|
{{ [
|
|
"It turns out you will not be attending school today after all. ",
|
|
"The school has decided not to open today. ",
|
|
"School is cancelled for today. Try not to be too disappointed by this terrible news. ",
|
|
"Due to the typical shenanigans of Ohio weather, your school is closed today. ",
|
|
"Your school does not want you to attend today. Oh. Sorry. They do not want anyone else to attend either. They are closed. ",
|
|
] | random }}
|
|
{% 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.',
|
|
'I know you will enjoy spending more time with your sister.',
|
|
'Emmalynn will be thrilled when she finds out about this.',
|
|
'Do not let your sister eat you for breakfast.',
|
|
] | random }}
|
|
{% endif %}
|
|
{% if (count_the_days('input_datetime.thanksgiving_break_start') | int <= 14) and (count_the_days('input_datetime.thanksgiving_break_start') | int > 0) %}
|
|
{{ [ 'Oh, and look at that.',
|
|
'For those trying to keep count. ',
|
|
'In case you were wondering.',
|
|
'Also, did you know.'
|
|
] | random }}
|
|
'Thanksgiving break starts in {{ custom_time('input_datetime.thanksgiving_break_start','week,day') }}!'
|
|
{% endif %}
|
|
{% if (count_the_days('input_datetime.christmas_break_start') | int <= 14) and (count_the_days('input_datetime.christmas_break_start') | int > 0) %}
|
|
{{ [ 'Oh, and look at that.',
|
|
'For those trying to keep count. ',
|
|
'In case you were wondering.',
|
|
'Also, did you know.'
|
|
] | random }}
|
|
'Christmas break starts in {{ custom_time('input_datetime.christmas_break_start','week,day') }}!'
|
|
{% endif %}
|
|
{% if (count_the_days('input_datetime.spring_break_start') | int <= 14) and (count_the_days('input_datetime.spring_break_start') | int > 0) %}
|
|
{{ [ 'Oh, and look at that.',
|
|
'For those trying to keep count. ',
|
|
'In case you were wondering.',
|
|
'Also, did you know.'
|
|
] | random }}
|
|
'Spring break starts in {{ custom_time('input_datetime.spring_break_start','week,day') }}!'
|
|
{% endif %}
|
|
|
|
{% if (count_the_days('input_datetime.school_last_day') | int < 35) and (count_the_days('input_datetime.school_last_day') | int > 0) -%}
|
|
{{ [ 'School is almost over for the year.',
|
|
'You have made it to the end of the school year.',
|
|
'You are almost done with school.'
|
|
] | random }}
|
|
There are only {{ count_the_days('input_datetime.school_last_day') }} days
|
|
{{ [ 'left in the school year ',
|
|
' left of school.',
|
|
'Until the last day of school.'
|
|
] | random }}
|
|
{%- endif %}
|
|
{% endif %}
|
|
|
|
{% if is_state ('input_boolean.kallen_school_today', 'off') and snowing > 0 %}
|
|
Do you wanna build a snowman? It is snowing!
|
|
{% endif %}
|
|
|
|
|
|
{% if count_the_days('input_datetime.school_last_day') | int == -1 -%}
|
|
Today is the first day of Summer Break!
|
|
{%- endif %}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.kallen_school_today','off') %}
|
|
{{ dadjoke() }}
|
|
{% 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>
|
|
|
|
<p>
|
|
And now, one more thing before I go. {{ inspirational_quote() }}
|
|
</p>
|
|
|
|
{%- endmacro -%}
|
|
{{- cleanup(getReport()) -}} |