Plug In for Government Weather Feeds

Says it all, .BOM has a excellent feed for Australia complete with Radar.
Most if not all other Government Agencies would have similar.
Has anyone a solution ?

I know at least one user has made a SiteSensor recipe for the Swedish weather bureau’s feed. I use it as one of my standard test cases. It would not be difficult to keep a library of pasteable configurations.

1 Like

^^^
That’s great if you have programming skills, many users here don’t and rely on knowledgeable persons (like yourself) to cobble something together.
In the case of site sensor, I wouldn’t even know where to start.

I just deployed a “Recipes” feature to the SiteSensor stable branch version on Github. It lets you load someone’s prepackaged SiteSensor solution. You can also package solutions you create.

I’d be happy to look at the AUS feed for you.

That’s a very generous offer, there is a HASS Integration which I can’t get working (that shows you my level of expertise) could this help?

BOM - HASS Integration

I looked at the BoM site. The Hass implementation clouds the issue (no pun intended), as I’d have to reverse engineer their code and probably end up just having to look at the BoM specs for the output anyway. But…

No good for SiteSensor… the API response is XML. Alas, no XML handling in SiteSensor.

Edit: Hold up… they’ve got something JSON… looking…

Maybe this might be something for the HASS Plug In?

Can you PM me you lat/lon?

Done :slight_smile:

Hi,

You can get the observation json data with an URL like http://www.bom.gov.au/fwo/IDQ60801/IDQ60801.94566.json.

Where the IDQ60801 and 94566 values indicate the weather station. To find those go to http://www.bom.gov.au/index.php, select you province at the right top, then under observations, XXX Latest observations. Search for the station you want to use and click that for these two identifiers. You can also scroll down and get the json link.

Cheers Rene

We’re working on exactly that in private chat. We’ll publish the solution when @zedrally gets it working on his end.

I tried with Finnish Meteorology Institute (FMI) data, works ok.

Here is the recipe:

  1. Go to Havaintoasemat - Ilmatieteen laitos and select your weather station. Copy FMISID number.

  2. Form url by https://ilmatieteenlaitos.fi/observation-data?station=XXXXXX where XXXXXX is the FMISID. When accessing the URL following data is available in JSON:

status
stationId
generated
latestObservationTime
timeZoneId
Precipitation1h	[…]
WindDirection	[…]
t2m	[…]
SnowDepth	[…]
Humidity	[…]
DewPoint	[…]
WindSpeedMS	[…]
Visibility	[…]
WindGust	[…]
Pressure	[…]
TotalCloudCover	[…]
SnowDepth06	[…]
MinimumTemperature	[…]
rrday	[…]
MaximumTemperature	[…]

Note that the ones with […] are arrays. t2m is temperature and rrday is amount of precipitation

  1. Set the url in SiteSensor and get your selection of data from response. For example latest values:
last(response.t2m).[2]
last(response.SnowDepth).[2]
last(response.Humidity).[2]
last(response.DewPoint).[2]
last(response.WindSpeedMS).[2]
last(response.Visibility).[2]
last(response.WindGust).[2]
last(response.Pressure).[2]
1 Like

My FMI SiteSensor failed and reason was tracked to too long response:

SiteSensor: WARNING: Response was truncated to limit of 65536 bytes; 186148 total bytes received in “/tmp/Q_SiteSensor_160.txt”

SiteSensor release notes warn about too long response and possibility to crash your Vera. @rigpapa:Which size is still safe to use (I am using Edge)?

I would try to use a query that uses a smaller response, if there is one. This is the best approach, hands down.

If that’s not possible, you can set the MaxResponseSize parameter up a little higher than the actual response length.

Unfortunately it seems there is no possibility to shorten the response. JSON from FMI is also somehow “not supported”, they provide their open data nowadays in XML instead.
Anyway, good to know the limitations. This is not in any way critical to my system, I’ll just delete the sensor for now to get rid off tripped messages.

