2020-12-03 03:55:11 +00:00
>
{# Morning Wakeup Report #}
{%- macro getReport() -%}
2020-12-13 01:50:38 +00:00
2021-04-22 00:24:21 +00:00
<p>
2020-12-03 03:55:11 +00:00
Good morning.
</p>
2021-04-22 00:24:21 +00:00
<p>
<s>It is {{ now().strftime("%I:%M %p") }}</s>
</p>
2020-12-03 03:55:11 +00:00
<p>
2022-03-06 23:35:23 +00:00
{# Moved the current conditions to a tempate sensor in packages/weather.yaml #}
{# That will allow me to use it on other briefings with without having to rewrite it #}
{{ states('sensor.current_conditions')}}
2020-12-03 03:55:11 +00:00
2021-04-22 00:24:21 +00:00
2021-06-17 01:07:03 +00:00
{% if states.sensor.weatheralerts_active_alerts.state | int > 0 %}
There are currently {{states.sensor.weatheralerts_active_alerts.state }} active weather alerts for our area.
2020-12-03 03:55:11 +00:00
{% endif %}
2022-03-06 23:35:23 +00:00
{# Moved the clothing forecast to a tempate sensor in packages/weather.yaml #}
{# That will allow me to use it on other briefings with without having to rewrite it #}
{{ states('sensor.clothing_forecast_detail') }}
2020-12-03 03:55:11 +00:00
</p>
2021-04-22 00:24:21 +00:00
2020-12-03 03:55:11 +00:00
<p>
2021-05-24 15:46:53 +00:00
{% if is_state('input_boolean.school_today', 'on') and state_attr('input_datetime.school_day_end', 'timestamp') < as_timestamp(now()) %}
2021-08-04 19:49:42 +00:00
{% 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 %}
2021-05-24 15:46:53 +00:00
<s>Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }}</s>
{% if 'Digital Learning' in states('sensor.school_event') %}
But it is a digital learning day so the commute will be short.
{% endif %}
{% if 'Early Release' in states('sensor.school_event') %}
And It is early release!
2020-12-03 03:55:11 +00:00
{% endif %}
2021-05-24 15:46:53 +00:00
{% if states.sensor.school_end_days2go.state | int == 0 -%}
But today is the last day of School!
{%- endif %}
{% endif %}
2021-08-04 19:49:42 +00:00
{% if is_state('input_boolean.school_today', 'on') and state_attr('input_datetime.school_day_end', 'timestamp') < as_timestamp(now()) and 'Digital Learning' not in states('sensor.school_event') %}
2021-05-24 15:46:53 +00:00
{% if is_state('sensor.school_lunch', 'Nothing') %}
I am not sure what the school menu is for today, so plan on Skylar taking his lunch
{% else %}
Today's school lunch is {{ states.sensor.school_lunch.state }}, so he might be interested in buying his lunch.
2021-04-22 00:24:21 +00:00
{% endif %}
2021-05-24 15:46:53 +00:00
{% endif %}
2021-04-22 00:24:21 +00:00
2021-05-24 15:46:53 +00:00
{% if states.sensor.school_end_days2go.state | int == -1 -%}
Today is the first day of Summer Break!
{%- endif %}
{% if 'School Holiday' in states('sensor.school_event') and is_state('input_boolean.school_today', 'off') %}
There is no school today.
{% endif %}
{% if is_state('calendar.skylar_events', 'on') %}
Skylar has {{ states.calendar.skylar_events.attributes.message }} today as well!
{% endif %}
2020-12-03 03:55:11 +00:00
</p>
2021-04-22 00:24:21 +00:00
2020-12-03 03:55:11 +00:00
<p>
2020-12-13 01:50:38 +00:00
{% if is_state('input_boolean.skylar_awake', 'on') %}
2020-12-03 03:55:11 +00:00
Skylar was up and moving at {{ states.input_datetime.skylar_awake_at.state }}.
{% if is_state('media_player.theater_tv', 'on') %}
2021-04-22 00:24:21 +00:00
and he appears to be in the Theater.
{% if is_state('input_boolean.skylar_dressed_reminder', 'on') %}
{{ [
'I did attempt to remind him to get dressed.' ,
'I reminded him to get dress.'
] |random }}
{% endif %}
{% elif is_state('media_player.croft_tv', 'playing') %}
and he appears to be in the Croft watching {{ states.media_player.croft_tv.attributes.app_name }}
{% if is_state('input_boolean.skylar_dressed_reminder', 'on') %}
{{ [
'I did attempt to remind him to get dressed.' ,
'I reminded him to get dress.'
] |random }}
{% endif %}
{% elif is_state('input_boolean.skylar_school', 'on') %}
and he appears to be at School.
{% else %}
but I currently cannot find him on any of my sensors.
2020-12-03 03:55:11 +00:00
{% endif %}
{% else %}
It doesn't appear that Skylar is out of bed yet.
{% endif %}
</p>
2021-04-22 00:24:21 +00:00
2020-12-03 03:55:11 +00:00
{%- 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()) -}}