################################### ## Lightning is no Joke around here. # @CCOSTAN # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # https://github.com/CCOSTAN/Home-AssistantConfig/issues/392 ################################### 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 destructive: yes 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' - condition: numeric_state entity_id: sensor.blitzortung_lightning_counter above: 0 action: - service: script.notify_engine data_template: title: 'Lightning Warning!' 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." who: 'family' apns_id: 'Alert' - service: script.speech_engine data_template: 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." call_window_check: 1 call_garage_check: 1 - delay: minutes: 20 - service: script.tweet_engine_image data_template: tweet: > {{ [ "{{ 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.", "{{ 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." ] | random + [ " #LightningCapital", " (https://github.com/CCOSTAN/Home-AssistantConfig/issues/392)", " #Bot ", " #Florida ", " " ] | 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 }} - delay: minutes: 20