168 lines
7.3 KiB
YAML
168 lines
7.3 KiB
YAML
>
|
|
{# Kallen Morning Report #}
|
|
{%- macro getReport() -%}
|
|
<p>
|
|
Good morning, Colin.
|
|
|
|
<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 put some real clothes on. ',
|
|
'If you have not gotten dressed it is that time.',
|
|
'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!!!',
|
|
] | random }}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('sensor.clothing_forecast', 'Freezing') %}
|
|
It is going to be freezing today. so I suggest wearing long pants and a heavy coat.
|
|
{% elif is_state('sensor.clothing_forecast','Cold') %}
|
|
It is going to be cold today. so I suggest wearing long pants and a light jacket.
|
|
{% elif is_state('sensor.clothing_forecast', 'Chilly') %}
|
|
It is going to be chilly today. so I suggest wearing at least long pants.
|
|
{% elif is_state('sensor.clothing_forecast', 'Nice') %}
|
|
It is going to be
|
|
{{ [ 'pretty nice outside. ',
|
|
'a good day to be outside. ',
|
|
'rather enjoyable outside. ',
|
|
] | random }}
|
|
So I suggest wearing shorts.
|
|
{% elif is_state('sensor.clothing_forecast', 'Toasty') and is_state('sensor.current_forecast','sunny') %}
|
|
It is going to be
|
|
{{ [ ' rather warm outside. ',
|
|
' almost too hot outside. ',
|
|
' a little warm today. ',
|
|
] | random }}
|
|
and very sunny, so I suggest wearing shorts and maybe some sunscreen.
|
|
{% elif is_state('sensor.clothing_forecast', 'Hot') and is_state('sensor.current_forecast','sunny') %}
|
|
It is going to be
|
|
{{ [ 'hotter than the sun today. ',
|
|
'hotter than the sun outside. ',
|
|
'super hot today. ',
|
|
'hotter than the inside of a volcano today. Well not exactly, but you get the point. '
|
|
] | random }}
|
|
and very sunny, so I suggest wearing shorts and maybe some sunscreen.
|
|
{% elif is_state('sensor.clothing_forecast', 'Toasty') %}
|
|
It is going to be
|
|
{{ [ ' rather warm outside. ',
|
|
' almost too hot outside. ',
|
|
' a little warm today. ',
|
|
] | random }}
|
|
So I suggest wearing shorts.
|
|
{% elif is_state('sensor.clothing_forecast', 'Hot') %}
|
|
It is going to be
|
|
{{ [ 'hotter than the sun today. ',
|
|
'hotter than the sun outside. ',
|
|
'super hot today. ',
|
|
'hotter than the inside of a volcano today. Well not exactly, but you get the point. '
|
|
] | random }}
|
|
So I suggest wearing shorts.
|
|
{% else %}
|
|
It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts.
|
|
{% endif %}
|
|
{% set hightemp = state_attr('sensor.current_forecast','high_temp') | float %}
|
|
{% if hightemp > 84 %}
|
|
Warning, today will be a very sweaty day, so you need to remember to stay hydrated.
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.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.school_day_start','timestamp') | int | timestamp_custom('%I:%M %p' , False)) }}</s>
|
|
<s>Pickup today will be at {{(state_attr('input_datetime.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 %}
|
|
{% endif %}
|
|
{% if is_state('input_boolean.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?',
|
|
'I hope you enjoy your day off. You deserve it.',
|
|
'Today would be a good day to spend some time with mom and dad.',
|
|
] | 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.school_today', 'off') and is_state('sensor.pirateweather_icon', 'snow') %}
|
|
Do you wanna build a snowman? It's 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()) -}} |