Analog Kid
macrumors G3
One Raspberry Pi uses an Arduino with a custom shield (a WxShield, long since discontinued) to collect temperature/pressure/humidity data from a handful of commercially available sensors inside/outside the house and send the data (via MQTT) to another Pi that maintains a database of weather data. This second Pi also pulls down local data from Dark Sky (via their API) every five minutes, and publishes both the in-house and Dark Sky data (and some historical summaries) to the local network (using MQTT). Two other Pi's read that data and display it continuously on attached touchscreens - these "front-end" Pi's display NTP-sync'd clocks and weather information, and also serve as touchscreen interfaces for my Hue lights (yet another Pi is merely a very accurate clock). It’s all color-coded to heck, so I can quickly get a sense of the conditions from across the room, even if I can’t completely read the display (e.g. the temperatures change color in 5° bands, from purple around freezing, across the spectrum, up to light red above 100°). And I put a light sensor on one of the Pi's, which is sampled every 15 seconds and used to adjust the display brightness on the 3 Pi's that have screens. I don't have large outside sensors like an anemometer attached, so, for instance, the wind information comes from Dark Sky (along with the forecasts). Dark Sky, in turn, is getting it from a traditional PWS (personal weather station) that's about a mile away from my house - good enough for my purposes. The system also periodically uploads screenshots and data to a website of mine, so I can keep track of it remotely. It's been an off-and-on side project since 2016, though the vast majority of development was 2016-2018, because I already added most of the things I wanted. I still tinker with it from time to time. And, since all the data is sent back and forth in standard formats, I could replace various bits and have the rest continue to function (if, say, I put an anemometer up outside). And this is the kind of thing I'll have to do before Dark Sky's API goes away - survey the other providers, select one (possibly weather.gov), and build code to collect data from them and massage it into the format I need (and, along the way, find numerous assumptions I've made while getting too cozy with Dark Sky's data). It'll mean changing a few thousand lines of code.
Here's a screenshot of the main touch panel display (the stripe down the right edge are touch controls for the Hue lights):
View attachment 902863
And this is a web page that (aside from the sunrise/set info at the bottom) is essentially a compact visual translation of the interesting bits of the Dark Sky forecast information:
View attachment 902868
All told it's about 15k lines of Python 3, and involved a lot of fun learning and exploration and going down all sorts of interesting rabbit holes (e.g. the WxShield board came with a huge C# GUI program to read and display the data - they'd intended it as a Windows-only thing - I translated about 4k lines of C# into Python and simmered it down to just the parts I needed for data extraction from the Arduino in a "headless" environment - now, instead it collects the data, translates it into usable form and transmits it via MQTT as it arrives - every 20 seconds or so for the last 4 years, aside from a couple of power failures).
Respect.