Not sure what is happening here but until now SS was working perfectly as per Patricks original Recipe, something has changed today and the feed is not working…
Vera now can’t find the device, log as follows.

10:08:13: SiteSensor: Requesting JSON data
10:08:13: SiteSensor: "GET" "http://reg.bom.gov.au/fwo/IDV60901/IDV60901.94870.json", headers={  }
10:08:13: SiteSensor: WARNING: Response was truncated to limit of 65536 bytes; 136380 total bytes received in "/tmp/Q_SiteSensor_625.txt"
10:08:13: SiteSensor: WARNING: the response from this site is quite large! (65536 bytes)
10:08:13: SiteSensor: Unable to decode JSON response, "unterminated string at line 2789, column 5" (dev 625)

edit: Might be good time for a HASS PI.

Just set MaxResponseSize to 150000 or so and you should be good. I think I’ve already mentioned this recently in thread.

I think that may have been in the Site Sensor discussion., I didn’t follow it as at the time the feed was still working Thanks for the prompt on publishing the recipe, I totally overlooked it so here it is for anyone else who might be interested in Australian Weather.
This one is based on readings from Moorabbin Airport, for other areas refer to the BOM Weather site and substitute IDV60901/IDV60901.94870.json for the area you need.

"name": "BOM Weather Sensor",
"author": "Black Cat",
"description": "Australian BoM Weather feed.
 http://www.bom.gov.au/index.php" for your area feed,
"config": {
    "RequestURL": "http://reg.bom.gov.au/fwo/IDV60901/IDV60901.94870.json",
    "Interval": "600",
    "Timeout": "30",
    "QueryArmed": "0",
    "ResponseType": "json",
    "Trigger": "err",
    "NumExp": "16",
    "FailMasterOnExpressionError": "1",
    "FailChildOnExpressionError": "1",
    "BlankChildOnExpressionError": "0",
    "MaxResponseSize": "150000",
    "Expr1": "response.observations.header[1].refresh_message",
    "Child1": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr2": "response.observations.data[1].air_temp",
    "Child2": "urn:schemas-micasaverde-com:device:TemperatureSensor:1",
    "Expr3": "response.observations.data[1].dewpt",
    "Child3": "urn:schemas-micasaverde-com:device:HumiditySensor:1",
    "Expr4": "response.observations.data[1].press",
    "Child4": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr5": "response.observations.data[1].rel_hum",
    "Child5": "urn:schemas-micasaverde-com:device:HumiditySensor:1",
    "Expr6": "response.observations.data[1].wind_spd_kt",
    "Child6": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr7": "response.observations.data[1].wind_dir",
    "Child7": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr8": "response.observations.data[1].gust_kt",
    "Child8": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr9": "response.observations.data[1].apparent_t",
    "Child9": "urn:schemas-micasaverde-com:device:TemperatureSensor:1",
    "Expr10": "response.observations.data[1].cloud",
    "Child10": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr11": "response.observations.data[1].cloud_oktas",
    "Child11": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr12": "response.observations.data[1].cloud_base_m",
    "Child12": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr13": "response.observations.data[1].cloud_type",
    "Child13": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr14": "response.observations.data[1].weather",
    "Child14": "urn:schemas-micasaverde-com:device:GenericSensor:1",
    "Expr15": "response.observations.data[1].press_msl",
    "Child15": "urn:schemas-micasaverde-com:device:GenericSensor:1"
},
"source": "20095",
"version": "20101.0354"

It’s about two posts above yours in this thread, but we soldier on…

Actually, this isn’t the intended way to publish a recipe. There’s a base64 block shown underneath this presentation that’s the intended portable format. This isn’t loadable as posted, which is why I made the base-64 block–it’s immune to forum formatting and many subtle errors in copy-paste. Can you grab that block and post it for us?

What presentation? I have no idea of what you’re talking about.
Please feel free to edit as you want.