From bf773f6520a5aece1ca86e19988c7a1b1106e166 Mon Sep 17 00:00:00 2001 From: ccostan Date: Sun, 19 Jul 2020 15:23:27 -0400 Subject: [PATCH] First Stab at Lightning Alarm. #392 - Still need Twitter images and put in Variables. --- .../Speech/High_Wind_Speed_Check.yaml | 29 +++++++----- config/packages/lightning.yaml | 47 +++++++++++++++++++ 2 files changed, 64 insertions(+), 12 deletions(-) create mode 100755 config/packages/lightning.yaml diff --git a/config/automation/Speech/High_Wind_Speed_Check.yaml b/config/automation/Speech/High_Wind_Speed_Check.yaml index 155768d7..199fc6ec 100755 --- a/config/automation/Speech/High_Wind_Speed_Check.yaml +++ b/config/automation/Speech/High_Wind_Speed_Check.yaml @@ -3,7 +3,8 @@ ################################### - alias: 'High Wind Speed Notification' - + id: 5cc158a5-038a-4078-a9fb-c9f9cf9ecd49 + mode: single trigger: - platform: numeric_state entity_id: sensor.dark_sky_wind_speed @@ -15,20 +16,21 @@ 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: - service: script.notify_engine data_template: - value1: 'VERY HIGH WINDS:' - value2: "{{ states('sensor.dark_sky_wind_speed')}}" + title: 'VERY HIGH WINDS:' + value1: >- + {% 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 %} + who: 'family' + apns_id: 'Alert' - service: input_boolean.turn_on entity_id: input_boolean.alert_mode @@ -60,3 +62,6 @@ {% elif ( windspeed > 60 ) %} Current Wind Speed is : {{windspeed}} mph! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! #Florida #Weather (https://amzn.to/2jQLpVQ) {% endif %} + + - delay: + hours: 2 diff --git a/config/packages/lightning.yaml b/config/packages/lightning.yaml new file mode 100755 index 00000000..cf029be1 --- /dev/null +++ b/config/packages/lightning.yaml @@ -0,0 +1,47 @@ +################################### +## Lightning is no Joke around here. +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# https://github.com/CCOSTAN/Home-AssistantConfig/issues/392 +################################### +automation: + - alias: 'Lightning Notification' + id: 6e054688-5e75-48bd-9411-52a3e26264d1 + mode: single + trigger: + - platform: state + entity_id: sensor.blitzortung_lightning_counter + + condition: + - condition: state + entity_id: group.family + state: 'home' + + action: + - service: script.notify_engine + data_template: + title: 'Lightning Warning!' + value1: 'Lightning has been detected within 2.5 Miles of our home. Be careful if outdoors.' + who: 'family' + apns_id: 'Alert' + + - service: script.speech_engine + data_template: + value1: 'Lightning has been detected within 2.5 Miles of our home. Please make sure everyone is inside the house.' + call_window_check: 1 + call_garage_check: 1 + + # - service: script.tweet_engine_no_image + # data_template: + # tweet: > + # {% 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! #Florida #Weather (https://amzn.to/2jQLpVQ) + # {% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %} + # Current Wind Speed is : {{windspeed}} mph! Warning! #Florida #Weather (https://amzn.to/2jQLpVQ) FIND SHELTER IMMEDIATELY! #Florida #Weather (https://amzn.to/2jQLpVQ) + # {% elif ( windspeed > 60 ) %} + # Current Wind Speed is : {{windspeed}} mph! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! #Florida #Weather (https://amzn.to/2jQLpVQ) + # {% endif %} + + - delay: + minutes: 30