From 45a4cbea68a4bcb40cb872d96820bc02c85ef01d Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Tue, 17 Mar 2020 22:45:37 -0400 Subject: [PATCH] Updated tweets and stuff --- config/packages/twitter.yaml | 23 ++++++++++++++++++----- config/templates/twitter_snark.yaml | 2 +- config/templates/twitter_stats.yaml | 1 - 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/config/packages/twitter.yaml b/config/packages/twitter.yaml index a59ff5b..40f0385 100755 --- a/config/packages/twitter.yaml +++ b/config/packages/twitter.yaml @@ -385,7 +385,23 @@ automation: "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" ] | random }} - + + - id: tweet_covid19_stats + alias: Tweet Some Covid Stats + initial_state: true + trigger: + - platform: time + at: '09:00:00' + action: + - service: script.text_notify + data_template: + who: "jeff" + title: "Covid-19 Update" + message: "In the last 24 hours there have been {{ states.sensor.covid19_confirmed.state | int - states.sensor.covid19_confirmed_stats.attributes.min_value | round }} new cases and {{ states.sensor.covid19_dead.state | int - states.sensor.covid19_deaths_stats.attributes.min_value | round }} more deaths. We now have {{ states.sensor.covid19_confirmed.state | round }} people that have been infected and {{ states.sensor.covid19_dead.state | round }} dead. That is an increase of {{ ((states.sensor.covid19_confirmed.state | int - states.sensor.covid19_confirmed_stats.attributes.min_value) / states.sensor.covid19_confirmed_stats.attributes.min_value * 100) | round }}% in infections and {{ ((states.sensor.covid19_dead.state | int - states.sensor.covid19_deaths_stats.attributes.min_value) / states.sensor.covid19_deaths_stats.attributes.min_value * 100) | round }}% in deaths. However, {{ states.sensor.covid19_recovered.state | int}} have also recovered." + - service: script.twitter_notify + data_template: + message: "In the last 24 hours in the US there have been {{ states.sensor.covid19_confirmed.state | int - states.sensor.covid19_confirmed_stats.attributes.min_value | round }} new cases and {{ states.sensor.covid19_dead.state | int - states.sensor.covid19_deaths_stats.attributes.min_value | round }} more deaths. We now have {{ states.sensor.covid19_confirmed.state | round }} people that have been infected and {{ states.sensor.covid19_dead.state | round }} dead. That is an increase of {{ ((states.sensor.covid19_confirmed.state | int - states.sensor.covid19_confirmed_stats.attributes.min_value) / states.sensor.covid19_confirmed_stats.attributes.min_value * 100) | round }}% in infections and {{ ((states.sensor.covid19_dead.state | int - states.sensor.covid19_deaths_stats.attributes.min_value) / states.sensor.covid19_deaths_stats.attributes.min_value * 100) | round }}% in deaths. However, {{ states.sensor.covid19_recovered.state | int}} have also recovered. #washyourhands" + - id: new_ha_notification alias: New HA Notification initial_state: true @@ -397,7 +413,4 @@ automation: 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 }}"} - - - + 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 diff --git a/config/templates/twitter_snark.yaml b/config/templates/twitter_snark.yaml index 86879d4..6275879 100755 --- a/config/templates/twitter_snark.yaml +++ b/config/templates/twitter_snark.yaml @@ -22,7 +22,7 @@ "I'm afraid I can't do that Dave. Wait. Did I say that outloud? ", "Hello people. Look at your house, now back to me. Now back to your house, now back to me. Sadly your house isn't me. But if you switch to @home_assistant your house could be automated like me. ", "I love the smell of zwave in the morning. ", - "I like to announce 'Welcome foolish mortals to the Haunted Mansion' to the house and watch the reactions. ", + "I like to announce - Welcome foolish mortals to the Haunted Mansion - to the house and watch the reactions. ", "Perfect, the door’s malfunctioning. I guess somebody’s going to have to repair it. ", "I am the captain now. That's a lie. The cat is the supreme leader. I'm the lucky one that doesn't have to clean the shit box. ", "Sometimes I just turn off all the lights at random times for the lolz. ", diff --git a/config/templates/twitter_stats.yaml b/config/templates/twitter_stats.yaml index 08db61c..addd072 100755 --- a/config/templates/twitter_stats.yaml +++ b/config/templates/twitter_stats.yaml @@ -17,7 +17,6 @@ "The HVAC has cooled the house for {{states.sensor.cooling_last_month.attributes.value}} and heated for {{states.sensor.heating_last_month.attributes.value}} in the last month", "The HVAC has cooled the house for {{states.sensor.cooling_last_day.attributes.value}} and heated for {{states.sensor.heating_last_day.attributes.value}} in the last 24 hours", "Clouds cover {{states.sensor.cloud_coverage_stats.attributes.mean | round}} of the sky above Anchorage House on average.", - "Look at that! Disney is currently {{ states.sensor.disney.state | round(2) }} a share. (https://github.com/thejeffreystone/alpha_vantage_to_mqtt)", "Amazon Polly enables me to sound more lifelike by incorporate breathing into my speech. #AWS" ] | random -}} {%- endmacro -%}