
Hyperlocal Weather Detection Using Your Own Sensors
A Home Assistant custom integration that creates a smart weather station by analyzing your existing sensor data to determine accurate weather conditions for your specific location and microclimate. Weather station data from external services can be unreliable or not reflect your specific environment—this integration uses your actual sensor readings to provide weather conditions that truly represent what’s happening at your location.
🔗 View on GitHub • 📖 Documentation • ⬇️ Install via HACS
The Problem: Weather Services Don’t Know Your Microclimate
Traditional weather services report conditions from stations that can be miles away from your home. These stations are often positioned at airports or on top of buildings where conditions differ significantly from ground-level residential areas. Your property’s unique microclimate—affected by local terrain, nearby buildings, vegetation, and water features—creates weather patterns that distant stations simply cannot capture.
Your backyard might be sunny while the nearest weather station reports cloudy skies. You might be experiencing fog while the airport five miles away shows clear conditions. Light rain at your house might not register at the official station across town. These discrepancies make weather-based automations unreliable and render forecast data less useful for your specific needs.
Micro Weather Station solves this problem by using your own sensors to detect actual conditions at your property. If you have outdoor temperature, humidity, and pressure sensors, you already have the foundation for accurate hyperlocal weather detection. Add solar radiation, wind, or precipitation sensors and the system becomes even more sophisticated, employing genuine meteorological algorithms to determine what’s really happening in your specific environment.
How It Works
Intelligent Weather Detection
The integration analyzes your sensor data using sophisticated meteorological algorithms that go far beyond simple threshold checks. It doesn’t just look at whether solar radiation is above 400 W/m² and call it sunny—it performs astronomical calculations based on your location’s latitude, longitude, and elevation to determine what solar radiation should be at any given time, then compares actual readings to expected clear-sky values to calculate cloud cover percentage.
For precipitation detection, the system combines multiple data sources intelligently. It examines rain rate sensors, monitors binary rain state sensors, and cross-references with humidity levels and dewpoint spreads to distinguish between actual rain, light drizzle, and fog moisture. This multi-factor approach prevents false positives from morning dew or fog triggering rain alerts.
Wind analysis considers not just current speed but also gust patterns and directional trends. The system recognizes the difference between steady breezes and gusty conditions, between light winds and severe weather patterns. Barometric pressure trends enable storm prediction—rapid pressure drops signal approaching weather systems, while stable or rising pressure indicates continuing fair conditions.
Modular Architecture
The detection system uses specialized analyzers that work together to build a complete atmospheric picture. The core analyzer implements priority-based weather condition determination with seven detection levels, ensuring the most significant weather phenomena take precedence. The atmospheric analyzer handles pressure systems, calculates fog detection scores on a 0-100 point scale, and determines storm probability based on multiple factors.
The solar analyzer estimates cloud cover using clear-sky radiation models combined with actual sensor readings. It accounts for solar elevation angles, atmospheric conditions, and seasonal variations to provide accurate cloud cover estimates throughout the day. The trends analyzer examines historical patterns, recognizing weather system evolution and identifying shifts in atmospheric conditions before they fully manifest.
This modular architecture means the system can work with whatever sensors you have available. Start with just temperature and pressure for basic detection, then add humidity for fog detection, solar radiation for accurate cloud cover, wind sensors for storm tracking, and precipitation sensors for rain detection. Each additional sensor improves accuracy without requiring system reconfiguration.
Multi-Resolution Data Storage
Unlike simple sensor entities that only track current state, Micro Weather Station implements sophisticated statistics storage at multiple time resolutions. Hourly statistics capture detailed moment-to-moment changes in conditions. Daily statistics track overall patterns and trends. Monthly statistics enable long-term climate analysis and seasonal comparisons. All this data integrates seamlessly with Home Assistant’s Energy dashboard and history graphs.
The system performs intelligent historical data management. On first setup, it downloads comprehensive historical weather data—two years of monthly data, 90 days of daily data, and 30 days of hourly readings. This provides immediate access to historical trends without waiting weeks for data to accumulate. Subsequent Home Assistant restarts skip the historical fetch and load instantly, making the system efficient for everyday use.
Automatic backfilling with a 30-day lookback window identifies and fills any gaps in your data caused by sensor outages or Home Assistant restarts. This gap-filling happens periodically in the background, ensuring your historical records remain complete for accurate trend analysis and comparative studies.
Intelligent Forecasting
Beyond current condition detection, Micro Weather Station provides sophisticated five-day daily forecasts and 24-hour hourly predictions. The forecasting system uses barometric pressure trends as its primary driver, combining them with seasonal patterns, temperature modeling, and atmospheric stability analysis to predict future conditions.
Meteorological Analysis
The forecasting engine begins with comprehensive atmospheric state analysis. It examines current pressure readings and calculates trends over multiple time windows—three hours for immediate changes, 24 hours for daily patterns, and 72 hours for system-scale evolution. These multi-timescale trends reveal whether conditions are rapidly changing or evolving slowly, information crucial for forecast confidence.
Temperature forecasting combines pressure patterns with seasonal variations and diurnal cycles. The system models normal temperature ranges for your location and time of year, then adjusts predictions based on current atmospheric conditions. High pressure systems typically bring stable temperatures, while low pressure and frontal passages create more variable conditions. Solar position calculations enable accurate modeling of daytime heating and nighttime cooling cycles.
Precipitation probability emerges from multi-factor calculation using humidity levels, dewpoint spread, cloud cover estimates, and pressure trends. Rising pressure with low humidity suggests continued dry conditions. Falling pressure with high humidity and narrow dewpoint spread indicates increasing rain probability. The system weights these factors based on atmospheric stability to produce realistic precipitation forecasts.
Pattern Recognition and Learning
The forecasting system includes pattern recognition capabilities that analyze historical weather evolution at your location. It identifies how weather systems typically develop in your specific microclimate, learning seasonal patterns and local tendencies over time. This adaptive learning means forecast accuracy improves as the system accumulates more data about your property’s unique weather patterns.
Confidence dampening acknowledges that forecast accuracy decreases with time. Today’s forecast receives high confidence weighting. Tomorrow’s forecast includes moderate dampening. Predictions for five days out include significant confidence adjustments reflecting the inherent uncertainty in long-range forecasting. This honest assessment of prediction quality helps you make better decisions about when to trust forecasts and when to monitor conditions more closely.
Hourly Predictions
The 24-hour hourly forecast provides detailed micro-evolution modeling. It predicts not just what conditions will be at midnight tomorrow, but how they’ll evolve throughout the day. Temperature predictions include realistic diurnal variation based on solar position. Cloud cover forecasts account for typical daily evolution patterns. Wind predictions consider how atmospheric conditions typically change throughout the day and night.
This hourly detail enables sophisticated automations. You can trigger actions based on predicted conditions hours in advance, adjusting behavior as forecasts evolve. Irrigation systems can check tomorrow morning’s forecast before running tonight. Climate control can pre-heat or pre-cool based on predicted temperature swings. Outdoor lighting can adjust schedules based on cloud cover forecasts that affect sunset brightness.
Key Features
Comprehensive Sensor Support
The integration works with an extensive range of sensor types, making it compatible with virtually any weather station hardware. Required sensors include just outdoor temperature, but optional sensors dramatically improve accuracy and capabilities. Humidity sensors enable dewpoint calculation and fog detection. Barometric pressure sensors enable forecasting and storm prediction. Wind speed and direction sensors provide wind condition monitoring. Solar radiation sensors enable accurate cloud cover detection through clear-sky modeling.
Rain rate sensors measure precipitation intensity, while binary rain state sensors provide simple wet/dry detection. UV index sensors help with clear sky detection. Light level sensors in lux provide backup for solar detection when radiation sensors aren’t available. The system even supports dedicated dewpoint sensors for maximum fog detection accuracy, though it can calculate dewpoint from temperature and humidity if needed.
Unit conversion support is comprehensive and automatic. The integration handles temperature in both Celsius and Fahrenheit, pressure in hectopascals, millibars, or inches of mercury, wind speed in kilometers per hour, miles per hour, or meters per second, and altitude in meters or feet based on your Home Assistant unit system. You can mix sensor units freely—use a Celsius temperature sensor with an inches-of-mercury pressure sensor and mph wind sensors, and the integration handles all conversions automatically.
Advanced Weather Science
The detection algorithms implement genuine meteorological principles, not simplified rules. Solar analysis includes astronomical position calculation, clear-sky radiation modeling, atmospheric absorption factors, and cloud cover percentage estimation. Precipitation detection combines rain rate thresholds, binary sensor states, humidity analysis, and dewpoint spread calculations to distinguish rain types and intensities.
Fog detection employs a sophisticated scoring system that awards points for high humidity, narrow dewpoint spread, low solar radiation, and recent precipitation. Scores above 60 points indicate likely fog conditions, while scores below 40 suggest clear air. This nuanced approach prevents false fog alerts while catching actual fog conditions reliably.
Storm detection examines rapid pressure drops, high wind speeds, wind gusts exceeding thresholds, pressure rates of change, and humidity patterns. The system recognizes the difference between passing shower cells and significant storm systems, providing appropriately scaled alerts and condition reports.
Energy Dashboard Integration
The integration provides complete Energy dashboard compatibility, allowing weather monitoring alongside electricity, gas, and water consumption tracking. Statistics streams include proper metadata for dashboard calculations, support for long-term historical analysis, and correct cumulative sum values for trend identification. This unified resource monitoring view helps identify correlations between weather and energy usage—how cold snaps affect heating costs, how cloudy periods reduce solar generation, or how rain patterns affect irrigation water consumption.
Multilingual Support
The integration is available in multiple languages through Home Assistant’s translation system. Current supported languages include English, Italian, German, Spanish, and French. All user interface elements, configuration flows, entity names, and error messages appear in your selected language. Community contributions for additional languages are welcome, with translation files stored in standard JSON format for easy localization.
Use Cases & Automation Examples
Smart Irrigation Control
Skip irrigation cycles when rain is detected or forecasted. Check current precipitation state before running sprinklers. Monitor yesterday’s rainfall total to adjust watering schedules. Use multi-day rain forecasts for intelligent watering decisions. This automation prevents water waste while ensuring plants receive adequate moisture.
automation:
- alias: "Skip Irrigation on Rain"
trigger:
- platform: time
at: "06:00:00"
condition:
- condition: not
conditions:
- condition: state
entity_id: weather.micro_weather_station
state: "rainy"
action:
- service: switch.turn_on
target:
entity_id: switch.garden_sprinklers
Climate Control Optimization
Pre-heat or pre-cool based on temperature forecasts. Adjust HVAC settings when storm systems approach. Open windows when comfortable outdoor conditions are predicted. Close shades when high solar radiation is detected. These optimizations improve comfort while reducing energy costs through predictive climate management.
Outdoor Activity Planning
Receive notifications when weather becomes suitable for planned activities. Alert family members before conditions deteriorate. Automatically adjust outdoor lighting based on cloud cover. Close outdoor covers before predicted storms arrive. These automations help you make better decisions about outdoor plans and protect property from weather damage.
Weather-Based Lighting
Increase interior lighting on cloudy days to maintain brightness. Adjust color temperature based on natural light conditions. Extend outdoor lighting when early fog is detected. Dim lights when bright sun streams through windows. These subtle adjustments create more comfortable living spaces that adapt naturally to changing conditions.
Technical Specifications
Architecture
The integration follows Home Assistant best practices with a coordinator pattern for data management, config flow for user-friendly setup, device and entity registry integration, proper statistics metadata, and graceful error handling. All processing happens locally on your Home Assistant instance with zero external API calls or cloud dependencies.
System Requirements
Home Assistant version 2023.1.0 or higher is required. Python 3.11+ provides the runtime environment. Supported sensor types include temperature, humidity, pressure, wind, precipitation, and solar sensors. At minimum, one outdoor temperature sensor is required, though additional sensors dramatically improve capabilities.
Performance Characteristics
The integration employs event-driven sensor monitoring with no polling overhead. Updates occur at your configured interval, typically five minutes for balanced responsiveness and efficiency. Statistics storage uses Home Assistant’s built-in recorder database with automatic cleanup based on your retention settings. Memory usage remains minimal, typically under 10MB for complete operation including forecast generation.
Data Privacy
All weather analysis occurs locally on your Home Assistant instance. No external services receive your sensor data. No cloud APIs are required or accessed. Your microclimate data remains completely private under your control. The integration requires internet access only for initial HACS download and updates—ongoing operation is entirely local.