[RELEASE] Advanced Rain Detection - A Predictive Meteorological Engine for Ecowitt

Hey everyone,

I’ve been hard at work overhauling the Advanced Rain Detection engine. If you’ve been using this app to manage your windows, awnings, or irrigation, you know the goal has always been to detect rain before the tipping bucket actually registers 0.01 inches.

However, dealing with unpredictable summer pop-up storms (especially down here in the South) meant that standard barometric pressure drops weren't always giving us enough warning. So, I decided to stop looking at the horizon and start looking at the exact thermodynamic state of the air column directly above our houses.

I’ve completely rewritten the prediction engine to move away from basic linear addition (e.g., adding arbitrary points for humidity) and upgraded it to use Algorithmic Synergy and Thermodynamic Velocity. We are essentially turning Hubitat into a localized meteorological lab.

Here is what is new in the latest code:

:microscope: The Physics & Prediction Upgrades

  • Wet-Bulb "Rain Shaft" Detection: The engine now utilizes the Stull Formula to calculate real-time Wet-Bulb temperature. If the app sees your ambient temp crashing toward the Wet-Bulb point, it knows rain is actively falling through the air column above your house—allowing it to predict rain before the first drop hits your leak sensor.
  • Spread Convergence (Squeeze) Velocity: It no longer just looks for a tight Dew Point spread; it tracks the speed at which the temperature and dew point are colliding.
  • Algorithmic Synergy (Multipliers): Instead of just adding points, the engine multiplies them. If the Dew Point Spread is converging rapidly while the Barometric Pressure is dropping, the engine applies a 1.3x Synergy Multiplier because the physics of those two things happening simultaneously almost exclusively guarantees precipitation.
  • Lightning Proximity & Wind Shear: Added optional support to factor in lightning strike counts/distance (within a rolling 30-min window) and violent wind direction shifts (squall lines) into the probability matrix.

:gear: Reliability & "Quality of Life" Features

  • Dynamic "Time-to-Dry" Estimator: The app now takes your daily accumulated rainfall and divides it by a real-time Evapotranspiration (ET) Index. Your dashboard will now display a live countdown (e.g., "~2.4 hrs") until the ground is mathematically dry. Perfect for irrigation lockouts!
  • Sensor Redundancy & Failover: You can now assign "Backup" Temp/Hum/Pressure sensors. The app will average them by default, but if your primary weather station drops off the mesh, the app instantly fails-over to the backup so your automations don't die.
  • Thermal Smoothing (Sun-Spike Protection): Applies an Exponentially Weighted Moving Average (EWMA) filter to your temp readings. If the sun peaks out and bakes your sensor by 5 degrees in 3 minutes, the app smooths the curve to prevent a false "Rapid Cooling" trigger when a cloud covers it back up.
  • The "Confidence" Score: The app now grades its own homework. It generates a dynamic Confidence Score (%) based on how many sensors you have active and how strongly the different mathematical models agree with one another.
  • Granular Toggles: Every single algorithm can now be toggled on or off in the configuration page to suit your specific microclimate.

:warning: Important Installation Note

Because of the massive amount of new data being calculated, you must update the Child Device Driver code as well as the App code. The new driver adds native Hubitat WaterSensor capabilities (so you can plug it straight into Hubitat Safety Monitor without complex rules) and exposes all the new attributes (wetBulb, timeToDry, confidenceScore, lightningStrikeCount, etc.) so you can map them straight to your dashboards.

Grab the updated code from the repository, hit 'Done' to initialize the new variables, and let me know how it performs in your microclimates! As always, bug reports and feature requests are welcome.

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

Driver:
raw.githubusercontent.com/ShaneAllen334/Hubitat_Apps/refs/heads/main/Advanced_Rain_Detection/Advanced_Rain_Detector_Information_Device.groovy

1 Like