2020-07-19 19:23:27 +00: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 22:50:16 +00:00
|
|
|
- condition: numeric_state
|
|
|
|
entity_id: sensor.blitzortung_lightning_counter
|
|
|
|
above: 0
|
2020-07-19 19:23:27 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-07-25 18:10:43 +00:00
|
|
|
- service: script.tweet_engine_image
|
|
|
|
data_template:
|
|
|
|
tweet: >
|
|
|
|
{{ [
|
|
|
|
"Lightning has been detected within 2.5 Miles of our home.",
|
|
|
|
"{{ 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 ",
|
|
|
|
" "
|
|
|
|
] | 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 19:23:27 +00:00
|
|
|
|
|
|
|
- delay:
|
|
|
|
minutes: 30
|