From b685e27623d7f7dac4978f387eb34c39fbee9a0c Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Thu, 21 Nov 2019 21:36:16 -0500 Subject: [PATCH] Added National holiday tweets and notifications --- config/packages/notify.yaml | 82 +++++++++++++++++++++++++++++++----- config/packages/twitter.yaml | 44 +++++++++++++++++++ 2 files changed, 116 insertions(+), 10 deletions(-) diff --git a/config/packages/notify.yaml b/config/packages/notify.yaml index b2c6ef1..b4f000f 100755 --- a/config/packages/notify.yaml +++ b/config/packages/notify.yaml @@ -372,7 +372,11 @@ script: {{ [ "I thought you might like to know. ", "The day is almost over.", "Before things start to quiet down,", - "Anchorage House." + "Anchorage House.", + "from the bridge.", + "Pardom the interuption.", + "I hope everyone got their chores done.", + "Did everyone have a little fun today?" ] | random }} {% endmacro %} @@ -425,17 +429,31 @@ script: And dont forget Today is also {{states.calendar.anchorage_holidays.attributes.message}}. {% endif %} {% if states.calendar.birthdays.state == "on" %} - Today is {{ states.calendar.birthdays.attributes.message }} birthday! + Today is {{ states.calendar.birthdays.attributes.message }} ! {% endif %} + {%- set event=states.calendar.national_holidays.attributes.message %} + {% if 'Day' in event %} + {{ [ + 'Today is also {{states.calendar.national_holidays.attributes.message}}. We should celebrate.', + 'And a very special Happy {{states.calendar.national_holidays.attributes.message}}. I will leave the party planning up to you', + 'It is is also {{states.calendar.national_holidays.attributes.message}}. I bet you are glad I told you.', + 'You cannot make this stuff up. Today is {{states.calendar.national_holidays.attributes.message}}.', + 'I have just been informed today is {{states.calendar.national_holidays.attributes.message}}. But that just sounds silly.', + 'Want to know a fact? Today is {{states.calendar.national_holidays.attributes.message}}', + 'You should tell someone it is {{states.calendar.national_holidays.attributes.message}}. Because I bet know one else knows.', + 'I bet you did not know. Today is {{states.calendar.national_holidays.attributes.message}}. But now you do. And the more you know.' + ]|random }} + {%- endif -%} {% endmacro %} {%- macro dark_outside() -%} {{ [ 'The sun is officially down. Exterior Cameras are now motion acivated.', '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 outisde chores.', - 'Switching to night mode! ', - 'The outside world has switched to dark mode.' + '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.', + 'If you have not looked outside lately the light of the day is gone.' ]|random }} {%- endmacro -%} @@ -512,12 +530,15 @@ script: {% elif states.sensor.christmas_countdown.state | int < 31 %} There are only {{states.sensor.holiday_christmas.state}} days until christmas. {{ [ "All I want is a hippopatamus.", - "Hey Skylar, I know what you are getting. But I am not telling.", - "Don't forget to get something for your favorite smarthome.", - "It is starting to smell like Christmas." + "Hey Skylar, I know what you are getting for Christmas. But I am not telling.", + "Don't 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.", + "Do you hear what I hear?", + "I dont want to be a smarthome. I want to be a dentist." ] | random }} {% else %} {% endif %} + {% endmacro %} {% macro skylar_dressed() %} @@ -537,8 +558,11 @@ script: Skylar, {{ [ "It is time to get in the bath. ", "You only have thirty minutes until bedtime. That means you should be heading for the bathtub.", - "I cannot comminicate with the bathtub, otherwise, I would have started the water for you already. So you will have to start the bath yourself. ", + "I cannot communicate with the bathtub, otherwise, 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 why don't you start a bath.", + "I hate to say it but it is time to get cleaned up.", + "Did you you hear the one about the kid who never took a bath? ,,,,Yeah, me either. So let's keep it that way. Bath time.", + "Tee Minus 30 minutes and counting until you should be off to sleep." ] | random }} If you go now there may be time for stories. Don't forget to brush your teeth. {% if is_state("sensor.weekday", "fri") %} @@ -810,7 +834,6 @@ script: Currently it will take {{states.sensor.home_to_summit.state|round}} minutes to get to Cox Automotive. {% endmacro %} - {% macro iss() %} {{ [ "But the International Space Station is passing over. Wave.", @@ -819,6 +842,15 @@ script: ] | random}} {% endmacro %} + {% macro full_moon() %} + {{ [ + "There is a Full Moon out tonight, and this time it's the actual moon and not the neighbor. ", + "Hey look, There is the full moon. ", + "The moon is huge! And full. ", + "If you want to see the full moon tonight is the night."] | random }} + + {% endmacro %} + {% macro security_report() %} {%- if states.input_boolean.sentry_mode.state == 'on' %} {{ [ @@ -865,6 +897,22 @@ script: ] | random }} {%- endmacro -%} + {%- macro house_party_protocol_enabled() -%} + {{ [ + "Anchorage House has been configured for a House Party.", + "Incense has been turned on.", + "I have enabled house party protocol." + ] | random }} + {%- endmacro -%} + + {%- macro house_party_protocol_disabled() -%} + {{ [ + "The House Party has been canceled.", + "Incense has been turned off.", + "I have disabled house party protocol." + ] | random }} + {%- endmacro -%} + {# ********************************************* #} {# ******** Start the Speech routines ******** #} {# ********************************************* #} @@ -1011,6 +1059,12 @@ script: {{ iss() }} {% endif %} + {% if call_full_moon == 1 %} + {% if is_state("sensor.moon", "full_moon") %} + {{ full_moon() }} + {% endif %} + {% endif %} + {% if call_security_report == 1 %} {{ security_report() }} {% endif %} @@ -1019,6 +1073,14 @@ script: {{ washer_needs_emptying() }} {% endif %} + {% if call_house_party_protocol_enabled == 1 %} + {{ house_party_protocol_enabled() }} + {% endif %} + + {% if call_house_party_protocol_disabled == 1 %} + {{ house_party_protocol_disabled() }} + {% endif %} + {{ welcome_home }} {{ speech_message }} diff --git a/config/packages/twitter.yaml b/config/packages/twitter.yaml index 1ec25a6..7ec7cdb 100755 --- a/config/packages/twitter.yaml +++ b/config/packages/twitter.yaml @@ -40,6 +40,16 @@ automation: - delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.twitter_snark + - id: tweet_some_snark + alias: Tweet Some Snark + initial_state: true + trigger: + - platform: time + at: '13:00:00' + action: + - delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' + - service: script.twitter_snark + - id: tweet_some_stats alias: Tweet Some Stats initial_state: true @@ -334,6 +344,37 @@ automation: "/config/www/tweet_images/codeing.jpg", "/config/www/tweet_images/code2.jpg", "/config/www/tweet_images/computer.jpg"] | random }} + + - id: national_holiday_tweet + alias: National Holiday Tweet + initial_state: true + trigger: + - platform: time + at: '07:00:00' + condition: + - condition: state + entity_id: calendar.national_holidays + state: "on" + - condition: template + value_template: > + {%- set event=states.calendar.national_holidays.attributes.message %} + {% if 'Day' in event %} + true + {%- endif -%} + action: + - delay: '0{{ (range(1, 3)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' + - service: script.twitter_notify + data_template: + message: >- + {{ [ "Hey, Look at that. It is {{states.calendar.national_holidays.attributes.message}}. So Happy {{states.calendar.national_holidays.attributes.message}}! #nationalholiday #themoreyouknow", + "I bet you did not know today was {{states.calendar.national_holidays.attributes.message}}. How will you celebrate? #nationalholiday #themoreyouknow", + "Happy {{states.calendar.national_holidays.attributes.message}}! #nationalholiday #themoreyouknow", + "Whats with today, today? It is {{states.calendar.national_holidays.attributes.message}}. #nationalholiday #themoreyouknow", + "I am pretty sure that {{states.calendar.national_holidays.attributes.message}} is a day in which you gift your favorite Automated House something sepcial. #nationalholiday #themoreyouknow", + "Did you know today was {{states.calendar.national_holidays.attributes.message}}? Now you do. That is why I am here. Tweeting. #nationalholiday #themoreyouknow", + "I already my residents that today is {{states.calendar.national_holidays.attributes.message}}. But I didn't want to leave you guys out. #nationalholiday #themoreyouknow", + "I hope you have a fun {{states.calendar.national_holidays.attributes.message}}. #nationalholiday #themoreyouknow" + ] | random }} - id: new_ha_notification alias: New HA Notification @@ -347,3 +388,6 @@ automation: - service: script.twitter_new_ha - service: ifttt.trigger data_template: {"event":"GitPost", "value1":"Home Assistant {{ states.binary_sensor.updater.attributes.newest_version }} is now available.", "value2":"{{ states.binary_sensor.updater.attributes.newest_version }}"} + + + \ No newline at end of file