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

130 lines
6.8 KiB
YAML

>
{# Kallen Nightly Briefing #}
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% from 'speech.jinja' import dadjoke %}
{% from 'easy_time.jinja' import count_the_days, custom_time %}
<p>
Good Evening, Collin, it is currently {{ now().strftime("%I:%M %p") }}.
{{ [ 'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a shower.',
'It is about time that you showered, so you need to head upstairs and get on that.',
'Did you ever hear the one about the kid who never took a shower? <break time="2s"/>Yeah, me either. So we should keep it that way. It is time to get ready for bed.',
'It is almost bedtime. That means it is time to start preparing for bed.',
'I hate to say it but, the day is coming to an end. Time to finish up your tasks, pick up any toys you have out, and get ready for bed.',
'The count down clock until bedtime has started. Time to get cleaned up, get your pajamas on, and head for your bedroom.',
'Its the final countdown <break time="2s"/> until bedtime, silly. Time to get ready to head that way!'
] | random }}
{% if is_state('binary_sensor.kallen_school_tomorrow', 'on') %}
{{ [ 'Because you have school tomorrow. ',
'Because you have to get up early tomorrow for school.',
'Because you want to be ready for school tomorrow.'
] | random }}
{% if is_state('binary_sensor.kallen_btb_tomorrow','on') %}
{% if is_state('input_boolean.school_in_session','on') %}
{{ [ 'You have Beyond The Bells tomorrow after school. ',
'You will be staying a little later after school tomorrow to further your learning endeavors. ',
'Tomorrow is a BTB day. '
] | random }}
{% else %}
'You have a summer session of Beyond The Bells tomorrow. '
{% endif %}
{% endif %}
{% else %}
{% set month=states("sensor.date").split('-')[1] | int %}
{%- if is_state('input_boolean.school_in_session', 'off') -%}
{{ [ 'Looks like tomorrow is another day of summer vacation. ',
'You are still on summer break tomorrow. ',
'Summer vacation does not last forever, but it is not over yet. '
] | random }}
{% else %}
Oh, and it appears you do not have school tomorrow
{% endif %}
{{ [ 'so you can sleep in late. ',
'so let us sleep a little later. ',
' so there is not a reason to get up early. ',
'so we can sleep in. '
] | random }}
{% endif %}
{% if (count_the_days('input_datetime.school_first_day') | int < 10) and (count_the_days('input_datetime.school_first_day') | int > 1) -%}
{{ [ 'I hate to say it, but ',
'Unfortunately,',
'All good things must come to an end.'
] | random }}
There are only {{ count_the_days('input_datetime.school_first_day') }} days
{{ [ 'left of summer vacation. ',
' left of summer break.',
'Until School starts again.'
] | random }}
{% elif count_the_days('input_datetime.school_first_day') | int == 1 -%}
Tomorrow is the first day of school. Are you ready?
{%- 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 }}
{% elif count_the_days('input_datetime.school_last_day') | int == 0 -%}
Tomorrow is the first day of summer. Are you ready?
{%- endif %}
{{ [ 'I will turn on your bedroom lights and appropriate white noise device at bedtime.',
'I have executed the Pre bed routine for your room. Standby for bedtime protocol in two zero minutes.',
'I will prepare your bedroom shortly.',
'I have made your bed for you. Haha, just kidding, I do not have arms.',
'Your bedroom anxiously awaits you. Do not be late!',
'Try not to be late for your meeting with the sandman. See you shortly.',
] | random }}
'Do not forget to take your melatonin.'
</p>
<p>
{% if is_state('binary_sensor.lightning_warning','on') %}
{% set ltgdist = (states('sensor.blitzortung_lightning_distance') | int) / 1.609 | round %}
{{ [
"Please ignore that strobing effect in your window. That is mother nature trying to distract you from sleeping. Do not give in! ",
"There is lightning outside, but you are safe because you are inside. Anti lightning turrets have already been deployed. ",
"Do not let the lightning outside keep you awake. The thunder will do a good enough job of that. ",
] | random }}
{% endif %}
</p>
<p>
{{ dadjoke() }}
</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 -%}
{{- cleanup(getReport()) -}}