Added in some High wind logic found on @skalavala site.

This commit is contained in:
ccostan 2018-01-06 13:31:59 -05:00
parent 1ef9e62ebc
commit 79bd82fc50
2 changed files with 34 additions and 8 deletions

View File

@ -7,14 +7,28 @@
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.dark_sky_wind_speed entity_id: sensor.dark_sky_wind_speed
above: 50 above: 24
- platform: numeric_state
entity_id: sensor.dark_sky_wind_speed
above: 40
- platform: numeric_state
entity_id: sensor.dark_sky_wind_speed
above: 60
condition:
- condition: template
value_template: >
{%- if states.automation.high_wind_speed_notification.attributes.last_triggered -%}
{{ (as_timestamp(now()) - as_timestamp(states.automation.high_wind_speed_notification.attributes.last_triggered)) > 3600 }}
{%- else -%}
true
{%- endif -%}
action: action:
- service: script.notify_engine - service: script.notify_engine
data_template: data_template:
value1: 'VERY HIGH WINDS:' value1: 'VERY HIGH WINDS:'
value2: "{{ states('sensor.dark_sky_wind_speed')}}" value2: "{{ states('sensor.dark_sky_wind_speed')}}"
value3: ' '
- service: input_boolean.turn_on - service: input_boolean.turn_on
entity_id: input_boolean.alert_mode entity_id: input_boolean.alert_mode
@ -22,7 +36,14 @@
- service: script.speech_engine - service: script.speech_engine
data_template: data_template:
value1: > value1: >
"ATTENTION: The wind speed is now {{ states('sensor.dark_sky_wind_speed')|round}} miles per hour. Please make sure everyone is inside for safety." {% set windspeed = states.sensor.dark_sky_wind_speed.state | round %}
{% if ( windspeed > 25 ) and ( windspeed <= 40 ) %}
HEAVY WINDS!!! Current Wind Speed is : {{windspeed}} mph! Be VERY careful outdoors!
{% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %}
Warning! Wind speed is {{windspeed}} MPH. FIND SHELTER IMMEDIATELY!
{% elif ( windspeed > 60 ) %}
HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS!
{% endif %}
call_window_check: 1 call_window_check: 1
call_garage_check: 1 call_garage_check: 1
@ -31,7 +52,11 @@
- service: script.tweet_engine - service: script.tweet_engine
data_template: data_template:
tweet: > tweet: >
{{ [ {% set windspeed = states.sensor.dark_sky_wind_speed.state | round %}
"Wind speed is {{ states('sensor.dark_sky_wind_speed')|round}} miles per hour. For safety, I'm going to close the @garadget doors.", {% if ( windspeed > 25 ) and ( windspeed <= 40 ) %}
"Getting pretty windy! {{ states('sensor.dark_sky_wind_speed')|round}}MPH. Time to ask @Garadget to close the garage doors." HEAVY WINDS!!! Current Wind Speed is : {{windspeed}} mph! Be VERY careful outdoors! #Florida #Weather (http://amzn.to/2jQLpVQ)
] | random + "(http://amzn.to/2jQLpVQ)"}} {% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %}
Current Wind Speed is : {{windspeed}} mph! Warning! #Florida #Weather (http://amzn.to/2jQLpVQ) FIND SHELTER IMMEDIATELY! #Florida #Weather (http://amzn.to/2jQLpVQ)
{% elif ( windspeed > 60 ) %}
Current Wind Speed is : {{windspeed}} mph! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! #Florida #Weather (http://amzn.to/2jQLpVQ)
{% endif %}

View File

@ -88,6 +88,7 @@ automation:
"#ChirpTheHouse", "#ChirpTheHouse",
"#FollowMe", "#FollowMe",
"#MakingitChirp", "#MakingitChirp",
"(http://www.vmwareinfo.com/2017/12/giving-house-twitter-account.html)",
"(http://www.vmwareinfo.com/2017/11/building-digital-cuckoo-clock-with-home.html)" "(http://www.vmwareinfo.com/2017/11/building-digital-cuckoo-clock-with-home.html)"
] %} ] %}
{{ phrases|random ~ " " ~ hashtags|random }} {{ phrases|random ~ " " ~ hashtags|random }}
@ -140,7 +141,7 @@ automation:
"The number of Doorbell presses yesterday was {{states.sensor.doorbell_presses.state}}", "The number of Doorbell presses yesterday was {{states.sensor.doorbell_presses.state}}",
"The #Landscaping lights where on for about {{states.sensor.landscaping_light_time.attributes.value}} yesterday.", "The #Landscaping lights where on for about {{states.sensor.landscaping_light_time.attributes.value}} yesterday.",
"So far, I have prevented {{states.sensor.pihole_ads_blocked_today.state}} ads from hitting the network via Pi-hole! http://www.pi-hole.net", "So far, I have prevented {{states.sensor.pihole_ads_blocked_today.state}} ads from hitting the network via Pi-hole! http://www.pi-hole.net",
"Pi-hole (http://www.pi-hole.net) has serviced {{states.sensor.pihole_dns_queries_today.state}} DNS requests today! #PiZero" "Pi-hole (http://www.pi-hole.net) has serviced {{states.sensor.pihole_dns_queries_today.state}} DNS requests today! #PiZero",
"{{states.sensor.doorbell_presses.state}} people came to the door today and pressed the bell.", "{{states.sensor.doorbell_presses.state}} people came to the door today and pressed the bell.",
"The #Docker Host has been running for {{states.sensor.since_last_boot_templated.state}}", "The #Docker Host has been running for {{states.sensor.since_last_boot_templated.state}}",
"The #Docker Host for Home Assistant is using {{states.sensor.disk_used_.state}}% of the hard drive currently. " "The #Docker Host for Home Assistant is using {{states.sensor.disk_used_.state}}% of the hard drive currently. "