RusQTTbom
RusQTTbom collects weather data from the Bureau of Meterology (BOM) then publishes said data locally via MQTT messages. BOM weather data is only for Australian locations. This weather data is obtained via an undocumented API, which was seemingly discovered, or at least popularised, thanks to this Github repo - and this one. Because this is an undocumented API, it could be turned off at any time. BOM weather data is generally accepted as being the most accurate weather data in Australia.
The main idea with this program is to collect the BOM weather data via the API, parse the data, check for null or erroneous entries, then publish the wanted data in a local network via MQTT messages. This way, we can have many programs do things with the MQTT data in a de-coupled manner. For example, we can setup alerts and notifications. We can use various home automations. We can also write the data to a database. By using an MQTT message bus, we can loosely couple all of these services, which provides desired reliability in our system. In essense, RusQTTbom becomes a local weather sensor providing BOM weather data.
The BOM weather data API is used in this BOM weather site. Go to this website then enter your suburb / location in the search bar then click on the correct result. Take a note of the seven digit geohash in the URL in the address bar of your browser. This will be used to get data for your location and you need to add this to your config.toml
file.
Weather data that is published by RusQTTbom via MQTT consists of the following values, by the MQTT topics:
- outside/weather/current-temp
- outside/weather/temp-feels
- outside/weather/min-temp
- outside/weather/max-temp
- outside/weather/humidity
- outside/weather/rain-today
- outside/weather/wind-kms
- outside/weather/wind-dir
- outside/weather/gusts-kms
- outside/weather/max-gust
All of the above MQTT topic names are user configurable (via the config.toml
file). Other user configuration options consist of the following:
- Location name
- Location geohash
- MQTT broker IP address
- MQTT broker port
- Minimum valid temperature
- Maximum valid temperature
- Minimum valid wind speed
- Maximum valid wind speed
- Minimum valid humidity
- Maximum valid humidity
- Minimum valid rainfall
- Maximum valid rainfall
The data validation settings are to catch erroneous entries such as -99 or 999 and the like. RusQTTbom publishes the weather data asyncronously, which is totally unnecessary but it does. The RusQTTbom MQTT client name is 'rusqttbom'
RusQTTbom expects the config.toml
file to be saved under the users home directory in /.config/rusqttbom/config.toml
. The program will not create the directory or move the config file there. A user needs to do this, however it only needs to be done once. This works MacOS and it should work on other OSs too. Let me know if there are issues.
Issues can be viewed here, and the development plan can be found at the Project.
To use this program in its current state, the repo can be forked and cloned, configuration file edited and saved in the appropriate directory (as explained), then use cargo build --release
. The binary itself, called rusqttbom
, can be located at rusqttbom/target/release
. The binary itself can be copied or moved anywhere else in your file system and can run by itself. Just remember the config.toml
file. For best use of this program, be sure to set a cron job to run the binary every 10mins. Here is an example cron job that will run this program every 10mins.
crontab -e
*/10 * * * * /full/file/path/to/binary/rusqttbom
Once you get the data flowing into your environment via MQTT (via the cron jobs), you can setup automations, notifications, alerts, graph the data and / or save it to a database for longer term storage and analysis.
Important!: Do not hit this API more than once every ten minutes. Not abusing this API should help keep it from being shut down or modified. The API seems to only be updated every 10mins at a minimum so keeping your calls to a minimum makes sense.
Be sure to star this repo to watch the progress if this interests you!