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

:cloud_with_lightning: MAJOR UPDATE: Advanced Severe Weather Detector (BMS-Grade Physics, Structural Load & New Threat DNAs)

We have completely overhauled the predictive engine for the Advanced Severe Weather Detector.

:tornado: Advanced Meteorological Physics Engines

1. Structural Kinetic Wind Load & Air Density Tracking Wind speed is just a number; wind load is what breaks your roof. We introduced a kinetic physics model that calculates dynamic Air Density (kg/m³) based on your localized Absolute Pressure, Kelvin Temperature, and Vapor Pressure.

  • The Logic: Cold, dry air is significantly heavier than hot, humid air. A 40 mph winter gust exerts far more destructive physical force than a 40 mph summer gust. The engine now uses dynamic pressure equations to translate raw wind speed into Pounds per Square Foot (PSF) or Pascals of structural force hitting your house, scaling the Tornado and Thunderstorm threat probabilities dynamically based on physical mass.

2. Atmospheric Gravity Wave Detection You can now detect supercells before the main pressure drop arrives.

  • The Logic: Massive supercell updrafts physically displace the atmosphere, pushing out invisible "ripples" ahead of the storm. The engine actively analyzes micro-oscillations in your barometric pressure over a rolling 15-minute window. If your pressure bounces rapidly up and down without a mean trend change, it flags a Gravity Wave and proactively elevates the Tornado/Storm threat before a single drop of rain hits your house.

3. Dry Microburst / Virga Detection Standard microbursts come with heavy rain, but dry microbursts happen when rain evaporates before hitting the ground (Virga). This flash-cools the air column and causes violent, destructive straight-line winds with zero warning.

  • The Logic: If your Dew Point Spread is massive (bone-dry air) + Temp suddenly crashes + Wind spikes + Rain gauge reads 0.00, the system instantly triggers a localized Dry Microburst Alarm.

4. True WBGT (Wet-Bulb Globe Temperature) The standard NWS Heat Index is flawed because its mathematical formula assumes you are standing in the shade.

  • The Upgrade: If you map a Lux (Solar Radiation) sensor to the app, the engine abandons the standard Heat Index and calculates a proxy for WBGT—the gold standard used by the military, OSHA, and athletic associations. It factors in exactly how the sun is baking you and how the wind is cooling you to determine true human heat stress in direct sunlight.

5. Storm Intercept Vectoring (Approach Velocity) Standard lightning sensors just tell you a storm is 10 miles away. They don't tell you the closing speed.

  • The Upgrade: By analyzing the slope of strike distances over time, the app now filters out "ghost" strikes and calculates the Approach Velocity (MPH) of the storm core, giving you a highly accurate vector of whether the storm is stalled, departing, or bearing down on your location.

:police_car_light: New Threat DNAs

6. Fire Weather (Red Flag) DNA We've covered water, wind, and ice, but wildfires are a massive blind spot. We introduced a 7th Threat DNA specifically for Fire Weather.

  • The Logic: This uses Vapor Pressure Deficit (VPD) to measure exactly how violently the air is sucking moisture out of local vegetation. It combines this with sustained wind speeds and a rolling 7-day rainfall history (Fuel Moisture). If the fuel is dry, the air is thirsty, and the wind is high, it triggers a Fire Weather Alarm so you can automatically cut power to outdoor smart outlets and prevent spark risks.

7. The Ice Accumulation Index The app now differentiates between harmless snow and destructive freezing rain.

  • The Logic: Ice storms cause significantly more power outages than standard snow. If your Dry-Bulb temp is hovering just above freezing (e.g., 34°F) but your Wet-Bulb is sub-freezing, and physical precipitation starts falling, the app recognizes it as a flash-freeze event. It routes to a dedicated "ICE ALARM" state so you can trigger specific automations (like turning on pipe heaters).

:gear: System Resilience & Hub Health Tweaks

8. EMI / EMP Lightning Guard Close lightning strikes generate massive Electromagnetic Interference (EMI), which frequently causes residential Zigbee/Z-Wave sensors to "freeze" or send junk data.

  • The Tweak: If a strike hits within 3 miles and your sensors immediately go stale, the app flags an "EMI Lock." Instead of assuming the storm physically destroyed your hardware and triggering the "Dying Breath" failover, it waits for the interference to clear.

9. Global "Stand-Down" Sequencer (The All-Clear) No more premature all-clear announcements when the eye of a storm passes over. The new Stand-Down Sequencer waits until every single DNA in the matrix reads 'Clear', and then verifies that the barometric pressure is actively rising and kinetic winds have completely died down before officially broadcasting the All-Clear TTS and Zooz chime.

10. Aggressive Hubitat Database Protection (Memory Pruning) Rendering 24-hour charts requires saving a lot of state variables. To ensure this app never causes memory bloat on your hub, we implemented an aggressive array-pruning algorithm. No matter how fast your sensors poll, the engine forcefully limits the history arrays to exactly 288 points (24 hours at 5-minute intervals), keeping the app incredibly lightweight.

11. MSLP Barometric Calibration If you live 500 feet above sea level, your absolute pressure looks like a Category 1 Hurricane to the math engine. We added a dedicated Barometric MSLP Offset input so you can sync your localized raw pressure perfectly to the NWS Mean Sea Level Pressure (MSLP), preventing false Tropical DNA alarms. We also re-wired the "Reset" button to use absolute state.remove() commands, allowing you to instantly wipe the cache when calibrating.

12. Active Diagnostic Heartbeat Added a live telemetry UI to the top of the dashboard showing the exact compute time of the last engine cycle (in milliseconds), system state, and array sizes so you can visually verify the Hubitat background scheduler hasn't hung up.

App:

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