Weather System

Oct 1, 2023

This page is not yet complete and is a work in progress

Source Code Available Here: Github

Overview

The original aim of this project was to simply view data from a weather station in my garden but has evolved into several applications. The principal components are:

Screenshots of the viewing application are available in the Github Repository readme.

Components

Viewing Applications

Originally the viewing program was written in Python using Tkinter for the UI but has since evolved into a single Flutter/Dart codebase that supports Android, Windows, and Linux. The program allows you to view live and historial data, as well as incorporating forecasts provided via MetOffice API’s.

As of 01/10/23 it is 12,598 lines long.

Several parts of it are out of date. For example, a rewrite of the data backend is in progress in an effort to make it more object oriented and make it easier to provide support for new sources. This will involve splitting the existing system into several new classes: ForecastData, HomeData, DataCollection, DataInfo, DataSlice, and Value.

Data Collector

This is the oldest part of the program and handles collecting data from the weather station and various other temperature sensors. It then processes this data and stores it both locally and in an external server. If the external server cannot be reached it will save it and upload all missed data when the connection is restored.

This program also sends several notifications including a Daily Summary, Rain Alerts, High Temperature Alerts, and a reminder to close windows when it is hotter inside then outside.

Also downloads map images from the MetOffice DataHub API and distributes them to several servers for clients to access.

API and Database

The API is written in PHP and supports a range of requests including downloading all available data, any data between two datetimes, the most recent data, and all data with a ceratin number of days or hours.

It also receives data from other devices such as the collector.

Additionally, it receives map images from the data collector and stores them for clients to later access.

Uses basic authentication to submit data.

History

November 27 2019 - Initial version created in Python using Tkinter.

April 27 2020 - Initial standalone collector created that ran 24/7 on a Raspberry Pi

May 14 2020 - Desktop viewer created using C#.

July 14 2020 - First iteration of a mobile app created with Dart and Flutter.

July 6 2022 - Iteration three of a mobile app created with Dart and Flutter.

July 29 2022 - Added support to run on Raspberry Pi display (via flutter-pi).

September 1 2022 - Add Windows support to Flutter application.

Jun 12 2023 - Added proper Linux support to Flutter Application.

July 5 2023 - Added Forecast Maps provided via MetOffice DataHub API.