Tweaking tweeting times

This commit is contained in:
Jeffrey Stone 2019-12-09 08:25:43 -05:00
parent c44a787eae
commit 56f5a3b687
1 changed files with 10 additions and 8 deletions

View File

@ -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 }}"}