mirror of
https://github.com/thejeffreystone/home-assistant-configuration.git
synced 2025-09-14 07:45:48 +00:00
More twitter engine cleanup. Think I have it mostly settled now
This commit is contained in:
@@ -21,20 +21,14 @@ automation:
|
||||
{%- endif -%}
|
||||
action:
|
||||
- delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00'
|
||||
- service: script.twitter_github
|
||||
- service: script.twitter_notify_image
|
||||
data_template:
|
||||
message: >-
|
||||
tweet: >-
|
||||
"Its a new month, so this is a good time to remind you that I am powered by @homeassistant and configured by @thejeffreystone. Find my code at https://github.com/thejeffreystone/home-assistant-configuration"
|
||||
|
||||
#- id: tweet_new_ha_version
|
||||
# alias: Tweet New HA Version
|
||||
# trigger:
|
||||
# - platform: state
|
||||
# entity_id: binary_sensor.updater
|
||||
# from: 'off'
|
||||
# to: 'on'
|
||||
# action:
|
||||
# - service: script.twitter_new_ha
|
||||
image: >-
|
||||
image: >-
|
||||
{{ [ "/config/www/tweet_images/robot1.jpg",
|
||||
"/config/www/tweet_images/robot2.jpg"] | random }}
|
||||
|
||||
- id: tweet_some_snark
|
||||
alias: Tweet Some Snark
|
||||
@@ -86,8 +80,8 @@ automation:
|
||||
tweet: >-
|
||||
"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"
|
||||
image: >-
|
||||
"{{ [ "/config/www/tweet_images/robot1.jpg",
|
||||
"/config/www/tweet_images/robot2.jpg"] | random }}"
|
||||
{{ [ "/config/www/tweet_images/robot1.jpg",
|
||||
"/config/www/tweet_images/robot2.jpg"] | random }}
|
||||
|
||||
- id: net_speed_report
|
||||
initial_state: true
|
||||
@@ -98,13 +92,14 @@ automation:
|
||||
action:
|
||||
- service: script.twitter_notify_image
|
||||
data_template:
|
||||
tweet: '{{ [ "According to my latest speed tests Anchorage House is getting
|
||||
tweet: >-
|
||||
{{ [ "According to my latest speed tests Anchorage House is getting
|
||||
{{ states.sensor.internet_test_down.attributes.max_value }} Mbps down and {{ states.sensor.internet_test_up.attributes.max_value }}
|
||||
Mbps up thanks to #ATTFiber. ", "How fast is your internet? I just checked
|
||||
am Im seeing {{ states.sensor.internet_test_down.attributes.max_value }} Mbps down and {{ states.sensor.internet_test_up.attributes.max_value }}
|
||||
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 }}'
|
||||
Mbps up." ] | random }}
|
||||
image: >-
|
||||
{{ [ "/config/www/tweet_images/speed.jpg",
|
||||
"/config/www/tweet_images/fiber-optic.jpg"] | random }}
|
||||
@@ -212,7 +207,8 @@ automation:
|
||||
- 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: '{{ [ "There are only {{states.sensor.christmas_countdown.state}} days until Christmas.",
|
||||
tweet: >-
|
||||
{{ [ "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.",
|
||||
@@ -221,7 +217,7 @@ automation:
|
||||
"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 }}'
|
||||
] | random }}
|
||||
image: >-
|
||||
{{ [ "/config/www/tweet_images/xmas.jpg",
|
||||
"/config/www/tweet_images/gift.jpg",
|
||||
@@ -250,7 +246,7 @@ automation:
|
||||
- service: script.twitter_notify_image
|
||||
data_template:
|
||||
tweet: >-
|
||||
'Tomorrow is Christmas. It is practically here! Santa is coming tonight! Don't forget the cookies!'
|
||||
"Tomorrow is Christmas. It is practically here! Santa is coming tonight! Do not forget the cookies!"
|
||||
image: >-
|
||||
"/config/www/tweet_images/santa.jpg"
|
||||
|
||||
@@ -293,11 +289,61 @@ automation:
|
||||
- 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: '{{ [ "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 }}'
|
||||
tweet: >-
|
||||
{{ [ "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 }}
|
||||
image: >-
|
||||
{{ [ "/config/www/tweet_images/ice.jpg",
|
||||
"/config/www/tweet_images/snowfall.jpg",
|
||||
"/config/www/tweet_images/snowflake.jpg"] | random }}
|
||||
"/config/www/tweet_images/snowflake.jpg"] | random }}
|
||||
|
||||
- id: new_pull_request
|
||||
alias: New Pull Request
|
||||
initial_state: true
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.open_pull_requests
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.open_pull_requests.state | int > 0 }}'
|
||||
action:
|
||||
- service: script.text_notify
|
||||
data_template:
|
||||
who: "jeff"
|
||||
title: "New Pull Request"
|
||||
message: >-
|
||||
{%- if states.sensor.open_pull_requests.state | int == 1 -%}
|
||||
There is {{ states.sensor.open_pull_requests.state }} pending pull request.
|
||||
{%- else -%}
|
||||
There are {{ states.sensor.open_pull_requests.state }} pending pull requests.
|
||||
{%- endif -%}
|
||||
- service: script.twitter_notify_image
|
||||
data_template:
|
||||
tweet: >-
|
||||
{{ [
|
||||
"Look at that. There is a new pull request waiting to be merged. You can create one too by contributing to my code at https://github.com/thejeffreystone/home-assistant-configuration #coding #opensource",
|
||||
"Fork Yes! Someone contributed some code to https://github.com/thejeffreystone/home-assistant-configuration and you could to. #coding #opensource.",
|
||||
"Thanks for the code kind stanger. Join the fun at https://github.com/thejeffreystone/home-assistant-configuration #coding #opensource",
|
||||
"Theres been an awakening. Have you felt it? I will merge it so it can become the master. https://github.com/thejeffreystone/home-assistant-configuration #coding #opensource"
|
||||
] | random }}
|
||||
image: >-
|
||||
{{ [ "/config/www/tweet_images/code.jpg",
|
||||
"/config/www/tweet_images/codeing.jpg",
|
||||
"/config/www/tweet_images/code2.jpg",
|
||||
"/config/www/tweet_images/computer.jpg"] | random }}
|
||||
|
||||
- id: new_ha_notification
|
||||
alias: New HA Notification
|
||||
initial_state: true
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.updater
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
action:
|
||||
- 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 }}"}
|
||||
|
Reference in New Issue
Block a user