If there is lightning within 10 miles detected by my Tempest Weather Station (and near by sensors), it will send a SMS notification and also play an audible alert in my outdoor space.
alias: "Safety: Lightning Strike"
description: ""
trigger:
- platform: state
entity_id:
- sensor.weatherflow_last_lightning_strike
condition:
- condition: numeric_state
entity_id: sensor.weatherflow_last_lightning_strike_distance
below: 10
action:
- variables:
ttsmessage: >-
Lightning has been detected within {{
states('sensor.weatherflow_last_lightning_strike_distance') }} miles.
Please stop outdoor activities and seek shelter until at least 30
minutes after the most recent strike, which is currently {{
(as_timestamp(now()) + 1800) | timestamp_custom('%I:%M%p') }}.
smsmessage: "666 Evil St: {{ ttsmessage }}"
- service: notify.twilio_sms
data:
message: "{{ smsmessage }}"
target:
- "+155555551212"
- if:
- condition: time
after: "08:00:00"
before: "22:00:00"
then:
- repeat:
count: "2"
sequence:
- repeat:
count: "3"
sequence:
- service: media_player.play_media
target:
entity_id:
- media_player.pool_1
- media_player.pool_2
- media_player.deck
data:
announce: true
media_content_id: >-
https://www.mydomain.com/public/urgent_alert.mp3
media_content_type: music
extra:
volume: 70
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: media_player.play_media
target:
entity_id:
- media_player.pool_1
- media_player.pool_2
- media_player.deck
data:
announce: true
media_content_id: media-source://tts/cloud?message={{ ttsmessage | urlencode }}
media_content_type: provider
extra:
volume: 70
- delay:
seconds: >
{% set l = ttsmessage|length %} {% set speed = 120 %} {% set
duration_seconds = ((speed *
l)/1000)|round(0,method='ceil')|int %} {{ duration_seconds }}
- delay:
hours: 0
minutes: 25
seconds: 0
milliseconds: 0
enabled: true
mode: single
I’m looking to have a Tempest station detect lightning and have Home Assistant trigger sirens and strobes…seems doable enough. Any insight you can provide would be greatly appreciated. Thanks!
Why is this needed. a simple weather alert and party time over. Technically this will work is most scenarios but since its only measuring the last lightning bolt distance and not actually predicting anything it could fail you can still get zapped in your pool then it will tell you last lightning strike was 0 feet away
What type of weather alert are you suggesting? Current conditions are not always accurate on forecasting apps.
Typically for pools you want people out of the water if it’s lightning a minimum of 10 miles away, realistically lightning can travel 25 miles, although rare.
It’s not perfect, but it’s an additional safety measure, and we have teens that sometimes they need the reminder to come inside.
I also have another alert tied to the NWS web service that will play alerts for severe thunders storm warnings, tornado watches, and tornado warnings.
To your question though, why do I need this? My answer is, do we really need half the stuff we do in Home Assistant?
@amattas Hello! Just read through your outdoor pool lightning alarm thread, and it's basically the same project I've been building for my own setup, so I wanted to ask:
Did you ever run into random false strikes?
On my end the local/UDP feed throws phantom strikes on totally calm, dry days. Almost every morning I get a "strike" pinned right overhead (~1 km / 0.6 mi) with no storm anywhere near and WeatherFlow's cloud shows nothing. Every so often that same noise reads farther out (like 5 mi) instead of overhead, which is annoying because it slips into a different alert tier. My best guess, after reading the datasheet on the AS3935 chip, seems like local RF interference... A/C compressor, appliances; no idea... lots of things seem to arc in the same frequency the chip listens on.
I also noticed you moved to the local UDP feed and lean on NWS alerts as a backstop... so a few questions if you don't mind:
Did you hit the same calm-day false strikes on the local feed?
If so, did you filter them out somehow, or just let NWS be the sanity check?
How often do false alerts actually fire for you and has a real storm ever properly set the thing off?
Trying to figure out if this is just the nature of the AS3935 chip or something I can build a real filter for. Appreciate any insight, and nice work on the build.
That's a pretty elegant way to do it. I'm over here creating helpers and a 4-part filter to corroborate against rain, wind, pressure, and storm approach... mode: single + a trailing delay is way cleaner.
Are your distance and is_lightning entities coming from the local UDP integration or the cloud one?
I'm trying to work out whether my noise is the chip or just my neighborhood.