{"id":44545772,"url":"https://github.com/kdwils/weatherstation","last_synced_at":"2026-02-13T19:16:27.492Z","repository":{"id":147491551,"uuid":"618569923","full_name":"kdwils/weatherstation","owner":"kdwils","description":"An interface for displaying real time tempest observartions from your own device","archived":false,"fork":false,"pushed_at":"2025-08-10T19:28:05.000Z","size":4776,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T21:16:29.718Z","etag":null,"topics":["golang","tempest","udp","weather","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdwils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-24T19:00:28.000Z","updated_at":"2025-08-10T19:28:08.000Z","dependencies_parsed_at":"2024-01-15T01:54:39.567Z","dependency_job_id":"4fa072eb-e0ad-490a-8b52-d4ce21a36e42","html_url":"https://github.com/kdwils/weatherstation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kdwils/weatherstation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdwils%2Fweatherstation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdwils%2Fweatherstation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdwils%2Fweatherstation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdwils%2Fweatherstation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdwils","download_url":"https://codeload.github.com/kdwils/weatherstation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdwils%2Fweatherstation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29414765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","tempest","udp","weather","websocket"],"created_at":"2026-02-13T19:16:26.209Z","updated_at":"2026-02-13T19:16:27.483Z","avatar_url":"https://github.com/kdwils.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weatherstation\n \nWeatherstation is a Go package for consuming real-time event data from a [Tempest weather device](https://apidocs.tempestwx.com/reference/quick-start).\n\nThe binary ships with two interfaces:\n* A terminal UI\n* A simple web dashboard\n\n## How it works\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant Interface\n    participant WeatherDevice\n\n    User-\u003e\u003eInterface: Launches TUI\n    Interface-\u003e\u003eWeatherDevice: Subscribes to real-time data\n    WeatherDevice--\u003e\u003eInterface: Sends observation data\n    Interface-\u003e\u003eInterface: Append history metrics\n    Interface-\u003e\u003eInterface: Render updated graphs\n    Interface--\u003e\u003eUser: Display updated interface\n```\n\n## Installation\n\nTo install the binary, run:\nFrom Go\n```bash\ngo install github.com/kdwils/weatherstation@latest\n```\n\nEnvironment Variables:\n\nWebSocket API Reference: https://weatherflow.github.io/Tempest/api/ws.html\nThe following environment variables are required to connect to the Tempest WebSocket API:\n```shell\nexport WEATHERSTATION_TEMPEST_DEVICE_ID='\u003cyour-device-id\u003e'\nexport WEATHERSTATION_TEMPEST_TOKEN='\u003cyour-token\u003e'\nexport WEATHERSTATION_TEMPEST_SCHEME='wss'\nexport WEATHERSTATION_TEMPEST_PATH='/swd/data'\nexport WEATHERSTATION_TEMPEST_HOST='ws.weatherflow.com'\n```\n\nTo attempt a UDP connection, set the following environment variables:\n```shell\nexport WEATHERSTATION_TEMPEST_DEVICE_ID='\u003cyour-device-id\u003e'\nexport WEATHERSTATION_TEMPEST_TOKEN='\u003cyour-token\u003e'\nexport WEATHERSTATION_TEMPEST_PATH='/swd/data'\nexport WEATHERSTATION_TEMPEST_HOST='\u003cyour-device-lan-ip-address\u003e:54000'\nexport WEATHERSTATION_TEMPEST_SCHEME='udp'\n```\n\n\u003e [!WARNING]\n\u003e UDP connectivity is currently untested in this project due to remote development without access to a local device. If it doesn't work for you, open an issue and I'll try to help.\n\nThis will install the `weatherstation` binary in your `$GOPATH/bin` directory.\n\n## The Terminal UI\n\nTo start the terminal UI:\n```shell\nweatherstation tui\n```\n![teminal ui](images/tui.png)\n\n## The Dashboard\n\nThe dashboard is a simple web application that uses the Go template engine to render the current weather data.\n\nThe dashboard is served on port 8080 by default, but can be configured using the `WEATHERSTATION_SERVER_PORT` environment variable.\n\n![alt text](images/dashboard.png)\n\nTo serve the dashboard http server:\nFrom the binary:\n```bash\nweatherstation serve \n```\n\nThen open http://localhost:8080 (or wherever it's hosted) in your browser to view the dashboard.\n\n## Package Structure\n\nThe package is organized into several modules under the `pkg` directory:\n\n### api\n`/pkg/api/`\n- Contains data models and client interfaces for interacting with the Tempest API\n- Handles parsing and conversion of weather observation data\n- Provides utility functions for unit conversions (m/s to mph, celsius to fahrenheit, etc.)\n\n### connection\n`/pkg/connection/`\n- Provides abstract connection interfaces for different protocols\n- Implements both WebSocket and UDP connections\n- Handles connection lifecycle (connect, read, write, close)\n\n### tempest\n`/pkg/tempest/`\n- Core event listening functionality\n- Event type definitions and constants\n- Handler registration for different event types\n\n## Usage\n\nHere's an example of how to use the package to listen for weather station events:\nA similar one can be found in the [`cmd/listen.go`](https://github.com/kdwils/weatherstation/blob/main/cmd/listen.go) file.\n```go\npackage main\n\nimport (\n    \"context\"\n    \"encoding/json\"\n    \"log\"\n    \"os\"\n    \"os/signal\"\n\n    \"github.com/kdwils/weatherstation/pkg/api\"\n    \"github.com/kdwils/weatherstation/pkg/connection\"\n    \"github.com/kdwils/weatherstation/pkg/tempest\"\n)\n\nfunc main() {\n    ctx := context.Background()\n    deviceID := 123\n    conn, err := connection.NewConnection(ctx, \"wss\", \"ws.weatherflow.com\", \"/swd/data\", \"your-token\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    listener := tempest.NewEventListener(conn, tempest.ListenGroupStart, deviceID)\n\n    // Register handlers for different events\n    listener.RegisterHandler(tempest.EventConnectionOpened, func(ctx context.Context, b []byte) {\n        log.Printf(\"connection opened: %s\", b)\n    })\n\n    listener.RegisterHandler(tempest.EventObservationTempest, func(ctx context.Context, b []byte) {\n        var obs api.ObservationTempest\n        if err := json.Unmarshal(b, \u0026obs); err != nil {\n            log.Fatal(err)\n            return\n        }\n        log.Printf(\"received observation: %+v\", obs)\n    })\n\n    // Start listening in a goroutine\n    go func() {\n        if err := listener.Listen(ctx); err != nil {\n            log.Fatal(err)\n        }\n    }()\n\n    // Wait for interrupt signal\n    c := make(chan os.Signal, 1)\n    signal.Notify(c, os.Interrupt)\n    \u003c-c\n}\n```\n\n## Supported Events\n\nThe package supports the following event types (defined in `pkg/tempest/events.go`):\n\n- `EventConnectionOpened`: Connection establishment\n- `EventObservationTempest`: Weather observations\n- `EventPrecipitation`: Precipitation events\n- `EventLightingStrike`: Lightning detection\n- `EventDeviceOnline`/`EventDeviceOffline`: Device status\n- `EventStationOnline`/`EventStationOffline`: Station status\n- `EventRapidWind`: Rapid wind measurements\n\n## Acknowledgements\n* [go-asciigraph](https://github.com/guptarohit/asciigraph) — for rendering terminal graphs.\n* [go-lipgloss](https://github.com/charmbracelet/lipgloss) — for styling the terminal UI.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdwils%2Fweatherstation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdwils%2Fweatherstation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdwils%2Fweatherstation/lists"}