[RELEASE] Advanced Severe Weather Detector (BMS-Grade Predictive Engine)

I am incredibly excited to release the Advanced Severe Weather Detector to the community for free.

For a long time, I have wanted my smart home to move past simply reacting to a weather event after it arrives. I wanted to build a system that makes the house truly intelligent and hands off—a Building Management System (BMS) that actively predicts incoming kinetic energy, drops the storm shutters, isolates power circuits, and warns the family before the first drop of rain even hits the roof.

This application is the result. It is a localized, predictive thermodynamic engine that crosses your personal sensor data with the official United States National Weather Service (NWS) API to track six distinct hazard profiles.

:tornado: The 6 Threat DNAs (Predictive Math Engine)

This app doesn't just look at wind speed and flip a switch. It analyzes the synergy between multiple environmental factors to calculate Threat Intensity, Probability, and System Confidence in real-time.

  • Tornado / Extreme Shear: Looks for dangerous synergies. If your barometric pressure enters a rapid vacuum drop while your wind direction sensors detect sudden, extreme angular shear, the probability spikes before the kinetic wind impacts the house.
  • Thunderstorm (CAPE Proxy): Cross-references high heat and high dewpoints (moisture loading) with rapid atmospheric squeeze velocities (temp/dewpoint convergence) to predict brewing convection and gust fronts.
  • Flood: Monitors real-time rain rates against daily accumulation. If the ground is already heavily saturated and a low-pressure front is moving in, the predictive flash flood probability increases.
  • Freeze: Calculates the exact trajectory of temperature drops. It tells you exactly how many hours until a hard freeze hits, and differentiates between a dry freeze and a hoar frost (based on dewpoint spread).
  • Severe Heat: Utilizes the official NWS polynomial regression equation to calculate the true Heat Index, scaling probability based on upward heating trajectories.
  • Tropical: Calibrates your local barometric pressure to Mean Sea Level Pressure (MSLP). Looks for sustained, multi-hour deep pressure drops combined with heavy moisture loading to identify incoming tropical cyclones.

:cloud: Official NWS / NOAA Cloud Integration (Zero-Install)

To ensure hyper-accuracy, the local sensor engine is cross-referenced with the US Government.

  • No API Keys Required: The app automatically pulls your Hub's Latitude and Longitude to query the NWS grid.
  • Async Watchdog: If the internet goes down or the NWS API crashes, the app instantly catches the timeout, suspends network polling to prevent hub flooding, and falls back to running 100% locally on your sensors.
  • Hardware Override: You can allow official NWS Watches and Warnings to bypass your local math and directly trigger your physical hardware alarm switches.

:rotating_light: DEFCON Watchdog Polling

Standard polling (e.g., every 5 minutes) is great for your Zigbee/Z-Wave mesh, but too slow for a tornado. When any hazard probability crosses your defined threshold (e.g., 25%), the app breaks out of its standard schedule and shifts into DEFCON Watchdog Overdrive. It will aggressively poll your sensors every 1, 2, 3, 4, or 5 minutes to track the atmospheric degradation. Once the threat clears, it gracefully downshifts back to your standard schedule.

:control_knobs: Granular Output & Hardware Routing

Every single hazard DNA has independent routing for both WARNING and ALARM states.

  • Mode Restrictions: Only fire Thunderstorm audio alerts if the hub is in 'Home' or 'Awake' mode, but fire Tornado alarms regardless of the current mode.
  • Audio/Siren Routing: Independently route Push Notifications, custom TTS strings (perfect for Sonos), MP3 Sound Files, and physical Sirens/Strobes (like Zooz sirens) for each specific threat.
  • Virtual Automation Mapping: Map specific virtual switches to each state to trigger your Hubitat Rule Machine rules (e.g., "If Tornado Alarm switch is ON, turn off HVAC and close all shutters").
  • System-Wide Debounce: A safety hardware hold timer prevents your shutters or valves from flipping on and off rapidly if a storm is hovering right on the threshold line.

:bar_chart: HTML Dashboards & "Show Your Work" Diagnostics

The app automatically creates a single Child Device that exposes the entire threat matrix to your Hubitat Dashboards via pre-formatted HTML tiles.

  • Diagnostic Report: The app UI features a 3-column layout that explains why a threat is elevated in plain English, alongside a raw math column showing the exact algorithms and scores from the last evaluation tick.
  • Daily NWS Forecast: Generates a clean, scaled HTML dashboard tile showing your localized NWS detailed text forecast for the current day and tonight.
  • Glitch Filtering: Automatically rejects physically impossible sensor leaps (e.g., a 10-degree jump in 60 seconds because a bird landed on the sensor or a battery died), keeping your house from going into lockdown over a hardware glitch.

:hammer_and_wrench: Hardware Requirements

To run the base matrix, you need:

  1. Outdoor Temperature Sensor
  2. Outdoor Humidity Sensor
  3. Barometric Pressure Sensor

For the full predictive matrix, Wind Speed, Wind Direction, Rain Accumulation, and Lightning Detectors are highly recommended. Works flawlessly with Ecowitt, Ambient Weather, and any standard Hubitat weather device drivers.

App:
raw.githubusercontent.com/ShaneAllen334/Hubitat_Apps/refs/heads/main/Advanced_Severe_Weather_Detector/Advanced_Severe_Weather_Detector.groovy

Driver:
raw.githubusercontent.com/ShaneAllen334/Hubitat_Apps/refs/heads/main/Advanced_Severe_Weather_Detector/Advanced_Severe_Weather_Component_Device.groovy

DISCLAIMER: This application is a localized predictive thermodynamic engine designed for home automation. It DOES NOT replace official NOAA broadcasts, National Weather Service alerts, or Emergency Alert System (EAS) activations. It should never be relied upon as a primary life-saving tool or safety device. The author and distributor assume no liability for missed meteorological events, false alarms, property damage, or injury.

Let me know what you guys think, how the predictive math is holding up in your specific regions, and what you're automating with the Warning/Alarm switches!





Bug fixes for Advanced Severe Weather Detector are available on Github.