This is a weather station designed to be used with a Raspberry Pi on the official 7" 800x480 touchscreen.
A fork of elewin/pi-weather-station (MIT licensed, see
LICENSE) tuned to run as an always-on display on a Raspberry Pi 4 with a 1024x600 touchscreen, coming back by itself after a power cut. It is kept in step with upstream: last mergedea4c09c(v3.0.2), which brought webpack 5, upstream's own Tomorrow.io v4 and RainViewer fixes, and the map label-size fix. What is different:
- API fixes (made before upstream's own). The old ClimaCell address (
data.climacell.co) and RainViewer's retired radar endpoints stopped answering, so no weather or radar loaded. This fork usesapi.tomorrow.ioand RainViewer'sweather-maps.json(radar is real only up to zoom 7, so the layer stretches zoom-7 tiles). Where upstream later fixed the same things differently, this fork's version was kept.- Severe weather mode. Polls the free National Weather Service alerts feed; while a Tornado, Severe Thunderstorm, Flash Flood, Hurricane... Watch or Warning is active, or a Special Weather Statement about a storm hazard (the notice the NWS issues for a strong storm before it becomes a warning), it shows a red banner, animates the radar by itself and refreshes every 5 minutes instead of 10 (
client/src/severeWeather.js; add?severe=testto the URL to preview). Fog, heat and smoke statements are ignored.- Far fewer API calls and less CPU. One weather request per refresh instead of three (and one per map tap instead of six), automatic retry with back-off after a failed load, sunrise/sunset calculated locally (matches the US Naval Observatory), a clock that redraws once a minute, and a cheaper alert banner. See the commit messages for numbers.
- Always-on setup.
deploy/has a startup script that waits for what it needs instead of fixed sleeps (screen up about 40 s after power-up), keeps the browser running if it crashes, and restarts it nightly; plus cron entries and setup notes.- Tests.
tests/has headless-browser tests with every outside service faked, so they use none of your API quota.API keys and other secrets live only in
settings.json, which is git-ignored. Never commit them.
The weather station will require you to have API keys from Mapbox and Tomorrow.io (formerly ClimaCell), API v4. Optionally, you can use an API key from LocationIQ to preform reverse geocoding.
Weather maps are provided by the RainViewer API, which generously does not require an API key.
Sunrise and Sunset times are calculated locally in this fork (upstream used Sunrise-Sunset).
See it in action here.
Be mindful of the plan limits for your API keys and understand the terms of each provider, as scrolling around the map and selecting different locations will incur API calls for every location. Additionally, the weather station will periodically make additional api calls to get weather updates throughout the day.
05-04-2026: Updated to use latest Tomorrow.io API, other bug fixes
1-22-2021: Now uses the Tomorrow.io (formerly ClimaCell) API v4. For ClimaCell API v3 keys, use Pi Weather Station v1.
You will need to have Node.js installed.
To install, clone the repo and run
$ npm install
Start the server with
$ npm start
Now set point your browser to http://localhost:8080 and put it in full screen mode (F11 in Chromium).
It's possible to access the app from another machine, but beware that by doing so you'll be exposing the app to your entire network, and someone else could potentially access the app and retreive your API keys from the settings page. By default the app is only accessible to localhost, but if you would like to open it up to your network (at your own risk!), open /server/index.js and remove "localhost" from the line that contains:
app.listen(PORT, "localhost", async () => {so that it becomes:
app.listen(PORT, async () => {The server will now serve the app across your network.
- Your API keys are saved locally (in plain text) to
settings.json. - The server will attempt to get your default location, but if it cannot or you wish to choose a different default location, enter the latitude and longitude under
Custom LatitudeandCustom Longitudein settings, which can be accessed by tapping the gear button in the lower right hand corner. - To hide the mouse cursor when using a touch screen, set
Hide MousetoOn.
Pi Weather Station is available as a Docker Image for AMD64 and ARM infrastructures. see the ReadME here for more: https://github.com/SeanRiggs/pi-weather-station/blob/master/Docker%20Image/Docker-ReadMe.md
Thanks to thicla01 for the label size bug fix, and dagent23 for tile layer fixes
The MIT License (MIT)
Copyright (c) 2020 Eric Lewin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.