Trying my hardware lightning detector

This commit is contained in:
Jeffrey Stone 2020-08-21 23:28:38 -04:00
parent 093c3f3ec7
commit b9dde9ad51
3 changed files with 157 additions and 102 deletions

View File

@ -0,0 +1,24 @@
- platform: mqtt
name: "Lightning Detected"
state_topic: "house/acurite-6045M/lightning_active"
payload_on: "1"
payload_off: "0"
device_class: safety
- platform: mqtt
name: "Back Porch Sensor Battery"
state_topic: "house/acurite-6045M/battery"
payload_on: "1"
payload_off: "0"
device_class: battery
- platform: mqtt
name: "Garage Sensor Battery"
state_topic: "house/acurite-10968/battery"
payload_on: "1"
payload_off: "0"
device_class: battery
- platform: mqtt
name: "Crawlspace Sensor Battery"
state_topic: "house/acurite-158/battery"
payload_on: "1"
payload_off: "0"
device_class: battery

View File

@ -36,9 +36,9 @@ input_boolean:
weather_alert_texts: weather_alert_texts:
name: Weather Alert Texts name: Weather Alert Texts
icon: mdi:telegram icon: mdi:telegram
# lightning_warning: lightning_warning:
# name: Lightning Warning name: Lightning Warning
# icon: mdi:flash-alert icon: mdi:flash-alert
### You first need to find either your NWS Zone ID or County ID. Im not sure which is better but I used my Zone ID here. ### You first need to find either your NWS Zone ID or County ID. Im not sure which is better but I used my Zone ID here.
### You can find your Zone ID by going to https://alerts.weather.gov/ 7, scroll down to your state and click on the “zone list” then look for the entry for your county. ### You can find your Zone ID by going to https://alerts.weather.gov/ 7, scroll down to your state and click on the “zone list” then look for the entry for your county.
@ -146,7 +146,6 @@ sensor:
automation: automation:
- alias: 'NWS Weather Alert Pop Up Control' - alias: 'NWS Weather Alert Pop Up Control'
initial_state: 'on'
trigger: trigger:
platform: state platform: state
entity_id: sensor.nws_alerts entity_id: sensor.nws_alerts
@ -188,7 +187,6 @@ automation:
{% endif %} {% endif %}
- alias: 'NWS Weather Sensor Refresh' - alias: 'NWS Weather Sensor Refresh'
initial_state: 'on'
trigger: trigger:
platform: state platform: state
entity_id: sensor.nws_alerts entity_id: sensor.nws_alerts
@ -196,7 +194,6 @@ automation:
- service: script.refresh_weather_alert_sensors - service: script.refresh_weather_alert_sensors
- alias: NWS Notification Weather Alert - alias: NWS Notification Weather Alert
initial_state: 'on'
trigger: trigger:
platform: state platform: state
entity_id: sensor.nws_alerts entity_id: sensor.nws_alerts
@ -228,7 +225,6 @@ automation:
{% endif %} {% endif %}
- alias: NWS Announce Weather Alert - alias: NWS Announce Weather Alert
initial_state: 'on'
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.nws_alerts entity_id: sensor.nws_alerts
@ -285,7 +281,6 @@ automation:
{% endif %} {% endif %}
- alias: NWS Announce Weather Alert for Tornado - alias: NWS Announce Weather Alert for Tornado
initial_state: 'on'
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.nws_alerts entity_id: sensor.nws_alerts
@ -319,47 +314,58 @@ automation:
title: "Tornado Warning!" title: "Tornado Warning!"
message: "The National Weather Service Has issued a Tornado Warning for our area." message: "The National Weather Service Has issued a Tornado Warning for our area."
# - alias: Lightning Detected - alias: Lightning Detected
# initial_state: 'on' trigger:
# trigger: - platform: state
# - platform: state entity_id: binary_sensor.lightning_detected
# entity_id: binary_sensor.lightning_active from: 'off'
# to: 'on' to: 'on'
# action: - platform: template
# - service: script.text_notify value_template: '{{ states.sensor.lightning_strike_count.state | int > states.sensor.lightning_total_count.state | int }}'
# data_template: condition:
# who: "jeff" - condition: template
# title: "Lightning Detected!" value_template: '{{ states.sensor.lightning_strike_count.state | int > states.sensor.lightning_total_count.state | int }}'
# message: "Lightning has been detected within 15 miles of Anchorage House" - condition: state
entity_id: input_boolean.lightning_warning
state: 'off'
action:
- service: script.text_notify
data_template:
who: "jeff"
title: "Lightning Detected!"
message: "Lightning has been detected within 20 miles of Anchorage House"
- service: input_boolean.turn_on
entity_id: input_boolean.lightning_warning
# - service: script.lightning_warning_audible # - service: script.lightning_warning_audible
# - alias: Lightning Warning Off
# initial_state: 'on' - alias: Lightning Warning Off
# trigger: trigger:
# - platform: state - platform: state
# entity_id: binary_sensor.lightning_active entity_id: binary_sensor.lightning_detected
# to: 'off' from: 'on'
# action: to: 'off'
# - service: script.text_notify - platform: template
# data_template: value_template: '{{ states.sensor.lightning_strike_count.state | int == states.sensor.lightning_total_count.state | int }}'
# who: "jeff" for:
# title: "Lightning Threat Over." minutes: 20
# message: "No more Lightning Strikes detected." condition:
# - service: script.lightning_clear_audible - condition: template
value_template: '{{ states.sensor.lightning_strike_count.state | int == states.sensor.lightning_total_count.state | int }}'
# - alias: 'lightning_update' - condition: state
# initial_state: 'on' entity_id: input_boolean.lightning_warning
# trigger: state: 'on'
# - platform: time_pattern action:
# minutes: '/5' - service: script.text_notify
# action: data_template:
# - service: homeassistant.update_entity who: "jeff"
# entity_id: sensor.lightning_strike_count title: "Lightning Threat Over."
# - service: homeassistant.update_entity message: "No more Lightning Strikes detected."
# entity_id: binary_sensor.lightning_active - service: input_boolean.turn_off
entity_id: input_boolean.lightning_warning
#- service: script.lightning_clear_audible
- alias: NWS Freeze Warning - alias: NWS Freeze Warning
initial_state: 'on'
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.nws_alerts entity_id: sensor.nws_alerts
@ -375,7 +381,6 @@ automation:
entity_id: input_boolean.freeze_warning entity_id: input_boolean.freeze_warning
- alias: Forecast Low Near Freezing - alias: Forecast Low Near Freezing
initial_state: 'on'
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.nws_overnight_low entity_id: sensor.nws_overnight_low
@ -392,7 +397,6 @@ automation:
entity_id: input_boolean.freeze_warning entity_id: input_boolean.freeze_warning
- alias: Forecast Low Above Freezing - alias: Forecast Low Above Freezing
initial_state: 'on'
trigger: trigger:
- platform: numeric_state - platform: numeric_state
entity_id: sensor.nws_overnight_low entity_id: sensor.nws_overnight_low
@ -409,7 +413,6 @@ automation:
entity_id: input_boolean.freeze_warning entity_id: input_boolean.freeze_warning
- alias: Activate Tornado alarm - alias: Activate Tornado alarm
initial_state: 'on'
trigger: trigger:
- platform: state - platform: state
entity_id: input_boolean.tornado_alarm entity_id: input_boolean.tornado_alarm
@ -420,7 +423,6 @@ automation:
entity_id: script.tornado_alarm entity_id: script.tornado_alarm
- alias: Deactivate Tornado alarm - alias: Deactivate Tornado alarm
initial_state: 'on'
trigger: trigger:
- platform: state - platform: state
entity_id: input_boolean.tornado_alarm entity_id: input_boolean.tornado_alarm
@ -470,34 +472,32 @@ script:
media_content_id: http://192.168.7.40/audio/tornado_alarm.mp3 media_content_id: http://192.168.7.40/audio/tornado_alarm.mp3
media_content_type: "music" media_content_type: "music"
# lighning_warning_audible: lightning_warning_audible:
# sequence: sequence:
# - condition: state - condition: state
# entity_id: binary_sensor.day entity_id: binary_sensor.day
# state: 'on' state: 'on'
# - service: script.twitter_notify_image - service: script.twitter_notify_image
# data_template: data_template:
# tweet: '{{ [ "Did you see that flash? I did. Letting everyone know there is lightning nearby.", tweet: '{{ [ "Did you see that flash? I did. Letting everyone know there is lightning nearby.",
# "When Lightning is near I notify the residents of Anchorage House to keep them safe.", "When Lightning is near I notify the residents of Anchorage House to keep them safe.",
# "If the residents of Anchorage House didnt hear the thunder I just gave them a heads up.", "If the residents of Anchorage House didnt hear the thunder I just gave them a heads up.",
# "Everyone inside! If you are near Anchorage House that is. Lightning is near." ] | random }}' "Everyone inside! If you are near Anchorage House that is. Lightning is near." ] | random }}'
# image: >- image: >-
# {{ [ "/config/www/tweet_images/lightning.jpg", {{ [ "/config/www/tweet_images/lightning.jpg",
# "/config/www/tweet_images/lightning-bolt.jpg"] | random }} "/config/www/tweet_images/lightning-bolt.jpg"] | random }}
# - service: script.ah_report - service: script.ah_report
# data: data:
# call_interuption: 1 call_lightning_alert: 1
# call_lightning_alert: 1
# lighning_clear_audible: lightning_clear_audible:
# sequence: sequence:
# - condition: state - condition: state
# entity_id: binary_sensor.day entity_id: binary_sensor.day
# state: 'on' state: 'on'
# - service: script.ah_report - service: script.ah_report
# data: data:
# call_interuption: 1 call_lightning_clear: 1
# call_lightning_clear: 1
refresh_weather_alert_sensors: refresh_weather_alert_sensors:
sequence: sequence:
@ -512,4 +512,6 @@ script:
- service: homeassistant.update_entity - service: homeassistant.update_entity
entity_id: sensor.flood_warning entity_id: sensor.flood_warning
- service: homeassistant.update_entity - service: homeassistant.update_entity
entity_id: sensor.flood_watch entity_id: sensor.flood_watch

