Adding images to the tweets

This commit is contained in:
Jeffrey Stone 2019-11-12 14:36:27 -05:00
parent b9e9713094
commit 71c2bb030e
6 changed files with 179 additions and 30 deletions

View File

@ -86,7 +86,7 @@ automation:
- service: script.twitter_notify
data:
message: 'I just provided a morning briefing including weather, and traffic
conditions to the residents of Anchorage House. '
conditions, and other things that ensure the residents of Anchorage House know what to expect today. '
- id: skylar_morning_greeting
alias: Skylar Morning Greeting
@ -145,15 +145,3 @@ automation:
07:45
{% endif %}
- alias: Announce Freeze Warning
initial_state: 'on'
trigger:
- platform: state
entity_id: input_boolean.freeze_warning
to: 'on'
action:
- service: script.twitter_notify
data_template:
message: '{{ [ "Appears that the temperature will be below freezing tonight. I think I will stay inside.",
"The temperature tonight will kill sensative plants, so I just made a weather announcement. I cannot through inaction allow another to come to harm.",
"Winter is coming. Actually it is already here. I suggest sleeping with Dragon Glass." ] | random }}'

View File

@ -434,7 +434,8 @@ script:
'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! '
'Switching to night mode! ',
'The outside world has switched to dark mode.'
]|random }}
{%- endmacro -%}
@ -645,14 +646,16 @@ script:
{% endif %}
{% if is_state("sensor.weekday", "mon") %}
{% if now().strftime('%H')|int > 17 %}
{{ [ "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 %}
{% endif %}
{% if is_state("sensor.weekday", "tue") %}
{% if now().strftime('%H')|int < 17 %}
{% if now().strftime('%H')|int > 17 %}
{{ [ "Don't 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."
@ -1062,6 +1065,8 @@ script:
{% set msg = msg + " " + message %}
{% set msg = msg + " #smarthome #iot " %}
{{ msg }}
data:
media: /config/www/tweet_images/ah.png
twitter_new_ha:
sequence:

View File

@ -71,6 +71,10 @@ automation:
"The #ISS just flew by with there are {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people doing cool stuff. #Space #theycanseeourhouse",
"The #ISS just flew by with {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people in it. #Space #theycanseeourhouse"
] | random }}
data:
media: >-
{{ [ "/config/www/tweet_images/iss.jpg",
"/config/www/tweet_images/iss2.jpg"] | random }}
- id: iss_notification
initial_state: true
@ -102,5 +106,6 @@ automation:
{{ [
"There is a Full Moon out tonight, and this time it's the actual moon and not the neighbor. ",
"Hey look kids, There's the full moon. ",
"The moon is huge! And full. "
] | random + "#Space #fullmoon"}}
"The moon is huge! And full. "] | random + "#Space #fullmoon"}}
data:
media: /config/www/tweet_images/full_moon.jpg

View File

