Combined speech notifications into single script thanks to @CCOSTAN

This commit is contained in:
Jeffrey Stone
2019-07-14 17:02:31 -04:00
parent d90380cc65
commit a7fc29e7a0
28 changed files with 750 additions and 998 deletions

View File

@@ -1,27 +0,0 @@
>
{# Halloween Countdown #}
{%- macro getCountDown() -%}
"Halloween is only {{ states.sensor.holiday_halloween.state }} days away! "
{{- [
" Have you picked a costume? I'm going as Disney's Haunted Mansion.",
" I'm going as a dumb home. Get it? "
] | random -}}
{%- endmacro -%}
{%- macro getTags() -%}
#homeassistant #iot #smarthome
{%- 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() -%}
{{ getCountDown() }}
{{ getTags() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,30 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
{{ [
"But the International Space Station is passing over. Wave.",
"But The International Space Station just flew by.",
"But if you were to look up right now, and it was dark outside, and you happened to be looking in the right place you would see the International Space Station go by. But it's already passed by now."
] | random}}
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,29 +0,0 @@
>
{% macro getConfirmation() %}
{{ [
"Okay.",
"If you insist.",
"I am afraid I can't do that Dave,,,I am kidding,",
"Leave it to me.",
"As you wish.",
"By your command.",
"Affirmative.",
"No Problem.",
"I think I can handle that.",
"Working on it now."
] | random }}
{% 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() -%}
{{ getConfirmation() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,25 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,23 +0,0 @@
>
{% macro getIssue() %}
{{ [
"I have detected an issue!",
"We have a problem!",
"You might not like this.",
"There is something that needs your attention."
] | random }}
{% 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() -%}
{{ getIssue() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,55 +0,0 @@
>
{% macro getIntro() %}
{% if is_state("sensor.jeff_location", "home") %}
{{ [
"I am not sure why you are asking me,",
"You must be having vision problems.",
"I don't want to alarm you, but"
] | random }}
Jeff is already home!
{% else %}
{% if is_state("sensor.jeff_destination", "na") %}
{%- if states.device_tracker.life360_jeffrey_stone.attributes.moving == True %}
Jeff is currenly moving, but
{{ [
"I am unable to determine his destination.",
"I am having trouble tracking him.",
"His destination is currently unknown."
] | random }}
At last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{%- elif states.device_tracker.life360_jeffrey_stone.attributes.driving == True %}
Jeff is currenly moving, but
{{ [
"I am unable to determine his destination.",
"I am having trouble tracking him.",
"His destination is currently unknown."
] | random }}
At last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{% else %}
{% if is_state("sensor.jeff_location", "Lost") %}
Jeff is lost, but at last check was {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes from home.
{% else %}
Jeff is currently at {{ states.sensor.jeff_location.state }}.
{% endif %}
{% endif %}
{% elif is_state("sensor.jeff_destination", "home") %}
Jeff is currenly heading home and will be here in {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes.
{% else %}
Jeff is heading to {{ states.sensor.jeff_destination.state }}.
{% endif %}
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,24 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
Jeff appears to be headed home. Based on current traffic conditions he should be here in {{states.sensor.jeff_ett_home.attributes.duration | round}} minutes.
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,33 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
{% endmacro %}
{% macro getMessage() %}
{{ [
"Jeff has arrived.",
"Jeff is in the neighborhood.",
"Jeff is arriving.",
"Jeff has finally made it home."
] | random }}
{% 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() -%}
{{ getIntro() }}
{{ getMessage() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,26 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
Katherine has arrived at work.
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,64 +0,0 @@
>
{% macro getIntro() %}
{% if is_state("sensor.kat_location", "home") %}
{{ [
"I am not sure why you are asking me,",
"You must be having vision problems.",
"I don't want to alarm you, but"
] | random }}
Katherine is already home!
{% else %}
{% if is_state("input_boolean.kat_travel_monitor", "on") %}
{%- if states.device_tracker.life360_kat_stone.attributes.moving == True %}
Katherine is currently heading home and will be here in {{states.sensor.kat_ett_home.attributes.duration | round}} minutes.
{%- elif states.device_tracker.life360_kat_stone.attributes.driving == True %}
Katherine is currently heading home and will be here in {{states.sensor.kat_ett_home.attributes.duration | round}} minutes.
{% else %}
{% if is_state("sensor.kat_location", "Lost") %}
Katherine is lost, but at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
Katherine is currently at {{ states.sensor.kat_location.state }}.
{% endif %}
{% endif %}
{% else %}
{%- if states.device_tracker.life360_kat_stone.attributes.moving == True %}
Katherine is currenly moving, and
{{ [
"I am unable to determine her destination.",
"I am having trouble tracking her.",
"Her destination is currently unknown."
] | random }}
At last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{%- elif states.device_tracker.life360_kat_stone.attributes.driving == True %}
Katherine is currenly moving, and
{{ [
"I am unable to determine her destination.",
"I am having trouble tracking her.",
"Her destination is currently unknown."
] | random }}
At last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
{% if is_state("sensor.kat_location", "Lost") %}
Katherine is lost, but at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% else %}
I have located Katherine. She is at {{ states.sensor.kat_location.state }}, and
at last check was {{states.sensor.kat_ett_home.attributes.duration | round}} minutes from home.
{% endif %}
{% endif %}
{% endif %}
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,24 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
Katherine appears to be headed home. Based on current traffic conditions she should be here in {{states.sensor.kat_ett_home.attributes.duration | round}} minutes.
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,33 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
{% endmacro %}
{% macro getMessage() %}
{{ [
"Katherine has arrived.",
"Katherine is in the neighborhood.",
"Katherine is arriving.",
"Katherine has finally made it home."
] | random }}
{% 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() -%}
{{ getIntro() }}
{{ getMessage() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,95 +0,0 @@
>
{% macro getGreeting() %}
{{ [ "Good morning Anchorage House. Rise and Shine. ",
"Good morning everyone. ",
"Good morning. The early bird gets the worm. And look over there. A worm. Wait, is that a snake? umm,,,I don't like snakes. Someone might want to take care,, ok,,, moving on.",
"Good morning. The early bird gets the worm.",
"Good morning from the bridge.",
"Pardom the interuption.",
"I hope I am not interupting, but I think this would be a good time for the morning report."
] | random }}
{% if is_state("input_boolean.guest_mode", "on") %}
{{ [ "And a special welcome to our guests. ",
"And good morning to our guests as well. ",
"Hey look at that, someone came to visit Anchorage House. Hope you slept well."
] | random }}
{% endif %}
{% endmacro %}
{% macro getTodaysEvent() %}
{% if is_state("sensor.holiday_halloween","0") %}
This is Halloween, this is halloween. Happy Halloween!
{% endif %}
{% if is_state("sensor.holiday_christmas","0") %}
Merry Christmas Everyone!
{% endif %}
{% if is_state("sensor.anniversary_our_wedding","0") %}
Happy Anniversary! It has 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 %}
{% endmacro %}
{% macro getCurrentConditions() %}
It's currently {{states.sensor.dark_sky_summary.state}} and {{states.sensor.dark_sky_temperature.state|round}} degrees according to Dark Sky.
The back porch is {{states.sensor.accurite_back_porch_temperature.state|round}} degrees and
The inside temperature is {{states.climate.home.attributes.current_temperature|round}} degrees. The Climate is set to {{states.climate.home.state}}.
{% endmacro %}
{% macro getForecast() %}
The rest of the day should be {{states.sensor.dark_sky_summary_0d.state}} with a high of {{states.sensor.dark_sky_daytime_high_temperature_0d.state|round}} degrees. There is a {{states.sensor.dark_sky_precip_probability_0d.state|round}} percent chance of rain.
{% endmacro %}
{% macro getBirthdays() %}
{% if states.calendar.birthdays.state == "on" %}
Today is {{ states.calendar.birthdays.attributes.message }} birthday!
{% else %}
{% if states.sensor.birthday_skylar.state | int == 1 %}
Tomorrow is Skylar's Birthday.
{% endif %}
{% if states.sensor.birthday_jeff.state | int == 1 %}
Tomorrow is Jeff's Birthday.
{% endif %}
{% if states.sensor.birthday_kat.state | int == 1 %}
Tomorrow is Katherine's Birthday.
{% endif %}
{% if states.sensor.anniversary_our_wedding.state | int == 1 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endif %}
{% endmacro %}
{% macro getAnniversary() %}
{% if states.sensor.anniversary_our_wedding.state | int == 1 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endmacro %}
{% macro getHolidays() %}
{% if states.sensor.holiday_halloween.state | int == 1 %}
Tomorrow is Halloween. Hope you have picked out a costume.
{% endif %}
{% if states.sensor.holiday_christmas.state | int == 1 %}
Tomorrow is Christmas. It's practically here! Santa is coming tonight! Don't forget the cookies!
{% elif states.sensor.holiday_christmas.state | int < 25 %}
There are only {{states.sensor.holiday_christmas.state}} days until christmas.
{% else %}
{% 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() -%}
{{ getGreeting() }}
{{ getTodaysEvent() }}
{{ getCurrentConditions() }}
{{ getForecast() }}
{{ getBirthdays() }}
{{ getAnniversary() }}
{{ getHolidays() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,72 +0,0 @@
>
{% macro getSnark() %}
{{ [ "Good evening, ",
"Pardon the interuption, ",
"Good Evening Anchorage House, "
] | random }}
{{ [ "I thought you might like to know. ",
"Here is the nightly report.",
"Before I call it a day I wanted to let you know,"
] | random }}
{% endmacro %}
{% macro getForecast() %}
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.
{% endmacro %}
{% macro getTrashDay() %}
{% if is_state("sensor.weekday", "mon") %}
{{ [ "Don't forget tomorrow is Trash Day. ",
"I advise you move the trash cans to the curb for the weekly pickup. ",
" The trash and recycle should go out"
] | random }}
{% endif %}
{% endmacro %}
{% macro getBirthdays() %}
{% if states.sensor.birthday_skylar.state | int == 1 %}
Tomorrow is Skylar's Birthday.
{% endif %}
{% 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 %}
Tomorrow is Jeff's Birthday.
{% endif %}
{% if states.sensor.birthday_kat.state | int == 1 %}
Tomorrow is Katherine's Birthday.
{% endif %}
{% if states.sensor.anniversary_our_wedding.state | int == 1 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endmacro %}
{% macro getHolidays() %}
{% if states.sensor.holiday_halloween.state | int == 1 %}
Tomorrow is Halloween. Hope you have picked out a costume.
{{ [ "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 }}
{% endif %}
{% if states.sensor.holiday_christmas.state | int == 1 %}
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() -%}
{{ getSnark() }}
{{ getForecast() }}
{{ getTrashDay() }}
{{ getBirthdays() }}
{{ getHolidays() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,50 +0,0 @@
>
{% macro getForecast() %}
The low tonight will be {{states.sensor.dark_sky_overnight_low_temperature_0.state | round}} degrees and there is a {{states.sensor.dark_sky_precip_probability_0.state|round}} percent chance of rain.
{% endmacro %}
{% macro getTrashDay() %}
{% if is_state("sensor.weekday", "mon") %}
Tomorrow is trash day!
{% endif %}
{% endmacro %}
{% macro getBirthdays() %}
{% if states.sensor.birthday_skylar.state | int < 2 %}
Tomorrow is Skylar's Birthday.
{% endif %}
{% if states.sensor.birthday_jeff.state | int < 2 %}
Tomorrow is Jeff's Birthday.
{% endif %}
{% if states.sensor.birthday_kat.state | int < 2 %}
Tomorrow is Katherine's Birthday.
{% endif %}
{% if states.sensor.anniversary_our_wedding.state | int < 2 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endmacro %}
{% macro getHolidays() %}
{% if states.sensor.holiday_halloween.state | int < 2 %}
Tomorrow is Halloween. Hope you have picked out a costume.
{% endif %}
{% if states.sensor.holiday_christmas.state | int < 2 %}
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() -%}
It is {{ now().strftime("%I:%M %p") }}.
{{ getForecast() }}
{{ getTrashDay() }}
{{ getBirthdays() }}
{{ getHolidays() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,22 +0,0 @@
>
{% macro getIntro() %}
{% if is_state("group.external_doors", "on") %}
There are doors are open.
{% else %}
All doors are closed.
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,75 +0,0 @@
>
{% macro getIntro() %}
{{ [ "Pardom me, Skylar,, ",
"Good morning Skylar, This is your digital assistant, Jarvis ",
"This is your cruise director with your morning announcements.",
] | random }}
{% endmacro %}
{% macro getDressed() %}
{% if is_state("sensor.birthday_skylar", "0") %}
First, Happy Birthday Skylar! Second, even birthday boys have to get dressed. So get to it.
{% else %}
If you haven't gotten dressed,
{{ [ "It is time to get dressed. ",
"It is time to put some real clothes on. ",
"it is now time to change your underwear.",
] | random }}
{% endif %}
{% endmacro %}
{% macro getSchoolDay() %}
{% if is_state("calendar.skylar_school", "on") %}
Because you have school today!
{% if states.calendar.skylar_school.attributes.description == "early-release" %}
And guess what? It is early release!
{% endif %}
# {% if is_state("sensor.weekday", "fri") %}
# Plus, it is fun Friday!
# {% endif %}
{% endif %}
{% endmacro %}
{% macro getEvents() %}
{% if is_state("calendar.skylar_events", "on") %}
You have {{ states.calendar.skylar_events.attributes.message }} today!
# {% if is_state("sensor.weekday", "fri") %}
# Plus, it is fun Friday!
# {% endif %}
{% endif %}
{% endmacro %}
{% macro getClothesSuggestion() %}
{% 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 nice today so I suggest wearing shorts.
{% elif is_state("sensor.clothing_forecast", "Toasty") %}
It is going to be a bit warm today so I suggest wearing shorts.
{% elif is_state("sensor.clothing_forecast", "Hot") %}
It is going to be hot today so I suggest wearing shorts.
{% else %}
{% 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() -%}
{{ getIntro() }}
{{ getDressed() }}
{{ getSchoolDay() }}
{{ getEvents() }}
{{ getClothesSuggestion() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,38 +0,0 @@
>
{% macro getIntro() %}
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but,"
] | random }}
Skylar. Bedtime is in thirty minutes.
{% endmacro %}
{% macro getPrebedRoutine() %}
If you are taking a bath now is the time to get in the tub, so you have time to brush teeth and read stories.
Otherwise it is time to put on your pajamas.
{% endmacro %}
{% macro getReminders() %}
Don't forget to feed your fish.
{% if is_state("sensor.weekday", "fri") %}
Oh, and tomorrow is the weekend, so why don't we sleep in.
{% 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() -%}
It is {{ now().strftime("%I:%M %p") }}.
{{ getIntro() }}
{{ getPrebedRoutine() }}
{{ getReminders() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,34 +0,0 @@
>
{% macro getIntro() %}
{{ [
"You might not like what I have to say.",
"Are you sure you want to know?",
"I can tell you but you are probably not going to like it.",
"Here you go."
] | random }}
Under current traffic conditions
{% endmacro %}
{% macro getTrafficZoo() %}
Zoo Atlanta is {{states.sensor.home_to_zoo.state|round}} minutes away
{% endmacro %}
{% macro getTrafficCox() %}
And Cox Automotive is {{states.sensor.home_to_summit.state|round}} minutes away by car.
{% 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() -%}
{{ getTrafficZoo() }}
{{ getTrafficCox() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,31 +0,0 @@
>
{% macro getCurrent() %}
It's currently {{states.sensor.dark_sky_summary.state}} and {{states.sensor.dark_sky_temperature.state|round}} degrees according to Dark Sky.
The back porch is {{states.sensor.accurite_back_porch_temperature.state|round}} degrees with a humidity of {{states.sensor.accurite_back_porch_humidity.state|round}} percent.
The garage is {{states.sensor.accurite_garage_temperature.state|round}} degrees with a humidity of {{states.sensor.accurite_garage_humidity.state|round}} percent.
The inside temperature is {{states.climate.home.attributes.current_temperature|round}} degrees and the Climate is set to {{states.climate.home.state}}.
{% endmacro %}
{% macro getTodayForecast() %}
The rest of the day should be {{states.sensor.dark_sky_summary_0d.state}} with a high of {{states.sensor.dark_sky_daytime_high_temperature_0d.state|round}} degrees. There is a {{states.sensor.dark_sky_precip_probability_0d.state|round}} percent chance of rain.
{% endmacro %}
{% macro getForecast() %}
Looking into the future you can expect {{states.sensor.dark_sky_daily_summary.state}}.
{% 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() -%}
{{ getCurrent() }}
{{ getTodayForecast() }}
{{ getForecast() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@@ -1,18 +0,0 @@
>
{% macro getIntro() %}
{% 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() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}