diff --git a/config/templates/speech/daily_briefing.yaml b/config/templates/speech/daily_briefing.yaml new file mode 100755 index 0000000..0e5bc54 --- /dev/null +++ b/config/templates/speech/daily_briefing.yaml @@ -0,0 +1,524 @@ +> + {# DAily Briefing #} + {%- macro getReport() -%} +

+ {% if now().strftime('%H')|int < 12 %} + Good morning. + {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %} + Good afternoon. + {% else %} + Good evening. + {% endif %} +

+ + + {% if is_state('binary_sensor.morning','on') %} +

+ Today is {{states.sensor.today_is.state }}, {{ as_timestamp(now()) | timestamp_custom('%B %d %Y') }}. +

+ {% else %} +

+ It is {{ now().strftime("%I:%M %p") }} +

+ {% endif %} + + +

+ The Weather in Grayson is {{states.sensor.acurite_6045m_3078_t.state|round}} degrees + {% if is_state('weather.home', 'rainy') %} + {{ [ + 'with rain.', + 'with showers.' + ] | random }} + {% elif is_state('weather.home', 'cloudy') %} + {{ [ + 'with clouds.', + 'with cloudy skies.' + ] | random }} + {% elif is_state('weather.home', 'partlycloudy') %} + {{ [ + 'with some clouds.', + 'with partly cloudy skies.', + 'with scattered clouds' + ] | random }} + {% elif is_state('weather.home', 'sunny') %} + {% if is_state('sun.sun', 'above_horizon') %} + {{ [ + 'and sunny.', + 'with sun.' + ] | random }} + {% else %} + {{ [ + 'and clear.', + 'with clear skies.' + ] | random }} + {% endif %} + {% else %} + and {{ states.weather.home.state }} + {% endif %} + + + {% if states.sensor.nws_alerts.state | int > 0 %} + There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area. + The National Weather Service Has issued, + {% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}. + {% else %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}. + {% endif %} + {% endif %} + + {% if is_state('binary_sensor.evening','on') %} + The overnight forecast says we can expect {{ states.sensor.nws_overnight_forecast.state }} + {% else %} + The current forecast says we should expect {{ states.sensor.nws_current_forecast.state }} + {% if is_state('input_boolean.freeze_warning','on') %} + And based on the forecasted low, It will be near or below freezing. + {{ [ 'So, Someone might want to bring the lemon tree in. ', + 'Like, the turn water solid kind of cold. Do not leave the lemon tree out to die.', + 'I suggest bringing in the plants other wise, the temperature might kill them. And that will be on you.', + 'I would say winter is coming. But, based on the weather forecast it appears to be here.', + 'I would bring in the plants but I lack legs. And Arms. So I am forced to rely on you. Do not let me down.' + ] | random }} + {% endif %} + {% endif %} +

+ +

+ {% if is_state('sun.sun', 'below_horizon') %} + You have + {% set seconds = as_timestamp(states.sun.sun.attributes.next_rising)-now().timestamp() %} + {% set hours = seconds / 60 %} + {% if seconds / ( 60 * 60 ) > 1 %} + {{ (seconds // ( 60 * 60 )) | int }} hours + {% else %} + {{ (seconds // 60) | int }} minutes + {% endif %} + {{ [ + 'until the sun rises.', + 'until the sun is up.', + 'before the sun officially rises. ' + ]|random }} + {% else %} + You have + {% set seconds = as_timestamp(states.sun.sun.attributes.next_setting)-now().timestamp() %} + {% set hours = seconds / 60 %} + {% if seconds / ( 60 * 60 ) > 1 %} + {{ (seconds // ( 60 * 60 )) | int }} hours + {% else %} + {{ (seconds // 60) | int }} minutes + {% endif %} + {{ [ + 'until the sun sets for the day.', + 'until the sun slips below the horizon.', + 'before the sun officially sets. ' + ]|random }} + {% endif %} + +

+ + + {% if is_state('binary_sensor.morning','on') %} +

+ Overnight, + + {%- if is_state('sensor.front_door_motion_away_count','0') %} + There was no motion detected at the front door. + {% else %} + I detected motion at the front door {{ states.sensor.front_door_motion_away_count.state | int }} times. + {% endif %} +

+ {% endif %} + + {% set dow = as_timestamp(now()) | timestamp_custom('%A') %} +

+ You have some things on the calendar. + + {% if is_state('input_boolean.heartworm', 'on') %} + Today is the day Winston gets his heartworm medicine. + {% endif %} + + {% if dow == 'Sunday' and is_state('binary_sensor.midday','on') %} + {% if now().strftime('%H')|int > 17 %} + {{ [ 'Do not forget to do Skylars laundry. ', + 'Skylars laundry needs to be done today. ', + ] | random }} + {% endif %} + {% endif %} + + {% if dow == 'Monday' %} + {% if is_state('binary_sensor.evening','on') %} + {{ [ 'Do not forget tomorrow is Trash Day. ', + ' The trash and recycle should go out.' + ] | random }} + {% endif %} + {% endif %} + + {% if dow == 'Tuesday' %} + {% if is_state('binary_sensor.evening','on') %} + {{ [ 'Do not forget to bring in the trash cans. ', + 'The trash cans will feel lonely if you leave them out all night. ', + 'The HOA will get mad if you leave those trash cans out on the street.' + ] | random }} + {% endif %} + {% if is_state('binary_sensor.morning','on') %} + {{ [ 'Today is Trash Day.', + ' The trash and recycle should go out this morning.', + 'Do not forget to take the trash out.' + ] | random }} + {% endif %} + {% endif %} + + {% if is_state('binary_sensor.evening','on') %} + + {% if states.sensor.halloween_countdown.state | int == 1 %} + Tomorrow is Halloween. I hope you have picked out a costume. + {{ [ 'I will be going as a dumb home. ', + 'I have prepped the scary music. Just in case.', + 'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I dare you to ask me to open them. ' + ] | random }} + {% elif states.sensor.halloween_countdown.state | int < 30 %} + There are only {{states.sensor.halloween_countdown.state}} days + {{ [ 'until Halloween.', + 'until Halloween. It might not be enough time. ', + 'and counting until the best holiday ever.', + 'until you need a costume.' + ] | random }} + {% else %} + {% endif %} + + {% if states.sensor.christmas_countdown.state | int == 1 %} + Tomorrow is Christmas. It is practically here! Santa is coming tonight! Do not forget the cookies! + {% elif states.sensor.christmas_countdown.state | int < 31 %} + There are only {{states.sensor.christmas_countdown.state}} days until christmas. + {{ [ 'All I want for Christmas, is a hippopotamus.', + 'Hey Skylar, I know what you are getting for Christmas. But I am not telling.', + 'Do not forget to put something under the tree for your favorite smarthome.', + 'It is starting to smell a lot like Christmas. Or it could be the christmas tree is on fire.', + 'I do not want to be a smarthome. I want to be a dentist.', + 'Do not eat all the cookies. ' + ] | random }} + {% else %} + {% endif %} + + {% if states.sensor.trip_disney.state | int == 120 %} + There are only one hundred and twenty days until the next Disney Trip. + {% endif %} + {% if states.sensor.trip_disney.state | int == 60 %} + There are only on sixty days until the next Disney Trip. + {% endif %} + {% if states.sensor.trip_disney.state | int < 32 %} + {% if states.sensor.trip_disney.state | int > 1 %} + There are {{ states.sensor.trip_disney.state }} days until the next Disney Trip! + {% else %} + There is {{ states.sensor.trip_disney.state }} day until the next Disney Trip! + {% endif %} + {% endif %} + {% if states.sensor.anniversary_our_wedding.state | int == 1 %} + Tomorrow is Jeff and Katherine's Wedding Anniversary. + {% endif %} + + {% if states.sensor.trip_disney.state | int == 1 %} + Oh, and there is just one more sleep until the next Disney Trip! + {% endif %} + {% else %} + {% 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 'Chocolate' in event %} + {{ [ + 'Oh. You had me at Chocolate. ', + 'And I like chocolate. This sounds fun.' + ]|random }} + {%- endif -%} + + {% if 'Pi' in event or 'Pie' in event%} + {{ [ + 'We should make a pie. And by we I mean someone with actual arms. ', + 'Wait.Did that just say pie? We need a Pie to celebrate.' + ]|random }} + {%- endif -%} + + {% if 'Cookie' in event %} + {{ [ + 'And Yes. You heard that right. Today we are making cookies.', + 'I will put butter on the shopping list. For later. ', + 'So that means we should make cookies.' + ]|random }} + {%- endif -%} + + {% if 'Pizza' in event %} + {{ [ + 'I think that means we should have pizza today. and by we I mean those of us with a mouth.', + 'So who is going to make the pizza?', + 'Everyone knows Pepporini Pizza is the best. am I right?' + ]|random }} + {%- endif -%} + + {% if 'Cake' in event %} + {{ [ + 'I have just added baking a cake to your calendar. And set your availability to busy.', + 'Quick. Someone check to see if we have powdered sugar for frosting.', + 'So that means we should bake a cake. And frost it. But not like that time in that movie. ' + ]|random }} + {%- endif -%} + + {% if 'Fools' in event %} + {{ [ + 'Which reminds me. The camera looking at tbe drive way caught a Tee Rex last night. April Fools!', + 'Which reminds me. I won the lottery and I am moving out to go live with Siri. April Fools!', + 'Which reminds me. there was a time change last night. We have jumped 15 years into the future. April Fools!' + ]|random }} + {%- endif -%} + + {% if 'Creme Brulee' in event %} + {{ [ + 'Someday I hope to make the perfect creme brulee.' + ]|random }} + {%- endif -%} + + {% if 'Games' in event %} + {{ [ + 'Does anyone want to play Thermal nuclear war with me?No? How about a nice game of chess?' + ]|random }} + {%- endif -%} + + {% if 'Haiku' in event %} + I know a Haiku. This one is called, + {{ [ + 'Good Morning From the Cat. In the morning light, You sleep despite my meow, I stand on your face.', + 'Tee Rex Hug. The Tee Rex likes you, But he cant give you a hug, His arms are too short.', + 'It Fits. It Fits perfectly, because every box is the, Right size for a cat.', + 'Minecraft Creepers. Creepers are so cruel, I hear a hiss from behind, Bam! There goes my stuff.' + ]|random }} + {%- endif -%} + + + + {% else %} + {% if 'Birthday' in event %} + {{ [ + 'Today is a special birthday. We are celebrating ' + ]|random }} + {{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}. + {%- endif -%} + {%- endif -%} + + + {% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %} + {{ [ 'Today is a school day.', + 'It is a school day. ' + ] | random }} + Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }} + {% if states.calendar.skylar_school.attributes.description == 'digital-learning' %} + But it is a digital learning day so the commute will be short. + {% endif %} + {% if states.calendar.skylar_school.attributes.description == 'early-release' %} + And It is early release! + {% endif %} + {% endif %} + {% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %} + {% if states.sensor.school_lunch.state == 'Nothing' %} + Skylar will want to take his lunch today. + {% else %} + Today's school lunch is {{ states.sensor.school_lunch.state }}, so he might be interested in buying his lunch. + {% endif %} + {% endif %} + {% if states.sensor.school_end_days2go.state |int <= 35 and states.sensor.school_end_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.school_end_days2go.state }} days left in the school year! + {% endif %} + {% if states.sensor.school_end_days2go.state | int == -1 -%} + Today is the first day of Summer Break! + {%- endif %} + {% if is_state('calendar.skylar_events', 'on') %} + Skylar has {{ states.calendar.skylar_events.attributes.message }} today as well! + {% endif %} + {%- endif -%} + +

+ + + + + {% if is_state('binary_sensor.morning','on') %} +

+ {%- 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 }} +

+ {%- endif -%} + + +

+ 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') %} + and he appears to be in the Theater. + {% 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 }} + {% 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. + {% 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 %} + {{ (states.climate.home.attributes.current_temperature | int - states.climate.home.attributes.temperature | int) | abs }} degrees below + {% else %} + right at + {% endif %} + 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') %} + The croft TV is current playing + {%- if states.media_player.croft_tv.attributes.app_name == 'YouTube' %} + You Tube. + {% else %} + {{ states.media_player.croft_tv.attributes.app_name }}. + {%- endif -%} + {%- endif -%} + {%- endif -%} + + {%- if is_state('media_player.theater_tv','on') or is_state('binary_sensor.theater_occupancy','on') %} + The theater is currently occupied. + {%- if is_state('media_player.home_theater_2','playing') %} + and the Apple TV is currently playing. + {%- endif -%} + {%- endif -%} + + There are currently {{ (states.light | selectattr('state', 'eq', 'on') | list | count) | int + (states.switch | selectattr('state', 'eq', 'on') | list | count) | int }} lights + and switches on. + +

