Support for Weatherlink Live data locally from Davis Weather Station#146
Open
ccorcos wants to merge 13 commits intoOpenSprinkler:masterfrom
Open
Support for Weatherlink Live data locally from Davis Weather Station#146ccorcos wants to merge 13 commits intoOpenSprinkler:masterfrom
ccorcos wants to merge 13 commits intoOpenSprinkler:masterfrom
Conversation
Author
There was a problem hiding this comment.
Pull Request Overview
Support polling Weatherlink Live device for local weather data and streamline local provider logic
- Add request logging with morgan and new WEATHERLINK_URL polling branch in server.ts
- Implement Weatherlink Live polling, parsing, and queuing in
local.ts, removing old 23-hour delay logic - Include documentation and dependency updates for local Weatherlink Live integration
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| server.ts | Add morgan for logging and WEATHERLINK_URL-based polling logic |
| routes/weatherProviders/local.ts | Define data types, implement fetch helper and pollWeatherlink, update queue logic |
| package.json | Add morgan dependency |
| docs/davis-weatherlink.md | New guide for setting up local WeatherLink Live integration |
Comments suppressed due to low confidence (5)
server.ts:38
- [nitpick] The error message for missing WEATHERLINK_URL is not very descriptive; consider throwing an error or exiting the process with a clear message to avoid silent failures.
if (!weatherLinkUrl) console.error("Missing WEATHERLINK_URL.")
routes/weatherProviders/local.ts:166
- Consider adding unit tests for 'pollWeatherlink' (and the custom 'fetch' helper) to verify data parsing, error handling, and interval calculations.
export async function pollWeatherlink(weatherLinkUrl: string) {
docs/davis-weatherlink.md:20
- Typo in 'showiung'; should be 'showing'.
This is showiung that my weatherlink live instance name as `weatherlinklive-719e35`.
routes/weatherProviders/local.ts:5
- The 'url' module is imported but never used; consider removing this unused import to keep the code clean.
import * as url from "url";
routes/weatherProviders/local.ts:353
- [nitpick] The custom 'fetch' function shadows the global fetch API; consider renaming it (e.g., fetchText) to avoid confusion.
function fetch(urlString: string): Promise<string> {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


I don't know what's going on with the other document about integrating with a Davis Weather Station, but it seems outdated and/or overcomplicated.
I'm using a weather link live device which has a local api for getting weather data. All I did was add some env variables and leverage the rest of the local weather service api.
I added a markdown doc explaining how to set it up.
I think I have all the units working right and left some comments to help out others.
I also removed the condition to wait 23 hours before ETo weather will work. The only measurement that will be incorrect is the precipitation because it hasn't accumulated yet. But for the other values, its averaging so that should be fine after just a single sample...
Let me know what you think! I now have a full local system going now :)