Updated covid tweet

This commit is contained in:
Jeffrey Stone 2020-04-29 21:36:28 -04:00
parent 2017c3b7fe
commit 0a85405f5b
1 changed files with 1 additions and 15 deletions

View File

@ -433,23 +433,9 @@ automation:
# who: "jeff"
# title: "Covid-19 Update"
# message: "Yesterday in the US there was {{ states.sensor.covid_pv_new_cases.state }} new cases of COVID-19 reported and {{ states.sensor.covid_pv_new_dead.state }} more deaths. We now have a total of {{ states.sensor.covid_pv_confirmed.state }} people that have been infected and {{ states.sensor.covid_pv_dead.state }} that have died. So far {{ states.sensor.covid_pv_recovered.state }} have recovered, but {{ states.sensor.covid_pv_critical.state }} are in critical condition."
#- service: script.twitter_notify
# data_template:
# message: "Yesterday in the US there were {{ states.sensor.covid_pv_new_cases.state }} new cases of COVID-19 reported and {{ states.sensor.covid_pv_new_dead.state }} more deaths. We now have a total of {{ states.sensor.covid_pv_confirmed.state }} people that have been infected and {{ states.sensor.covid_pv_dead.state }} that have died. So far {{ states.sensor.covid_pv_recovered.state }} have recovered, but {{ states.sensor.covid_pv_critical.state }} are in critical condition. #worldometers"
- service: script.twitter_notify
data_template:
message: >-
COVID-19 Stats for yesterday in the US: New Infections: {{ states.sensor.covid_pv_new_cases.state }} (Daily Change:{{ (((states.sensor.covid_pv_new_cases.state |replace(",", "") | int - states.sensor.covid_old_new_count.state |replace(",", "") | int) / states.sensor.covid_pv_new_cases.state |replace(",", "") | int * 100) | round)}}%) | New Deaths: {{ states.sensor.covid_pv_new_dead.state}} (Daily Change:{{ (((states.sensor.covid_pv_new_dead.state |replace(",", "") | int - states.sensor.covid_old_dead_count.state |replace(",", "") | int) / states.sensor.covid_pv_new_dead.state |replace(",", "") | int * 100) | round)}}%) | Total Cases: {{ states.sensor.covid_pv_confirmed.state }} | Total Dead:{{ states.sensor.covid_pv_dead.state }} | Total Recovered: {{ states.sensor.covid_pv_recovered.state }} ({{ ((states.sensor.covid_pv_recovered.state |replace(",", "") | int / states.sensor.covid_pv_confirmed.state |replace(",", "") | int) * 100) | round }}%)| Critical Cases: {{ states.sensor.covid_pv_critical.state }}
- 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 }}"}