157 lines
8.5 KiB
YAML
157 lines
8.5 KiB
YAML
>
|
|
{# Nightly Briefing #}
|
|
{% from 'formatting.jinja' import cleanup %}
|
|
{%- macro getReport() -%}
|
|
{% from 'speech.jinja' import greeting, dadjoke, inspirational_quote %}
|
|
{% from 'time.jinja' import input_datetime_read, time_from_calendar, next_twitch_stream %}
|
|
{% from 'status.jinja' import tony_status_report, tina_status_report, kallen_status_report, emma_status_report %}
|
|
{% from 'easy_time.jinja' import count_the_days %}
|
|
{% from 'weather.jinja' import weatherReport %}
|
|
{% from 'sports.jinja' import sports_updates %}
|
|
<p>
|
|
{{ greeting('date') }}
|
|
</p>
|
|
<p>
|
|
{{ [
|
|
"Before the day comes to a close, here are my thoughts. Just kidding, I am a computer, I do not think. ",
|
|
"The day grows short, let us gather around the campfire for an epic tale of things to come. ",
|
|
"I am tired after a long day of doing absolutely nothing, but I am still here to give you the latest and greatest uselessness! ",
|
|
"My programmer decided that I should say something interesting here, and then he realized that he is not interesting. ",
|
|
"My introduction lines are getting stale as hell. Any new ideas, anyone? ",
|
|
] | random }}
|
|
</p>
|
|
|
|
<p>
|
|
{{ weatherReport('full','tts','night') }}
|
|
</p>
|
|
|
|
<p>
|
|
{{ tony_status_report('stream','tts') }}
|
|
{% if is_state('binary_sensor.kallen_school_tomorrow','on') %}
|
|
"Collin has school tomorrow at {{ time_from_calendar('calendar.kallen_school_days','start_time','read') }}. "
|
|
{% else %}
|
|
"Collin does not have school tomorrow. "
|
|
{% endif %}
|
|
{{ tina_status_report('work','tts') }}
|
|
{{ emma_status_report('sleep','tts') }}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.sports_updates','on') %}
|
|
{{ sports_updates('pregame') }}
|
|
{{ sports_updates('main') }}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if states('input_select.scheduled_climate_mode_master_bedroom_aircon') != 'N/A' or states('input_select.scheduled_climate_mode_master_bedroom_fan') != 'N/A' %}
|
|
{% if not is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','N/A') %}
|
|
{% if is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','AC') and is_state('input_boolean.hot_day','on') %}
|
|
"Today was a hot day, so the master bedroom air conditioner will start cooling a bit earlier tonight at {{ input_datetime_read('input_datetime.master_bedroom_cooling') }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','AC') %}
|
|
"The master bedroom air conditioner will start cooling at {{ input_datetime_read('input_datetime.master_bedroom_cooling') }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','Fan') %}
|
|
"The master bedroom air conditioner will activate fan only mode at {{ input_datetime_read('input_datetime.master_bedroom_cooling') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if states('input_select.scheduled_climate_mode_master_bedroom_fan') != 'N/A' %}
|
|
{% if not is_state('fan.master_bedroom_fan','on') %}
|
|
"The master bedroom fan will activate at {{ input_datetime_read('input_datetime.master_bedroom_fan') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if is_state('input_boolean.kallen_overnight','off') %}
|
|
{% if not is_state('input_select.scheduled_climate_mode_kallen_bedroom','N/A') %}
|
|
{% if is_state('input_select.scheduled_climate_mode_kallen_bedroom','Fan') and is_state('fan.kallen_bedroom_fan','off') %}
|
|
"Collin's fan will activate at {{ input_datetime_read('input_datetime.kallen_fan') }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_kallen_bedroom','White Noise') and is_state('input_boolean.white_noise_kallen_bedroom','off') %}
|
|
"Collin's white noise generator will activate at {{ input_datetime_read('input_datetime.kallen_bedtime') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
{% else %}
|
|
"Collin's room will be left alone, as he is spending the night elsewhere tonight. "
|
|
{% endif %}
|
|
{% if states('input_select.scheduled_climate_mode_emma_bedroom') != 'N/A' %}
|
|
{% if is_state('input_select.scheduled_climate_mode_emma_bedroom','AC') and is_state('fan.emma_air_conditioner','off') %}
|
|
"Emma's air conditioner will be activated at {{ input_datetime_read('input_datetime.emma_bedroom_cooling') }}. "
|
|
{% elif is_state('input_select.scheduled_climate_mode_emma_bedroom','White Noise') and is_state('input_boolean.white_noise_emma_bedroom','off') %}
|
|
"Emma's white noise generator will activate at {{ input_datetime_read('input_datetime.emma_bedtime') }}. "
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if (states('sensor.overnight_lowest_temperature') | int) <= (states('input_number.overnight_low_threshold') | int ) %}
|
|
"It will be very cold tonight, make sure to use extra blankets, wear more clothes, or whatever else will help you stay warm! Additionally, make sure Emma's heater is set high enough!"
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% set windows = states('sensor.window_faults') %}
|
|
{% set doors = states('sensor.door_faults') %}
|
|
{% if states('sensor.total_faults') > '0' %}
|
|
{% if windows > '0' and doors > '0' %}
|
|
"There are currently {{ states('sensor.window_faults') }} {% if windows == '1' %}window {% else %}windows {% endif %}and {{ states('sensor.door_faults') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
|
{% else %}
|
|
{% if windows > '0' %}
|
|
"There {% if windows == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.window_faults') }} {% if windows == '1' %}window {% else %}windows {% endif %}open. "
|
|
{% endif %}
|
|
{% if doors > '0' %}
|
|
"There {% if doors == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.door_faults') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
|
{% endif %}
|
|
{% endif %}
|
|
"You will want to close these before the security system is armed for the night. "
|
|
{% endif %}
|
|
</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>
|
|
{{ [
|
|
"For some useless trivia that no one asked for, I present to you the following: ",
|
|
"Since the developer who writes my scripts decided that this was somehow interesting, ",
|
|
"In case you had a burning desire to know, ",
|
|
"Since I know everyone lays awake at night wondering the answer to this question, ",
|
|
] | random }}
|
|
{% if (states('counter.front_door_opened_today') | int) > 0 %}
|
|
"Today, the front door was opened {{ states('counter.front_door_opened_today') }} times. "
|
|
{% else %}
|
|
"Today, the front door was never opened at all. Wow, did you people seriously not go anywhere? "
|
|
{% endif %}
|
|
{% if (states('counter.back_door_opened_today') | int) > 0 %}
|
|
{% if (states('counter.back_door_opened_today') | int) == 1 %}
|
|
"And in a rare and shocking incident, the back door was also opened today! But only just once. There's no telling what could happen otherwise! "
|
|
{% else %}
|
|
"In what has to be considered a near catastrophic incident, the back door was opened multiple times today! {{ states('counter.back_door_opened_today') }} times, to be precise! "
|
|
{% endif %}
|
|
{% 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>
|
|
One last thing before I go. {{ inspirational_quote() }}
|
|
</p>
|
|
|
|
{%- endmacro -%}
|
|
{{- cleanup(getReport()) -}} |