2020-07-19 15:23:27 -04:00
###################################
## 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'
2020-07-19 18:50:16 -04:00
- condition : numeric_state
entity_id : sensor.blitzortung_lightning_counter
above : 0
2020-07-19 15:23:27 -04:00
action :
- service : script.notify_engine
data_template :
title : 'Lightning Warning!'
2020-07-28 16:03:52 -04:00
value1 : "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance') | int / 1.69) | round (1, 'floor')}} Miles of our home. Be careful if outdoors."
2020-07-19 15:23:27 -04:00
who : 'family'
apns_id : 'Alert'
- service : script.speech_engine
data_template :
2020-07-28 16:03:52 -04:00
value1 : "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance') | int / 1.69) | round (1, 'floor')}} Miles of our home. Please make sure everyone is inside the house."
2020-07-19 15:23:27 -04:00
call_window_check : 1
call_garage_check : 1
2020-07-25 14:10:43 -04:00
- service : script.tweet_engine_image
data_template :
tweet : >
{{ [
2020-07-28 16:03:52 -04:00
"{{ states('sensor.blitzortung_lightning_counter') }} lightning strike(s) have been detected within {{(states('sensor.blitzortung_lightning_distance') | int / 1.69) | round (1, 'floor')}} Miles of our home." ,
2020-07-25 14:10:43 -04:00
"{{ states('sensor.blitzortung_lightning_counter') }} lightning strike(s) have been recorded by the house." ,
"Yikes! The lightning strike was way too close. Time to get everyone inside."
] | random +
[
" #LightningCapital" ,
" (https://github.com/CCOSTAN/Home-AssistantConfig/issues/392)" ,
" #Bot " ,
2020-07-28 16:03:52 -04:00
" #Florida " ,
2020-07-25 14:10:43 -04:00
" "
] | random }}
image : >-
{{ [
"/config/www/custom_ui/floorplan/images/branding/lightning_1.png" ,
"/config/www/custom_ui/floorplan/images/branding/lightning_2.png" ,
"/config/www/custom_ui/floorplan/images/branding/lightning_3.png"
] | random }}
2020-07-19 15:23:27 -04:00
- delay :
minutes : 30