NEW Hybrid weather data - local & online#176
NEW Hybrid weather data - local & online#176smeisens wants to merge 66 commits intoOpenSprinkler:masterfrom
Conversation
… midnight, so it's consistent with all other providers; make indentations consistent
This class combines local weather station data with external forecast data, providing methods to retrieve weather and watering data based on the availability of local and forecast sources.
Added HybridWeatherProvider for combined weather data retrieval.
Added version comment to Dockerfile.
Added information about using the WundergroundLike extension for multiple uploads in WeeWX.
Updated documentation to clarify the roles of local and forecast data in the HybridWeatherProvider. Enhanced comments for methods to better explain data retrieval and usage.
|
Weather Underground requires an API key. Since I don't have one, unfortunately I can't test it; but theoretically it should work. |
|
@smeisens: if you'd like to test the Wunderground feature, you can follow our support article to create an API key: |
|
Ray, I have an API key for Wunderground. I need to wait until the ground thaws before I can do a real test :-) |
|
I have created an API key and successfully stored it in OSPi. However, the log reports that no data from WunderGrund is currently being used. I'll look at it in the coming days to see what it is. I already had a similar problem with openMeteo. Presumably the hybrid.ts will have to be adapted so that it filters and takes over the data of WunderGround differently. I will then also check it with the other weather providers and adjust it if necessary. |
Changes in detail: BaseHybridProvider.ts (NEW) - Contains ALL common logic - Abstract method getForecastData() - every provider implements this - LocalWeatherProvider Integration - Combination, Overlap Checks, Sorting HybridOpenMeteoProvider.ts (NEW) - Inherited by BaseHybridProvider - Implements only getForecastData() with OpenMeteo-specific logic - ~80 lines instead of 282! Hybrid.ts (REBUILT) - Now a factory class - Creates the correct HybridXxxProvider based on forecastProviderName - Delegates all calls to the active provider ~160 lines instead of 282
HybridAccuWeatherProvider.ts HybridDWDProvider.ts HybridPirateWeatherProvider.ts
|
I’d like to add some context on the current state of this PR and how I see possible next steps. The current implementation is a stable intermediate step and works well for my setup. The main goal was to make hybrid weather data usable in a predictable way while keeping the scope limited and reviewable. I intentionally stopped here, as going further would require broader structural changes that are likely better discussed and implemented step by step. While working on this, a few limitations and follow-up topics became apparent:
From my perspective, a reasonable way forward could be:
Regarding other open PRs:
I wanted to surface these points explicitly rather than silently evolving the structure. I’m happy to adjust scope, split things up, or keep this PR focused purely on hybrid handling, depending on what makes most sense for the project. |
|
@smeisens: Great work. I've installed the OpenSprinkler Hybrid weather data updates on my Raspberry PI 3. It works as expected. However, if I look at the watering results they are too high for the current weather situation here in Germany. I recognized that this is caused by the fact that no humidity forecasts are generated by most Weather Forecast Providers. Please note that Weather Underground provides humidity forecast data. Relative humidity is provided within the 5-day forecast as day and night forecasts, day = 7am to 7pm and night = 7pm to 7am. The following code changes are needed for WUnderground.ts: and HybridWUndergroundProvider.ts I like the Hybrid approach as it makes perfect use of running the OpenSprinkler weather service locally on a Raspberry PI. |
Two additional suggestions:Enhancing Data Reliability: To improve the accuracy of water level calculations for multi-day cycles, it is recommended to reduce the dependence on long-term weather forecasts, which are often unreliable for predicting exact rainfall totals. For example, if a 3-day watering schedule is active, forecasted weather is the only data used to estimate water levels. By introducing a FORECAST_DAYS environment variable, users can limit the calculation to a more trustworthy timeframe. Integrating historical observations alongside short-term forecasts would yield more robust results. Flexible Sensor Requirements: Since wind speed data is not currently factored into the Zimmerman formula, its validation should be made optional. This ensures compatibility with a wider range of hardware, as some weather stations don’t include anemometers. I recommend modifying the validation logic to mirror the current handling of solar radiation data. |
Hybrid weather data (local history + external forecast)
This PR introduces a hybrid weather mode that combines:
The goal is to improve watering decisions by using accurate local observations for historical calculations while still relying on forecast data for future days.
Key points:
Notes:
This PR does not strictly depend on other open PRs