+ + + {%- if is_state('sensor.washer_status','complete') %} +

+ 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 %} +

+ {% endif %} + + + {{ [ + 'If you need anything else, just let me know.', + 'Let me know if you need anything else.' + ]|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() -%} + {{ getReport() }} + {%- endmacro -%} + + {# Call the macro #} + {{- cleanup(mother_of_all_macros()) -}} \ No newline at end of file diff --git a/config/templates/speech/interjections.yaml b/config/templates/speech/interjections.yaml index a2437d1..0971ca3 100755 --- a/config/templates/speech/interjections.yaml +++ b/config/templates/speech/interjections.yaml @@ -12,7 +12,7 @@ 'I think I can handle that.', 'Working on it now.', ' Oh, you were talking to me. Let me take care of that.' - 'Why not. It is not like I ever sleep.', + 'Why not. It is not like I ever sleep.', 'I am not even supposed to be here today. But whatever.', 'You did not say the magic word. Oh forget it. I will take care of it.', 'Funny, I was just about to do that.', diff --git a/config/templates/speech/morning_wakeup_report.yaml b/config/templates/speech/morning_wakeup_report.yaml index 3cb9957..003a28b 100755 --- a/config/templates/speech/morning_wakeup_report.yaml +++ b/config/templates/speech/morning_wakeup_report.yaml @@ -1,112 +1,183 @@ > {# Morning Wakeup Report #} {%- macro getReport() -%} -

+

Good morning. -

+

- {% if now().strftime('%H')|int < 12 %} - {% if now().strftime('%M')|int == 0 %} - It is {{ now().strftime('%H')|int }} AM. + It is {{ now().strftime("%I:%M %p") }} +

+ +

+ The Weather in Grayson is {{states.sensor.acurite_6045m_3078_t.state|round}} degrees + {% if is_state('weather.home', 'rainy') %} + {{ [ + 'with rain.', + 'with showers.' + ] | random }} + {% elif is_state('weather.home', 'cloudy') %} + {{ [ + 'with clouds.', + 'with cloudy skies.' + ] | random }} + {% elif is_state('weather.home', 'partlycloudy') %} + {{ [ + 'with some clouds.', + 'with partly cloudy skies.', + 'with scatterd clouds' + ] | random }} + {% elif is_state('weather.home', 'sunny') %} + {% if is_state('sun.sun', 'above_horizon') %} + {{ [ + 'and sunny.', + 'with sun.' + ] | random }} + {% else %} + {{ [ + 'and clear.', + 'with clear skies.' + ] | random }} + {% endif %} {% else %} - It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} AM. + and {{ states.weather.home.state }} {% endif %} - {% elif now().strftime('%H')|int > 12 %} - {% if now().strftime('%M')|int == 0 %} - It is {{ now().strftime('%H')|int }} PM. - {% else %} - It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} PM. + + {% if states.sensor.nws_alerts.state | int > 0 %} + There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area. + The National Weather Service Has issued, + {% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}. + {% else %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}. + {% endif %} {% endif %} - - {% else %} - {% endif %} + Based on the forecasted high temperature, + {% if is_state('binary_sensor.morning','on') %} + {% 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 outside. ', + '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') %} + It is going to be + {{ [ 'bit warm ', + ' rather warm outside ', + ' almost too hot outside ', + ' a little warm ', + ] | random }} + today. So I suggest wearing shorts. + {% elif is_state('sensor.clothing_forecast', 'Hot') %} + It is going to be + {{ [ 'hot', + 'hotter than the sun ', + 'hotter than hot. but in a lot of bad ways ', + 'hotter than the sun outside ', + 'super hot ', + 'hotter than the inside of a volcano ' + ] | random }} + today. So I suggest wearing shorts. + {% else %} + It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts. + {% endif %} + {% endif %} - Today is {{states.sensor.today_is.state }}. -

-

- It is currently {{states.weather.home.state}} and {{states.sensor.acurite_6045m_3078_t.state|round}} degrees in Grayson. -

-

- {% 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 outside. ', - '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') %} - It is going to be - {{ [ 'bit warm ', - ' rather warm outside ', - ' almost too hot outside ', - ' a little warm ', - ] | random }} - today. So I suggest wearing shorts. - {% elif is_state('sensor.clothing_forecast', 'Hot') %} - It is going to be - {{ [ 'hot', - 'hotter than the sun ', - 'hotter than hot. but in a lot of bad ways ', - 'hotter than the sun outside ', - 'super hot ', - 'hotter than the inside of a volcano ' - ] | random }} - today. So I suggest wearing shorts. - {% else %} - It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts. - {% endif %}

+

{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %} {{ [ 'Today is a school day.', - 'Skylar has school today. ' + 'It is a school day. ' ] | random }} + Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }} {% if states.calendar.skylar_school.attributes.description == 'digital-learning' %} But it is a digital learning day so the commute will be short. {% endif %} {% if states.calendar.skylar_school.attributes.description == 'early-release' %} - And It is early release! + And It is early release which means pick up is at tweleve fifteen. {% endif %} {% endif %} -