@ -85,6 +85,10 @@ automation:
data_template:
message: >-
"This is a good time to remind you that I am a bot powered by @home_assistant and configured by @thejeffreystone. Find my code at https://github.com/thejeffreystone/home-assistant-configuration"
data:
media: >-
'{{ [ "/config/www/tweet_images/robot1.jpg",
"/config/www/tweet_images/robot2.jpg"] | random }}'
- id: net_speed_report
initial_state: true
@ -102,6 +106,10 @@ automation:
Mbps up. Beat that. ", "My speed is monitored using @home_assistant and https://github.com/thejeffreystone/speedtest_to_mqtt
and is {{ states.sensor.internet_test_down.attributes.max_value }} Mbps down and {{ states.sensor.internet_test_up.attributes.max_value }}
Mbps up." ] | random }}'
data:
media: >-
{{ [ "/config/www/tweet_images/speed.jpg",
"/config/www/tweet_images/fiber-optic.jpg"] | random }}
- id: rex_manning_day_tweet_1
alias: Rex Manning Day Tweet One
@ -149,8 +157,8 @@ automation:
message: >-
"We mustn't dwell. No, not today. We can't. Not on Rex Manning day! https://www.youtube.com/watch?v=szvt8iWJ0oo #damntheman #savetheempire"
- id: Halloween Tweet
alias: Halloween Tweet
- id: Halloween Countdown Tweet
alias: Halloween Countdown Tweet
initial_state: true
trigger:
- platform: time
@ -162,16 +170,138 @@ automation:
{%- if month == 10 -%}
true
{%- endif -%}
- condition: template
value_template: >
{%- set event=states.sensor.halloween_countdown.state | int %}
{%- if event > 0 %}
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
data_template:
message: '{{ [ "There are only {{states.sensor.holiday_halloween.state}} days until Halloween.",
"Halloween is only {{states.sensor.holiday_halloween.state}} days away. It might not be enough time. ",
"Halloween is coming. {{states.sensor.holiday_halloween.state}} days and counting.",
"Only {{states.sensor.holiday_halloween.state}} days until Halloween.",
"You have {{states.sensor.holiday_halloween.state}} days until you need a costume.",
"Only {{states.sensor.holiday_halloween.state}} days until Halloween. But who is counting. amirite?",
message: >-
{{ [ "There are only {{states.sensor.halloween_countdown.state}} days until Halloween.",
"Halloween is only {{states.sensor.halloween_countdown.state}} days away. It might not be enough time. ",
"Halloween is coming. {{states.sensor.halloween_countdown.state}} days and counting.",
"Only {{states.sensor.halloween_countdown.state}} days until Halloween.",
"You have {{states.sensor.halloween_countdown.state}} days until you need a costume.",
"Only {{states.sensor.halloween_countdown.state}} days until Halloween. But who is counting. amirite?",
"Would it be cliche if I went as a haunted house for Halloween? Asking for a another house.",
"Just in case I wanted to be HAL 9000 for Halloween I ordered some Pod Bay Doors."
] | random }}
- id: Christmas Countdown Tweet
alias: Christmas Countdown Tweet
initial_state: true
trigger:
- platform: time
at: '13:00:00'
condition:
- condition: template
value_template: >
{% set month= now().month | int %}
{%- if month == 12 -%}
true
{%- endif -%}
- condition: template
value_template: >
{%- set event=states.sensor.christmas_countdown.state | int %}
{%- if event > 1 %}
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
data_template:
message: '{{ [ "There are only {{states.sensor.christmas_countdown.state}} days until Christmas.",
"Christmas is only {{states.sensor.christmas_countdown.state}} days away. It might not be enough time. ",
"Santa is coming. {{states.sensor.christmas_countdown.state}} days and counting until he is here.",
"Only {{states.sensor.christmas_countdown.state}} days until Christmas.",
"You have {{states.sensor.christmas_countdown.state}} days until we get to unwrap presents!",
"Only {{states.sensor.christmas_countdown.state}} days until Christmas. But who is counting. amirite?",
"It is beginning to look a lot like Christmas. Which checks out because it is {{states.sensor.christmas_countdown.state}} days away.",
"Have you finished your Chistmas shopping? You only have {{states.sensor.christmas_countdown.state}} days left.",
"Have you started your Chistmas shopping? You only have {{states.sensor.christmas_countdown.state}} days left."
] | random }}'
data:
media: >-
{{ [ "/config/www/tweet_images/xmas.jpg",
"/config/www/tweet_images/gift.jpg",
"/config/www/tweet_images/christmas-cookies.jpg",
"/config/www/tweet_images/christmas.jpg",
"/config/www/tweet_images/christmas-tree.jpg"] | random }}
- id: Christmas Eve Tweet
alias: Christmas Eve Tweet
initial_state: true
trigger:
- platform: time
at: '13:00:00'
condition:
- condition: state
entity_id: calendar.holidays_in_united_states
state: "on"
- condition: template
value_template: >
{%- set event=states.calendar.holidays_in_united_states.attributes.message %}
{%- if event == 'Christmas Eve' %}
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
data_template:
message: >-
'Tomorrow is Christmas. It's practically here! Santa is coming tonight! Don't forget the cookies!'
data:
media: /config/www/tweet_images/santa.jpg
- id: Christmas Day Tweet
alias: Christmas Day Tweet
initial_state: true
trigger:
- platform: time
at: '13:00:00'
condition:
- condition: state
entity_id: calendar.holidays_in_united_states
state: "on"
- condition: template
value_template: >
{%- set event=states.calendar.holidays_in_united_states.attributes.message %}
{%- if event == 'Christmas Day' %}
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
data_template:
message: >-
'From everyone at Anchorage House, Merry Christmas!'
data:
media: /config/www/tweet_images/merry-christmas.jpg
- id: Freeze Warning Tweet
alias: Freeze Warning Tweet
initial_state: 'on'
trigger:
- platform: time
at: '08:00:00'
condition:
- condition: state
entity_id: input_boolean.freeze_warning
state: 'on'
action:
- delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00'
- service: script.twitter_notify
data_template:
message: '{{ [ "Appears that the temperature will be below freezing soon. I think I will stay inside.",
"The forecasted temperature may kill sensative plants, so I will let the house know. I cannot through inaction allow another to come to harm.",
"Winter is coming. Actually it is already here. I suggest sleeping with Dragon Glass.",
"When the temperature is forcasted to get near freezing, or the NWS issues a Freeze Warning I make sure the residents of Anchorage House know." ] | random }}'
data:
media: >-
{{ [ "/config/www/tweet_images/ice.jpg",
"/config/www/tweet_images/snowfall.jpg",
"/config/www/tweet_images/snowflake.jpg"] | random }}

