From 56f5a3b687959096d24457fb83f9316d37862292 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Mon, 9 Dec 2019 08:25:43 -0500 Subject: [PATCH] Tweaking tweeting times --- config/packages/twitter.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/config/packages/twitter.yaml b/config/packages/twitter.yaml index af9e80e..0f21f9d 100755 --- a/config/packages/twitter.yaml +++ b/config/packages/twitter.yaml @@ -199,7 +199,7 @@ automation: initial_state: true trigger: - platform: time - at: '13:00:00' + at: '19:00:00' condition: - condition: template value_template: > @@ -214,7 +214,6 @@ automation: true {%- endif -%} action: - - delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.twitter_notify_image data_template: tweet: >- @@ -240,7 +239,7 @@ automation: initial_state: true trigger: - platform: time - at: '13:00:00' + at: '19:00:00' condition: - condition: state entity_id: calendar.holidays_in_united_states @@ -252,7 +251,6 @@ automation: true {%- endif -%} action: - - delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.twitter_notify_image data_template: tweet: >- @@ -265,7 +263,7 @@ automation: initial_state: true trigger: - platform: time - at: '04:00:00' + at: '05:30:00' condition: - condition: state entity_id: calendar.holidays_in_united_states @@ -277,7 +275,6 @@ automation: true {%- endif -%} action: - - delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.twitter_notify_image data_template: tweet: >- @@ -361,6 +358,12 @@ automation: {% if 'Day' in event %} true {%- endif -%} + - condition: template + value_template: > + {%- set event=states.calendar.national_holidays.attributes.message %} + {% if 'National' 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 @@ -370,7 +373,6 @@ automation: "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 let my residents know 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" @@ -390,4 +392,4 @@ automation: 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 +