{% if is_state('sensor.halloween_countdown','0') %}
Happy Halloween!
{% endif %}
{% if is_state('sensor.christmas_countdown','0') %}
Merry Christmas!
{% endif %}
{% if is_state('sensor.anniversary_our_wedding','0') %}
Happy Anniversary! It been an amazing {{ states.sensor.anniversary_our_wedding.attributes.years }} years!
{% endif %}
{% if is_state('calendar.holidays_in_united_states', 'on') %}
Today is {{states.calendar.holidays_in_united_states.attributes.message}}.
{% endif %}
{% if is_state('calendar.anchorage_holidays', 'on') %}
And do not forget. Today is also {{states.calendar.anchorage_holidays.attributes.message}}.
{% endif %}
{% if states.calendar.birthdays.state == 'on' %}
Today is {{ states.calendar.birthdays.attributes.message }}! So Happy Birthday! The confetti cannon is not working otherwise I would shower you in paper garbage that someone else would have to pick up.
{% endif %}
{%- set event=states.calendar.national_holidays.attributes.message %}
{% if 'Day' in event and 'National' in event%}
{{[
'Today is also known as ',
'Today we are also celebrating'
]|random }}
{{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}.
{% if states.sensor.vacation_days2go.state | int < 32 and states.sensor.vacation_days2go.state | int < 0 and states.sensor.vacation_days2go.state != 'unknown' %}
{%- if states.sensor.home_to_zoo.state|round > 50 %}
Traffic to the Zoo appears heavy than normnal.
{% else %}
Traffic to the Zoo is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_zoo.state|round}} minutes to get to the Zoo taking {{ states.sensor.home_to_zoo.attributes.route }}.
{%- if states.sensor.home_to_summit.state|round > 50 %}
Traffic to Summit appears heavy than normnal.
{% else %}
Traffic to Summit is normal.
{% endif %}
Currently it will take {{states.sensor.home_to_summit.state|round}} minutes to get to Summit taking {{ states.sensor.home_to_summit.attributes.route }}
</p>
{%- endif -%}
<p>
Around the house,
{% if is_state('binary_sensor.morning','on') %}
{% if is_state('input_boolean.skylar_awake', 'on') %}
Skylar was up and moving at {{ states.input_datetime.skylar_awake_at.state }}.
{% if is_state('media_player.theater_tv', 'on') %}
but I currently cannot find him on any of my sensors.
{% endif %}
{% else %}
It doesn't appear that Skylar is out of bed yet.
{% endif %}
{% endif %}
{%- if is_state('climate.home','off') %}
The internal climate control system is off. The temperature inside is {{ states.climate.home.attributes.current_temperature }} degrees.
{%- elif is_state('climate.home','heat_cool') %}
The internal climate control system will try to keep the temperature between {{ states.climate.home.attributes.target_temp_low }} and {{ states.climate.home.attributes.target_temp_high }}.
{% else %}
The internal climate control system is set to {{ states.climate.home.state }} with a current temperature of {{ states.climate.home.attributes.current_temperature }} which is
{%- if states.climate.home.attributes.current_temperature | int - states.climate.home.attributes.temperature | int |round > 0 %}
{{states.climate.home.attributes.current_temperature | int - states.climate.home.attributes.temperature | int }} degrees above
{%- elif states.climate.home.attributes.current_temperature | int - states.climate.home.attributes.temperature | int |round < 0 %}
the set point of {{ states.climate.home.attributes.temperature }}
degrees.
{%- endif -%}
And The internal humidity is currently {{ states.climate.home.attributes.current_humidity }} percent.
The garage is {{states.sensor.acurite_tower_10968_t.state|round}} degrees with a humidity of {{states.sensor.acurite_tower_10968_h.state|round}} percent.
{%- if is_state('media_player.croft_tv','playing') or is_state('binary_sensor.croft_occupancy','on') %}
There appears to be activity in the Croft.
{%- if is_state('media_player.croft_tv','playing') %}
There are currently {{ (states.light | selectattr('state', 'eq', 'on') | list | count) | int + (states.switch | selectattr('state', 'eq', 'on') | list | count) | int }} lights
{%- if is_state('sensor.washer_status','complete') %}
<p>
The washing machine completed its cycle
{% set seconds = now().timestamp() - as_timestamp(states.sensor.washer_status.last_changed) %}
{% set hours = seconds / 60 %}
{% if (seconds / ( 60 * 60 )) | int == 1 %}
over an hour ago.
{{[
'Do not forget to rotate the clothes.',
'Was someone going to rotate the laundry?',
'Once you rotate the laundry I will stop reminding you to do it. So if you want me to stop. Its up to you.'
]| random }}
{% elif (seconds / ( 60 * 60 )) | int > 1 and (seconds / ( 60 * 60 )) | int < 6 %}
over {{ (seconds // ( 60 * 60 )) | int }} hours ago.
{{[
'Much longer and you are going to need to wash them again.',
'Someone needs to rotate the laundry.',
'Do not forget about the clothes in the washing machine.',
'Surely you did not mean to forget about the clothes. Mistakes happen. But you can still fix it.',
'Do you like your clothes smelling like mildew? Becasue that is what is happening right now.'
]| random }}
{% elif (seconds / ( 60 * 60 )) | int > 6 %}
over {{ (seconds // ( 60 * 60 )) | int }} hours ago.
{{[
'That is a crazy amount of time.',
'Did you decide you want those clothes to suffer?',
'You might as well just rewash those clothes.',
'I can smell the mildew. Virtually I mean.',
'Surely you did not mean to forget about the clothes.'
]| random }}
{% else %}
{{(seconds // 60) | int }} minutes ago.
{{[
'Do not forget to rotate the clothes.',
'Someone forgot to move the clothes to the dryer. I am not going to name names, but there is a camera in there. Do I need to publically shame someone?',
'You might want to move them to the dryer.'
]| random }}
{% endif %}
</p>
{% endif %}
{%- 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 != "" -%}