Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:48 03 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Use of JSON for BoM (Aus.) Weather AND Forecast

Author Message
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 10:33pm 09 Feb 2023
Copy link to clipboard 
Print this post

Hi,
I'm getting back into MMBasic after a short break.
I'm spurred on by Peter's work on the Pico-W and am about to make the leap from a Pico with an ESP8266, to the Pico-W.
I had been using Openweather for weather but hadn't really succeeded with its forecasts (any help/clues would be welcome).

Do any of you access the Australian Bureau of Meteorology (BoM) for JSON data for 'weather' and 'forecasts', if so how? and; is it any better than Openweather?

Cheers,

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:32am 10 Feb 2023
Copy link to clipboard 
Print this post

Somewhere on the BOM website I saw information about setting up a feed. That was many years ago but I reckon the feature is still available.

Jim
VK7JH
MMedit
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 03:59am 10 Feb 2023
Copy link to clipboard 
Print this post

Thanks Jim.
I saw it too but couldn't make any sense of it.
I'm hoping someone has done it already . . .?
If not I'll find it again and try harder. The Pico-W will make it easier because my use of ESP8266 was a bit hit and miss.

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 04:31am 10 Feb 2023
Copy link to clipboard 
Print this post

It looks like the BOM data is only retrieved by ftp

When you do get it, the format is xml which is very similar to json but not quite the same.
Here is a snipit of the Victorian observations.
<observations>
   <station wmo-id="95936" bom-id="086338" tz="Australia/Melbourne" stn-name="MELBOURNE (OLYMPIC PARK)" stn-height="7.53" type="AWS" lat="-37.8255" lon="144.9816" forecast-district-id="VIC_PW007" description="Melbourne (Olympic Park)">
     <period index="0" time-utc="2023-02-10T04:20:00+00:00" time-local="2023-02-10T15:20:00+11:00" wind-src="OMD">
       <level index="0" type="surface">
         <element units="Celsius" type="apparent_temp">22.3</element>
         <element units="Celsius" type="delta_t">5.1</element>
         <element units="km/h" type="gust_kmh">24</element>
         <element units="knots" type="wind_gust_spd">13</element>
         <element units="Celsius" type="air_temperature">24.1</element>
         <element units="Celsius" type="dew_point">15.6</element>
         <element units="hPa" type="pres">1004.0</element>
         <element units="hPa" type="msl_pres">1004.0</element>
         <element units="hPa" type="qnh_pres">1004.9</element>
         <element units="%" type="rel-humidity">59</element>
         <element units="km" type="vis_km">40</element>
         <element type="wind_dir">SSW</element>
         <element units="deg" type="wind_dir_deg">207</element>
         <element units="km/h" type="wind_spd_kmh">19</element>
         <element units="knots" type="wind_spd">10</element>
         <element start-time-local="2023-02-10T09:00:00+11:00" end-time-local="2023-02-10T15:22:00+11:00" duration="382" start-time-utc="2023-02-09T22:00:00+00:00" end-time-utc="2023-02-10T04:22:00+00:00" units="mm" type="rainfall">0.0</element>
         <element start-time-local="2023-02-09T09:00:00+11:00" end-time-local="2023-02-10T09:00:00+11:00" duration="1440" start-time-utc="2023-02-08T22:00:00+00:00" end-time-utc="2023-02-09T22:00:00+00:00" units="mm" type="rainfall_24hr">0.0</element>
         <element start-time-local="2023-02-10T06:00:00+11:00" end-time-local="2023-02-10T21:00:00+11:00" start-time-utc="2023-02-09T19:00:00+00:00" end-time-utc="2023-02-10T10:00:00+00:00" units="Celsius" type="maximum_air_temperature" instance="running" time-utc="2023-02-10T03:42:00+00:00" time-local="2023-02-10T14:42:00+11:00">25.0</element>
         <element start-time-local="2023-02-09T18:00:00+11:00" end-time-local="2023-02-10T09:00:00+11:00" start-time-utc="2023-02-09T07:00:00+00:00" end-time-utc="2023-02-09T22:00:00+00:00" units="Celsius" type="minimum_air_temperature" instance="running" time-utc="2023-02-09T17:21:00+00:00" time-local="2023-02-10T04:21:00+11:00">16.2</element>
         <element start-time-local="2023-02-10T00:00:00+11:00" end-time-local="2023-02-11T00:00:00+11:00" start-time-utc="2023-02-09T13:00:00+00:00" end-time-utc="2023-02-10T13:00:00+00:00" units="knots" type="maximum_gust_spd" instance="running" time-utc="2023-02-10T04:08:00+00:00" time-local="2023-02-10T15:08:00+11:00">14</element>
         <element start-time-local="2023-02-10T00:00:00+11:00" end-time-local="2023-02-11T00:00:00+11:00" start-time-utc="2023-02-09T13:00:00+00:00" end-time-utc="2023-02-10T13:00:00+00:00" units="km/h" type="maximum_gust_kmh" instance="running" time-utc="2023-02-10T04:08:00+00:00" time-local="2023-02-10T15:08:00+11:00">26</element>
         <element start-time-local="2023-02-10T00:00:00+11:00" end-time-local="2023-02-11T00:00:00+11:00" start-time-utc="2023-02-09T13:00:00+00:00" end-time-utc="2023-02-10T13:00:00+00:00" type="maximum_gust_dir" instance="running" time-utc="2023-02-10T04:08:00+00:00" time-local="2023-02-10T15:08:00+11:00">SSW</element>
       </level>
     </period>
   </station>


The VIC file is 300k long so you will need a lot of elbow room.

I will look further when time permits.
VK7JH
MMedit
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 06:18am 10 Feb 2023
Copy link to clipboard 
Print this post

Jim,
Don't put yourself out (too far) but any help is appreciated.
How did you get the observations?

I guess I could use INSTR to read the values for the key fields.
The data is the same as on the BoM website for Victorian observations so I can check I'm getting the right fields and data.

(I have seen reference to JSON on the site so I'll go looking.)
(We've been in a hotel for 10 months and they are upgrading their network this WEEK! so WiFi keeps dropping out - it has never been any good.

Cheers,

Andrew
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 06:28am 10 Feb 2023
Copy link to clipboard 
Print this post

Jim,
I Googled "BoM JSON" and amongst many links found this. It look very useful.

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:38am 10 Feb 2023
Copy link to clipboard 
Print this post

Your link does work but it is https. I am not sure if http would work.

Jim
VK7JH
MMedit
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 07:29am 10 Feb 2023
Copy link to clipboard 
Print this post

OK Jim how about this one?

(This one is for Viewbank which is OK for me)


Andrew
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025