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
2020-08-31 17:40:54 -04:00
# https://www.vcloudinfo.com/2020/08/adding-a-lightning-sensor-to-home-assistant.html
2020-07-19 15:23:27 -04:00
###################################
2020-08-07 13:12:40 -04:00
input_boolean :
snooze_lightning :
name : Snooze Lightning
initial : off
icon : mdi:weather-lightning
ios :
push :
categories :
- name : Lightning
identifier : 'LIGHTNING'
actions :
- identifier : 'SNOOZE_LIGHTNING'
title : 'Snooze Alerts until tomorrow'
activationMode : 'background'
authenticationRequired : no
2020-08-09 13:42:49 -04:00
destructive : no
2020-08-07 13:12:40 -04:00
2020-07-19 15:23:27 -04:00
automation :
2020-08-18 15:44:00 -04:00
- alias : Snooze Lightning
id : 1f295bb8-8925-4b22-8f75-9l1ghtn1nga8
trigger :
platform : event
event_type : ios.notification_action_fired
event_data :
actionName : SNOOZE_LIGHTNING
action :
- service : input_boolean.turn_on
entity_id : input_boolean.snooze_lightning
2020-07-19 15:23:27 -04:00
- 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-08-18 15:44:00 -04:00
- condition : state
entity_id : input_boolean.snooze_lightning
state : 'off'
2020-07-19 15:23:27 -04:00
action :
- service : script.notify_engine
2020-09-26 10:52:45 -04:00
data :
2020-07-19 15:23:27 -04:00
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-08-18 15:44:00 -04:00
ios_category : "LIGHTNING"
2020-07-19 15:23:27 -04:00
who : 'family'
apns_id : 'Alert'
- service : script.speech_engine
2020-09-26 10:52:45 -04:00
data :
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-28 16:29:57 -04:00
- delay :
2021-07-08 15:57:50 -04:00
minutes : 60
2020-07-28 16:29:57 -04:00
2020-07-25 14:10:43 -04:00
- service : script.tweet_engine_image
2020-09-26 10:52:45 -04:00
data :
2020-07-25 14:10:43 -04:00
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-28 16:29:57 -04:00
"{{ states('sensor.blitzortung_lightning_counter') }} lightning strike(s) have been recorded {{(states('sensor.blitzortung_lightning_distance') | int / 1.69) | round (1, 'floor')}} miles by the house." ,
"Yikes! {{ states('sensor.blitzortung_lightning_counter') }} lightning strike(s) were way too close; ({{(states('sensor.blitzortung_lightning_distance') | int / 1.69) | round (1, 'floor')}} miles too close in fact). Time to get everyone inside."
2020-07-25 14:10:43 -04:00
] | random +
[
" (https://github.com/CCOSTAN/Home-AssistantConfig/issues/392)" ,
2020-08-31 17:40:54 -04:00
" Adding a Lightning Sensor to Home Assistant (https://www.vcloudinfo.com/2020/08/adding-a-lightning-sensor-to-home-assistant.html)" ,
2020-07-25 14:10:43 -04:00
] | random }}
image : >-
{{ [
2020-08-31 17:40:54 -04:00
"/config/www/custom_ui/floorplan/images/youtube/episodes/LightningSensor.png" ,
2020-07-25 14:10:43 -04:00
"/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-28 20:38:39 -04:00
- delay :
2021-07-08 15:57:50 -04:00
minutes : 60