2019-02-21 17:49:55 +00:00
>
2019-07-11 11:18:09 +00:00
{% macro getSnark() %}
{{ [ "Good evening, " ,
"Before we shut this party down, " ,
"Good Evening Anchorage House, "
] | random }}
{{ [ "I thought you might like to know. " ,
"I might have some bad news for you." ,
"Just one more thing."
] | random }}
{% endmacro %}
2019-02-21 17:49:55 +00:00
{% macro getForecast() %}
2019-07-11 11:18:09 +00:00
The low tonight will be {{states.sensor.dark_sky_overnight_low_temperature_0d.state | round}} degrees and there is a {{states.sensor.dark_sky_precip_probability_0d.state|round}} percent chance of rain.
2019-02-21 17:49:55 +00:00
{% endmacro %}
{% macro getTrashDay() %}
{% if is_state("sensor.weekday", "mon") %}
2019-07-11 11:18:09 +00:00
Don't forget Tomorrow is trash day!
2019-02-21 17:49:55 +00:00
{% endif %}
{% endmacro %}
{% macro getBirthdays() %}
2019-03-09 02:52:37 +00:00
{% if states.sensor.birthday_skylar.state | int == 1 %}
2019-02-21 17:49:55 +00:00
Tomorrow is Skylar's Birthday.
{% endif %}
2019-03-09 02:52:37 +00:00
{% if states.sensor.birthday_skylar.state | int > 1 %}
{% if states.sensor.birthday_skylar.state | int < 5 %}
Skylar's birthday is in {{states.sensor.birthday_skylar.state}} days!
{% endif %}
{% endif %}
{% if states.sensor.birthday_jeff.state | int == 1 %}
2019-02-21 17:49:55 +00:00
Tomorrow is Jeff's Birthday.
{% endif %}
2019-03-09 02:52:37 +00:00
{% if states.sensor.birthday_kat.state | int == 1 %}
2019-02-21 17:49:55 +00:00
Tomorrow is Katherine's Birthday.
{% endif %}
2019-03-09 02:52:37 +00:00
{% if states.sensor.anniversary_our_wedding.state | int == 1 %}
2019-02-21 17:49:55 +00:00
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endmacro %}
{% macro getHolidays() %}
2019-03-09 02:52:37 +00:00
{% if states.sensor.holiday_halloween.state | int == 1 %}
2019-02-21 17:49:55 +00:00
Tomorrow is Halloween. Hope you have picked out a costume.
2019-07-11 11:18:09 +00:00
{{ [ "I'll be going as a dumb home. " ,
"I've prepped the scary music. Just in case." ,
"I'll be going as HAL 9000."
] | random }}
2019-02-21 17:49:55 +00:00
{% endif %}
2019-03-09 02:52:37 +00:00
{% if states.sensor.holiday_christmas.state | int == 1 %}
2019-02-21 17:49:55 +00:00
Tomorrow is Christmas. It's practically here!
{% 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 != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
2019-07-11 11:18:09 +00:00
{{ getSnark() }}
2019-02-21 17:49:55 +00:00
{{ getForecast() }}
{{ getTrashDay() }}
{{ getBirthdays() }}
{{ getHolidays() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}