View File

@ -34,40 +34,69 @@
# minutes: 5 # minutes: 5
# seconds: 0 # seconds: 0
# milliseconds: 0 # milliseconds: 0
## Accurite 158 - Back Porch ## Accurite 158 - Crawlspace
- platform: mqtt - platform: mqtt
name: "Accurite Back Porch Temperature" name: "Crawlspace Temperature"
state_topic: "house/accurite-158/temperature" state_topic: "house/acurite-158/temperature"
device_class: temperature device_class: temperature
- platform: mqtt - platform: mqtt
name: "Accurite Back Porch Humidity" name: "Crawlspace Humidity"
state_topic: "house/accurite-158/humidity" state_topic: "house/acurite-158/humidity"
device_class: humidity
- platform: mqtt
name: "Crawlspace Model"
state_topic: "house/acurite-158/model"
- platform: mqtt
name: "Crawlspace lupdate"
state_topic: "house/acurite-158/last_update"
device_class: timestamp
# - platform: mqtt ## Accurite 10968 - Garage
# name: "Accurite Back Porch Status"
# state_topic: "house/accurite-158/status"
# - platform: mqtt
# name: "Accurite Back Porch Battery"
# state_topic: "house/accurite-158/battery"
- platform: mqtt - platform: mqtt
name: "Accurite Back Porch Model" name: "Garage Temperature"
state_topic: "house/accurite-158/model" state_topic: "house/acurite-10968/temperature"
- platform: mqtt
name: "Accurite Back Porch lupdate"
state_topic: "house/accurite-158/lastupdate"
- platform: mqtt
name: "Accurite Garage Temperature"
state_topic: "house/accurite-10968/temperature"
device_class: temperature device_class: temperature
- platform: mqtt - platform: mqtt
name: "Accurite Garage Humidity" name: "Garage Humidity"
state_topic: "house/accurite-10968/humidity" state_topic: "house/acurite-10968/humidity"
device_class: humidity
- platform: mqtt - platform: mqtt
name: "Accurite Garage Model" name: "Garage Model"
state_topic: "house/accurite-10968/model" state_topic: "house/acurite-10968/model"
- platform: mqtt - platform: mqtt
name: "Accurite Garage lupdate" name: "Garage lupdate"
state_topic: "house/accurite-10968/lastupdate" state_topic: "house/acurite-10968/last_update"
device_class: timestamp
## Accurite 6045M - Back Porch
- platform: mqtt
name: "Back Porch Temperature"
state_topic: "house/acurite-6045M/temperature"
device_class: temperature
- platform: mqtt
name: "Back Porch Humidity"
state_topic: "house/acurite-6045M/humidity"
device_class: humidity
- platform: mqtt
name: "Back Porch Model"
state_topic: "house/acurite-6045M/model"
- platform: mqtt
name: "Back Porch lupdate"
state_topic: "house/acurite-6045M/last_update"
device_class: timestamp
- platform: mqtt
name: "Lightning Strike Count"
state_topic: "house/acurite-6045M/lightning_count"
- platform: mqtt
name: "Lightning Storm Distance"
state_topic: "house/acurite-6045M/storm_dist"
- platform: mqtt
name: "Lightning total count"
state_topic: "house/lightning/total_count"
- platform: statistics - platform: statistics
name: Inside Humidity Stats name: Inside Humidity Stats