First Stab at Lightning Alarm. #392 - Still need Twitter images and put in Variables.

This commit is contained in:
ccostan 2020-07-19 15:23:27 -04:00
parent 985ea92758
commit bf773f6520
2 changed files with 64 additions and 12 deletions

View File

@ -3,7 +3,8 @@
################################### ###################################
- alias: 'High Wind Speed Notification' - alias: 'High Wind Speed Notification'
id: 5cc158a5-038a-4078-a9fb-c9f9cf9ecd49
mode: single
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.dark_sky_wind_speed entity_id: sensor.dark_sky_wind_speed
@ -15,20 +16,21 @@
entity_id: sensor.dark_sky_wind_speed entity_id: sensor.dark_sky_wind_speed
above: 60 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:' title: 'VERY HIGH WINDS:'
value2: "{{ states('sensor.dark_sky_wind_speed')}}" 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 - service: input_boolean.turn_on
entity_id: input_boolean.alert_mode entity_id: input_boolean.alert_mode
@ -60,3 +62,6 @@
{% elif ( windspeed > 60 ) %} {% elif ( windspeed > 60 ) %}
Current Wind Speed is : {{windspeed}} mph! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! #Florida #Weather (https://amzn.to/2jQLpVQ) Current Wind Speed is : {{windspeed}} mph! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! #Florida #Weather (https://amzn.to/2jQLpVQ)
{% endif %} {% endif %}
- delay:
hours: 2

47
config/packages/lightning.yaml Executable file
View File

@ -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