-

{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %} {% if states.sensor.school_lunch.state == 'Nothing' %} - Skylar will want to take his lunch today. + Today's lunch is not interesting, so plan on taking one. {% else %} - Today's school lunch is {{ states.sensor.school_lunch.state }}, so he might be interested in buying his lunch. + Todays school lunch is {{ states.sensor.school_lunch.state }} . {% endif %} {% endif %} + {% if is_state('calendar.school_holiday', 'on') %} + And look at that. There is no school today. Because it is {{ states.calendar.school_holiday.attributes.message }}. + {% endif %} + + {% if is_state('calendar.skylar_events', 'on') %} + Skylar has {{ states.calendar.skylar_events.attributes.message }} today as well! + {% endif %}

+

{% 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') %} - and he appears to be in the Theater + 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. {% endif %} {% else %} It doesn't appear that Skylar is out of bed yet. {% endif %}

+

{%- if states.sensor.home_to_zoo.state|round > 50 %} - Traffic to the Zoo appears heavy than normnal. + Traffic to the Zoo appears heavy than normal. {% 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. + 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 normal. + {% 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 }}.

+ {%- endmacro -%} diff --git a/config/templates/speech/nightly_briefing.yaml b/config/templates/speech/nightly_briefing.yaml index 6081df8..d5ad74a 100755 --- a/config/templates/speech/nightly_briefing.yaml +++ b/config/templates/speech/nightly_briefing.yaml @@ -7,7 +7,7 @@ Tomorrow is Halloween. I hope you have picked out a costume. {{ [ 'I will be going as a dumb home. ', 'I have prepped the scary music. Just in case.', - 'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I dare you to ask me to open them. ' + 'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I dare you to ask me to open them. ' ] | random }} {% elif states.sensor.halloween_countdown.state | int < 30 %} There are only {{states.sensor.halloween_countdown.state}} days @@ -25,8 +25,8 @@ {% elif states.sensor.christmas_countdown.state | int < 31 %} There are only {{states.sensor.christmas_countdown.state}} days until christmas. {{ [ 'All I want for Christmas, is a hippopotamus.', - 'Hey Skylar, I know what you are getting for Christmas. But I am not telling.', - 'Do not forget to put something under the tree for your favorite smarthome.', + 'Hey Skylar, I know what you are getting for Christmas. But I am not telling.', + 'Do not forget to put something under the tree for your favorite smarthome.', 'It is starting to smell a lot like Christmas. Or it could be the christmas tree is on fire.', 'I do not want to be a smarthome. I want to be a dentist.', 'Do not eat all the cookies. ' diff --git a/config/templates/speech/security_briefing.yaml b/config/templates/speech/security_briefing.yaml new file mode 100755 index 0000000..e469beb --- /dev/null +++ b/config/templates/speech/security_briefing.yaml @@ -0,0 +1,56 @@ +> + {# Security Report #} + {%- macro getReport() -%} +

+ {%- if states.input_boolean.sentry_mode.state == 'on' %} + {{ [ + 'Sentry Mode is enabled.', + 'Sentry mode is currently active.', + 'Barn Door Protocol is currently in effect.', + 'My security system is currently armed.', + 'Anchorage House is in lockdown mode. ' + ] | random}} + {% else %} + {{ [ + 'Sentry Mode is disabled.', + 'Sentry mode is currently inactive.', + 'My security system is currently disarmed.', + 'Anchorage House is currently in standby. ' + ] | random}} + {% endif %} + {%- if states.group.external_doors.state == 'off' %} + All external doors are currently secured. + {% else %} + {% set open_doors = expand('group.external_doors')| selectattr('state', 'eq', 'on') | map(attribute='name')|join(' and ') %} + {% set open_door_count = expand('group.external_doors') | selectattr('state', 'eq', 'on') | list | count %} + {% if open_door_count == 1 %} + {% set is_are = ' is ' %} + {% else %} + {% set is_are = ' are ' %} + {% endif %} + {%- macro announcement(open_doors, is_are) -%} + {{ [ + open_doors ~ is_are + " standing open.", + open_doors ~ is_are + " not secured.", + open_doors ~ is_are + " open." + ] | random }} + {%- endmacro -%} + {{announcement(open_doors)}} + {% 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() -%} + {{ getReport() }} + {%- endmacro -%} + + {# Call the macro #} + {{- cleanup(mother_of_all_macros()) -}} \ No newline at end of file diff --git a/config/templates/speech/skylar_morning_briefing.yaml b/config/templates/speech/skylar_morning_briefing.yaml index de78a63..8c0503f 100755 --- a/config/templates/speech/skylar_morning_briefing.yaml +++ b/config/templates/speech/skylar_morning_briefing.yaml @@ -2,7 +2,10 @@ {# Skylar Morning Report #} {%- macro getReport() -%}

- Skylar, + Good morning, Skylar. + + It is {{ now().strftime("%I:%M %p") }} + {% if is_state('sensor.birthday_skylar', '0') %} Even birthday boys have to get dressed. So get to it. {% else %} @@ -10,11 +13,11 @@ 'It is time to put some real clothes on. ', 'it is now time to change your underwear.', 'You need to get dressed for the day.', - 'If you have not gotten dressed it is that time.', - 'We have reached that time during the day in which you should get dressed.' + 'If you have not gotten dressed it is that time.' ] | random }} {% endif %}

+

{% if is_state('sensor.clothing_forecast', 'Freezing') %} It is going to be freezing today. so I suggest wearing long pants and a heavy coat. @@ -52,6 +55,7 @@ It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts. {% endif %}

+

{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %} Because you have school today! @@ -73,6 +77,9 @@ {% if states.calendar.skylar_school.attributes.description == 'start_fall_break' %} Oh, One More Thing. Tomorrow is the first day of Fall Break. {% endif %} + {% if states.sensor.school_end_days2go.state | int == 0 -%} + Oh, One More Thing. Tomorrow is the first day of Summer Break! Emjoy the Last day of school this year! + {%- endif %} {% else %} {% if is_state('calendar.school_holiday', 'on') %} And look at that. You do not have school today. Because it is {{ states.calendar.school_holiday.attributes.message }}. @@ -88,6 +95,7 @@ {% endif %}

+

{% if states.calendar.skylar_school.attributes.offset_reached == True and is_state('calendar.school_holiday', 'off') %} {% if states.sensor.school_lunch.state == 'Nothing' %} @@ -109,6 +117,9 @@ ] | random }} {% endif %}