View File

@ -40,8 +40,8 @@ automation:
alias: Notify USPS Mail
initial_state: true
trigger:
- platform: state
entity_id: sensor.usps_mail
- platform: time
at: '10:00:30'
condition:
- condition: template
value_template: '{{ states.sensor.usps_mail.state | int > 0 }}'
@ -74,8 +74,8 @@ automation:
alias: Notify USPS Packages
initial_state: true
trigger:
- platform: state
entity_id: sensor.usps_packages
- platform: time
at: '10:02:30'
condition:
- condition: template
value_template: '{{ states.sensor.usps_packages.state | int > 0 }}'
@ -89,3 +89,4 @@ automation:
USPS is delivering {{ states.sensor.usps_packages.state }} packages today.
{%- endif -%}
call_interuption: 1

View File

@ -184,6 +184,8 @@ automation:
message: '{{ [ "NWS is sounding the Tornado alarm, so I am too. Anchorage House is taking cover. ",
"Anchorage House is heading to the closet because the NWS just issued a tornado warning for our area.",
"I just activated the internal Tornado Alarm at the request of the NWS. Thanks for the heads up @NWSAtlanta " ] | random }}'
data:
media: /config/www/tweet_images/tornado.jpg
- delay: '00:00:15'
- service: script.jarvis_alert
data_template:
@ -218,10 +220,28 @@ automation:
- platform: numeric_state
entity_id: sensor.dark_sky_overnight_low_temperature_0d
below: 35
condition:
- condition: state
entity_id: input_boolean.freeze_warning
state: 'off'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.freeze_warning
- alias: Forecast Low Above Freezing
initial_state: 'on'
trigger:
- platform: numeric_state
entity_id: sensor.dark_sky_overnight_low_temperature_0d
above: 35
condition:
- condition: state
entity_id: input_boolean.freeze_warning
state: 'on'
action:
- service: input_boolean.turn_off
entity_id: input_boolean.freeze_warning
- alias: Activate Tornado alarm
initial_state: 'on'
trigger: