mirror of
				https://github.com/CCOSTAN/Home-AssistantConfig.git
				synced 2025-11-03 19:45:23 +00:00 
			
		
		
		
	First Stab at Lightning Alarm. #392 - Still need Twitter images and put in Variables.
This commit is contained in:
		@@ -3,7 +3,8 @@
 | 
			
		||||
###################################
 | 
			
		||||
 | 
			
		||||
- alias: 'High Wind Speed Notification'
 | 
			
		||||
 | 
			
		||||
  id: 5cc158a5-038a-4078-a9fb-c9f9cf9ecd49
 | 
			
		||||
  mode: single
 | 
			
		||||
  trigger:
 | 
			
		||||
    - platform: numeric_state
 | 
			
		||||
      entity_id: sensor.dark_sky_wind_speed
 | 
			
		||||
@@ -15,20 +16,21 @@
 | 
			
		||||
      entity_id: sensor.dark_sky_wind_speed
 | 
			
		||||
      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:
 | 
			
		||||
    - service: script.notify_engine
 | 
			
		||||
      data_template:
 | 
			
		||||
        value1: 'VERY HIGH WINDS:'
 | 
			
		||||
        value2: "{{ states('sensor.dark_sky_wind_speed')}}"
 | 
			
		||||
        title: 'VERY HIGH WINDS:'
 | 
			
		||||
        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
 | 
			
		||||
      entity_id: input_boolean.alert_mode
 | 
			
		||||
@@ -60,3 +62,6 @@
 | 
			
		||||
          {% elif ( windspeed > 60 ) %}
 | 
			
		||||
             Current Wind Speed is : {{windspeed}} mph! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! #Florida #Weather (https://amzn.to/2jQLpVQ)
 | 
			
		||||
          {% endif %}
 | 
			
		||||
 | 
			
		||||
    - delay:
 | 
			
		||||
        hours: 2
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										47
									
								
								config/packages/lightning.yaml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										47
									
								
								config/packages/lightning.yaml
									
									
									
									
									
										Executable 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
 | 
			
		||||
		Reference in New Issue
	
	Block a user