+ {% if is_state('calendar.skylar_events', 'on') %} + You have {{ states.calendar.skylar_events.attributes.message }} today as well! + {% endif %} {%- endmacro -%} diff --git a/config/templates/speech/skylar_nightly_briefing.yaml b/config/templates/speech/skylar_nightly_briefing.yaml index d3a5fc9..3064e27 100755 --- a/config/templates/speech/skylar_nightly_briefing.yaml +++ b/config/templates/speech/skylar_nightly_briefing.yaml @@ -1,66 +1,15 @@ > {# Skylar Nightly Report #} {%- macro getReport() -%} -

- {% if states.sensor.halloween_countdown.state | int == 1 %} - Tomorrow is Halloween. I hope you have picked out a costume. - {{ [ 'I will be going as a dumb home. ', - 'I have prepped the scary music. Just in case.', - 'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I dare you to ask me to open them. ' - ] | random }} - {% elif states.sensor.halloween_countdown.state | int < 30 %} - There are only {{states.sensor.halloween_countdown.state}} days - {{ [ 'until Halloween.', - 'until Halloween. It might not be enough time. ', - 'and counting until the best holiday ever.', - 'until you need a costume.' - ] | random }} - - {% else %} - {% endif %} - - {% if states.sensor.christmas_countdown.state | int == 1 %} - Tomorrow is Christmas. It is practically here! Santa is coming tonight! Do not forget the cookies! - {% elif states.sensor.christmas_countdown.state | int < 31 %} - There are only {{states.sensor.christmas_countdown.state}} days until christmas. - {{ [ 'All I want for Christmas, is a hippopotamus.', - 'Hey Skylar, I know what you are getting for Christmas. But I am not telling.', - 'Do not forget to put something under the tree for your favorite smarthome.', - 'It is starting to smell a lot like Christmas. Or it could be the christmas tree is on fire.', - 'I do not want to be a smarthome. I want to be a dentist.', - 'Do not eat all the cookies. ' - ] | random }} - {% else %} - {% endif %} -

-

- {% if states.sensor.trip_disney.state | int == 120 %} - There are only one hundred and twenty days until the next Disney Trip. - {% endif %} - {% if states.sensor.trip_disney.state | int == 60 %} - There are only on sixty days until the next Disney Trip. - {% endif %} - {% if states.sensor.trip_disney.state | int < 32 %} - {% if states.sensor.trip_disney.state | int > 1 %} - There are {{ states.sensor.trip_disney.state }} days until the next Disney Trip! - {% else %} - There is {{ states.sensor.trip_disney.state }} day until the next Disney Trip! - {% endif %} - {% endif %} - {% if states.sensor.anniversary_our_wedding.state | int == 1 %} - Tomorrow is Jeff and Katherine's Wedding Anniversary. - {% endif %} -

-

- Skyler, + Good Evening, Skyler, {{ [ 'It is time to get in the bath. ', 'It is almost bedtime. That means it is time to start preparing for bed. if you are taking a bath tonight, you need to head that way.', - 'I cannot communicate with the bathtub. Or I would have started the water for you already. So you will have to start the bath, yourself', - 'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a bath.', + 'I cannot communicate with the bathtub. Or I would have started the water for you already. So you will have to start the bath, yourself', + 'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a bath.', 'I hate to say it but, the day is coming to an end. Time to finish up your tasks, pick up any toys you have out, and get ready for bed.', 'We have reached that time in every day when we must switch gears and start preparing for bed. If you would like to have story time you better get a move on.' - 'Did you ever hear the one about the kid who never took a bath? Yeah, me either. So we should keep it that way. It is time to get ready for bed.', + 'Did you ever hear the one about the kid who never took a bath? Yeah, me either. So we should keep it that way. It is time to get ready for bed.', 'The count down clock until bedtime has started. Time to get cleaned up, get your pajamas on, and pick the story you will read tonight.' ] | random }} {% if is_state('sensor.school_tomorrow', 'on') %} diff --git a/config/templates/speech/sundown_briefing.yaml b/config/templates/speech/sundown_briefing.yaml index a9d99ab..ce6c2ec 100755 --- a/config/templates/speech/sundown_briefing.yaml +++ b/config/templates/speech/sundown_briefing.yaml @@ -2,53 +2,67 @@ {# Nightky Report #} {%- macro getReport() -%}

- {% if now().strftime('%H')|int < 12 and now().strftime('%H')|int > 6 %} - Good morning. - {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %} - Good afternoon. - {% else %} - Good evening. - {% endif %} -

-

- {% if now().strftime('%H')|int < 12 %} - {% if now().strftime('%M')|int == 0 %} - It is {{ now().strftime('%H')|int }} AM. - {% else %} - It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} AM. - {% endif %} - - {% elif now().strftime('%H')|int > 12 %} - {% if now().strftime('%M')|int == 0 %} - It is {{ now().strftime('%H')|int }} PM. - {% else %} - It is {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} PM. - {% endif %} - - {% else %} - - {% endif %} + Good evening.

+ +

+ It is {{ now().strftime("%I:%M %p") }} +

+ +

+ {% if is_state('sun.sun', 'below_horizon') %} + You have + {% set seconds = as_timestamp(states.sun.sun.attributes.next_rising)-now().timestamp() %} + {% set hours = seconds / 60 %} + {% if seconds / ( 60 * 60 ) > 1 %} + {{ (seconds // ( 60 * 60 )) | int }} hours + {% else %} + {{ (seconds // 60) | int }} minutes + {% endif %} + {{ [ + 'until the sun rises.', + 'until the sun is up.', + 'before the sun officially rises. ' + ]|random }} + {% else %} + You have + {% set seconds = as_timestamp(states.sun.sun.attributes.next_setting)-now().timestamp() %} + {% set hours = seconds / 60 %} + {% if seconds / ( 60 * 60 ) > 1 %} + {{ (seconds // ( 60 * 60 )) | int }} hours + {% else %} + {{ (seconds // 60) | int }} minutes + {% endif %} + {{ [ + 'until the sun sets for the day.', + 'until the sun slips below the horizon.', + 'before the sun officially sets. ', + 'before The sun has been ushered off the stage.' + ]|random }} + {% endif %} + +

+

{{ [ - 'The sun is officially down. Exterior Cameras are now motion activated.', - 'The sun has been ushered off the stage. I have armed the perimiter cameras.', - 'You are running out of daylight. Time to wrap up any outside chores.', - 'Switching Anchorage House to night mode! ', - 'The outside world has switched to dark mode.', - 'It is a little past Sunset. Time to turn on the outside lights. I am on it.', - 'I will switch on the outside lights. It is getting dark outside.', - 'Time to turn on the front lights. I will take care of it.', - 'If you have not looked outside lately, the light of the day is almost gone.' + 'Exterior Cameras are now motion activated, and the front porch light is on.', + 'I have turned on the front porch light and armed the perimiter cameras.', + 'You are running out of daylight. Time to wrap up any outside chores. The ouside lights have been turned on.', + 'Switching Anchorage House to night mode! Front porch lights are on and the ouside cameras are recording when motion has been detected.', + 'Anchorage House has been configured for night.', + 'Switching on Anchorage Houses exterior lighting, and armed the cameras.', + 'It is getting dark outside, so I am turning on the outside lights.', + 'The sun is setting so it is ime to turn on the front lights.', + 'If you have not looked outside lately, the light of the day is almost gone. I am turning on the outside lights.' ]|random }}

{% if is_state('binary_sensor.garage_door', 'on') %}

{{ [ 'The garage door is open. ', - 'The pod bay doors are open. ', 'Someone forgot to close the garage.' ] | random }} + Someone should close it.

{% elif is_state('binary_sensor.side_door', 'on') %}

@@ -56,48 +70,31 @@ 'The side door is open. ', 'Someone forgot to close the side door.' ] | random }} + Someone might want to check it.

{% else %} {% endif %} - -

- {% if states.sensor.nws_alerts.state | int > 0 %} - There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area. - The National Weather Service Has issued, - {% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}. - {% else %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}. - {% endif %} - {% endif %} -

-

- {{ [ - 'Tonight we can expect,', - 'Expect weather tonight to be,' - ]|random }} - {{ states.sensor.nws_overnight_forecast.state }} -

- + {% if is_state('input_boolean.freeze_warning','on') %}

- {{ [ 'The temperature is expected to be near or below freezing. Someone might want to bring the lemon tree in. ', - 'It appears that it will be cold tonight. Like, the turn water solid kind of cold. Think of the poor plants.', - 'I suggest bringing in the plants other wise, the temperature might kill them. And that will be on you.', - 'I would say winter is coming. But, based on the weather forecast it appears to be here.', + {{ [ 'The temperature is expected to be near or below freezing. Someone might want to bring the lemon tree in. ', + 'It appears that it will be cold tonight. Like, the turn water solid kind of cold. Think of the poor plants.', + 'I suggest bringing in the plants other wise, the temperature might kill them. And that will be on you.', + 'I would say winter is coming. But, based on the weather forecast it appears to be here.', 'It will be freezing cold tonight. I would bring in the plants but I lack legs. And Arms. So I am forced to rely on you. Do not let me down.' ] | random }}

{% endif %} + + {% if is_state('sensor.today_is', 'Monday') %} + {% if now().strftime('%H')|int > 17 %} + {{ [ 'Do not 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 %} + {% endif %} {% if is_state('sensor.today_is', 'Tuesday') %} @@ -109,62 +106,8 @@ ] | random }}

{% endif %} - {% endif %} -

- {% if states.sensor.halloween_countdown.state | int == 1 %} - Tomorrow is Halloween. I hope you have picked out a costume. - {{ [ 'I will be going as a dumb home. ', - 'I have prepped the scary music. Just in case.', - 'I will be going as HAL 9000. The Pod Bay Doors are being installed today. I dare you to ask me to open them. ' - ] | random }} - {% elif states.sensor.halloween_countdown.state | int < 30 %} - There are only {{states.sensor.halloween_countdown.state}} days - {{ [ 'until Halloween.', - 'until Halloween. It might not be enough time. ', - 'and counting until the best holiday ever.', - 'until you need a costume.' - ] | random }} - - {% else %} - {% endif %} - - {% if states.sensor.christmas_countdown.state | int == 1 %} - Tomorrow is Christmas. It is practically here! Santa is coming tonight! Do not forget the cookies! - {% elif states.sensor.christmas_countdown.state | int < 31 %} - There are only {{states.sensor.christmas_countdown.state}} days until christmas. - {{ [ 'All I want for Christmas, is a hippopotamus.', - 'Hey Skylar, I know what you are getting for Christmas. But I am not telling.', - 'Do not forget to put something under the tree for your favorite smarthome.', - 'It is starting to smell a lot like Christmas. Or it could be the christmas tree is on fire.', - 'I do not want to be a smarthome. I want to be a dentist.', - 'Do not eat all the cookies. ' - ] | random }} - {% else %} - {% endif %} -

-

- {% if states.sensor.trip_disney.state | int == 120 %} - There are only one hundred and twenty days until the next Disney Trip. - {% endif %} - {% if states.sensor.trip_disney.state | int == 60 %} - There are only on sixty days until the next Disney Trip. - {% endif %} - {% if states.sensor.trip_disney.state | int < 32 %} - {% if states.sensor.trip_disney.state | int > 1 %} - There are {{ states.sensor.trip_disney.state }} days until the next Disney Trip! - {% else %} - There is {{ states.sensor.trip_disney.state }} day until the next Disney Trip! - {% endif %} - {% endif %} - {% if states.sensor.anniversary_our_wedding.state | int == 1 %} - Tomorrow is Jeff and Katherine's Wedding Anniversary. - {% endif %} -

-

- {% if states.sensor.trip_disney.state | int == 1 %} - Oh, and there is just one more sleep until the next Disney Trip! {% endif %} -

+ {%- endmacro -%} diff --git a/config/templates/speech/welcome_briefing.yaml b/config/templates/speech/welcome_briefing.yaml new file mode 100755 index 0000000..6d8717f --- /dev/null +++ b/config/templates/speech/welcome_briefing.yaml @@ -0,0 +1,120 @@ +> + {# Event Report #} + {%- macro getReport() -%} +

+ {% set person = expand('group.arriving')|map(attribute='name')|join(' and ') %} + {% set peoplecount = expand('group.arriving') | count %} + {% if peoplecount == 0 %} + Welcome Home + {% else %} + {% if peoplecount == 1 %} + {% set is_are = ' is ' %} + {% set has_have = ' has ' %} + {% else %} + {% set is_are = ' are ' %} + {% set has_have = ' have ' %} + {% endif %} + {%- macro greeting_sentence(person, is_are, has_have) -%} + {{ [ + "Welcome back home " ~ person, + "Hey" ~ person + "! High Five! Glad you are finally home.", + "Welcome home " ~ person + ] | random }}"Welcome back home " ~ person, + {%- endmacro -%} + {{greeting_sentence(person, is_are, has_have)}} + {% endif %} + {{ [ + 'It was pretty quiet while you were gone.', + 'Glad to see you made it back.', + 'Hopefully noting too crazy happened out there.', + 'I would love to hear about your adventures. On second thought I do not care.' + ] | random }} + +

+ +

+ {%- 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 %} + {{ (states.climate.home.attributes.current_temperature | int - states.climate.home.attributes.temperature | int) | abs }} degrees below + {% else %} + right at + {% endif %} + the set point of {{ states.climate.home.attributes.temperature }} + degrees + {%- endif -%} + And The internal humidity is currently {{ states.climate.home.attributes.current_humidity }} percent +

+ +

+ {%- if is_state('sensor.washer_status','complete') %} + 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. + {% 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 closthes 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 smeling 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.', + '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 %} + {% endif %} +

+ +

+ {%- if is_state('sensor.front_door_motion_away_count','0') %} + While you were gone there was no motion detected at the front door. + {% else %} + While you were out I detected motion at the front door {{ states.sensor.front_door_motion_away_count.state | int }} times. + {% 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() -%} + {{ getReport() }} + {%- endmacro -%} + + {# Call the macro #} + {{- cleanup(mother_of_all_macros()) -}} \ No newline at end of file