Australian Bureau of Meteorology integration with OpenHAB

Hi Nick,

I have fixed this. Your weather station does not have atmospheric pressure data and the code was not handling the exception correctly. Also there seems to be very limited forecast data for the area you chose. I will confirm this comparing with BOM site later today.

Please uninstall and then reinstall. You might have to remove and re-add your thing, and possibly restart.

Regards,
Tom

Hi Nick,

I think you want to use ftp://ftp.bom.gov.au/anon/gen/fwo/IDN11060.xml for the forecast instead. You will get 8 days of forecasts but there is one slight problem I see. You will not get the forecast texts as they are in IDN10064. I will have to work out how the XML is referenced.

Regards,
Tom

Ahh I see, when I saw the limited data, I assumed it derived it from the parent-aac but looking at the normal bom website, at the bottom is says : Product derived from IDN11060 and IDN10064

Good observation. Looks like you do actually need both for a complete forecast. I have modified the code to derive from both.

If you reinstall the binding now you will notice the configuration screen has changed. You will need to enter both precis forecast product ID and city/town forecast product ID.

See screenshot below for what you need to enter for Terrey Hills.

Thanks! Looks good, will let you know if anything else crops up. Pity you cannot easily see the Area ID on the BOM website as you can pull the other values from it and saves jumping into the various xml. I assume they must have some table that links your area to the closest station (and all it’s various ID’s and files)?

Really great work on this @tomitan. Thank you for your efforts

The binding works quite well and I look forward to creating a nice habpanel for the data.

I did want to bring to your attention a number of WARNings I experienced in the logs (a snippet is below):

11:41:09.077 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#dewPoint although the handler was already disposed.
11:41:09.079 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#relativeHumidity although the handler was already disposed.
11:41:09.081 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#pressure although the handler was already disposed.
11:41:09.082 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#windDirection although the handler was already disposed.
11:41:09.084 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#windDirectionDegrees although the handler was already disposed.
11:41:09.085 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#windSpeedKmh although the handler was already disposed.
11:41:09.087 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#windSpeedKnots although the handler was already disposed.
11:41:09.088 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler of thing bom:weather:884f09fe tried updating channel day1#rainfall although the handler was already disposed.
11:41:09.089 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler BomHandler tried updating the thing status although the handler was already disposed.

This did not occur initially and only occurred after I had started to add items (by text file). A search of the forums produced the link below. I admit I did disable/enable the binding several times within a few minutes via Paper UI which may have caused the issue.
https://community.openhab.org/t/handler-disposed/49168/13

Not sure if that helps any.

Just wanted to say thanks again for taking the time to produce something like this. It is really appreciated.

Probably worth pasting your item file contents…

Yes they would have some mapping tables/files. Probably not available to the public. I couldn’t find anything in the product catalog but if you do find something let me know.

You’re welcome. I’ll do some investigation on that issue.

Hi Lucas,

I noticed this during re-installation of the binding. But after a couple of instances the issue went away.

In any case, I have read the thread you pasted and modified the code according to the people’s recommendation as a precaution. The side-effect of this is that now it takes a little bit longer for the binding to be “online” initially.

Let me know if you still get the error in the log.

This is my closest station.
I’m guessing the two IDs at the top of the page are the weather station ID & the observation product ID?
How would I work out the other IDs to use?

See the readme here: https://github.com/tomitan100/org.openhab.binding.bom

Hi Josh,

Not quite. So based on my instruction here you want:

Observation product ID = IDS60920
Weather station ID = 94683
Precis forecast product ID = IDS10044
City/town forecast product ID = IDS11041
Area ID = SA_PT028

The forecast data for your area (Kuitpo) is a bit tricky to find. It actually falls under “District Forecast” products, which was not documented in my instruction. You are near Mt Barker/Mt Lofty Ranges, so I chose that as the area ID. If this is incorrect please find the correct one.

Let me know if you have any issue.

Hi Tom,
Thanks for your work on this, I’m in Adelaide.
I’ve tried to install the binding but the thing doesn’t seem to come online.
image
Screen shot of my parameters below;


The following was in my log file;

Hi Gus,

I tried your config and it’s working fine for me. What version of openHAB are you using?

Hi CL,

You should probably read openHAB documentation on how to configure openHAB. But to get you started, once you have added the BOM binding in PaperUI:

  1. Go to Configuration -> Things -> BOM.
  2. Click on the blue round checkbox next to Air Temperature under Today’s Forecast.
  3. A popup should appear. Under Please select the item to link, choose Create new item.
  4. Leave everything as default. Note the ID of the field under Name (BOM_Day1_AirTemperature).
  5. Click Link.
  6. You can repeat the above steps if you want to show other fields.
  7. Go to Control panel.
  8. You should now see the field you added under BOM panel. The value may take a while to update.
  9. Now go to HABPANEL UI. This is available on the main index page.
  10. Hit the cogwheel on the top right to edit panel.
  11. Add new dashboard.
  12. Type a name for the panel.
  13. Click on newly created panel.
  14. Click on Add Widget and select Dummy.
  15. Click on New Widget options (three vertical dots) and select Edit.
  16. Next to openHAB Item, find BOM_Day1_AirTemperature.
  17. Click Save in the modal.
  18. Hit Save then Run on the top left and you be able to see the temperature displayed. If not, hit refresh on your browser.

That’s the basics. If you want to use custom template similar to the one I use, please check out Matrix Theme for HABPanel. If you are interested in a template I created let me know and I will attach here once I am done. It is still work in progress.

I have attached the full items mapping if you prefer to use instead of manually creating and linking each channel. You will need to name your BOM Thing ID as “default” to use.

https://github.com/tomitan100/org.openhab.binding.bom/raw/master/doc/bom.items

Perfect thanks Tom…I updated my openHAB and now it’s working! Thanks a lot for the reply and the BOM binding.
Cheers Gus

@tomitan Awesome job on the binding, thanks. light_smile:

Not sure if anyone else is seeing this but the Max Temp seems to change dramatically as the files are being processed:

2019-03-02 10:05:24.942 [INFO ] [nhab.binding.bom.internal.BomHandler] - Processing precis forecast from FTP path: ftp://ftp.bom.gov.au/anon/gen/fwo/IDW14199.xml, area ID: WA_PT053
2019-03-02 10:05:24.950 [vent.ItemStateChangedEvent] - BOM_Day1_MaximumTemperature changed from 20.1 to 20.8
2019-03-02 10:05:26.509 [vent.ItemStateChangedEvent] - BOM_Day1_MaximumTemperature changed from 20.8 to 26.0
2019-03-02 10:05:26.524 [INFO ] [nhab.binding.bom.internal.BomHandler] - Successfully processed precis forecast data.
2019-03-02 10:05:26.525 [INFO ] [nhab.binding.bom.internal.BomHandler] - Processing city/town forecast from FTP path: ftp://ftp.bom.gov.au/anon/gen/fwo/IDW12300.xml, area ID: WA_PT053
2019-03-02 10:05:27.635 [INFO ] [nhab.binding.bom.internal.BomHandler] - Successfully processed city/down forecast data.
2019-03-02 10:20:26.502 [vent.ItemStateChangedEvent] - BOM_Day1_MaximumTemperature changed from 26.0 to 21.6
2019-03-02 10:35:28.035 [vent.ItemStateChangedEvent] - BOM_Day1_MaximumTemperature changed from 21.6 to 22.5
2019-03-02 10:35:28.035 [INFO ] [nhab.binding.bom.internal.BomHandler] - Processing precis forecast from FTP path: ftp://ftp.bom.gov.au/anon/gen/fwo/IDW14199.xml, area ID: WA_PT053
2019-03-02 10:35:29.850 [vent.ItemStateChangedEvent] - BOM_Day1_MaximumTemperature changed from 22.5 to 26.0
2019-03-02 10:35:29.855 [INFO ] [nhab.binding.bom.internal.BomHandler] - Successfully processed precis forecast data.
2019-03-02 10:35:29.856 [INFO ] [nhab.binding.bom.internal.BomHandler] - Processing city/town forecast from FTP path: ftp://ftp.bom.gov.au/anon/gen/fwo/IDW12300.xml, area ID: WA_PT053
2019-03-02 10:35:30.970 [INFO ] [nhab.binding.bom.internal.BomHandler] - Successfully processed city/down forecast data.

Yep, I see this myself in the morning. Then it settles down afterwards. Looks like it affects only “Day1” (today). I’ll get to the bottom of it.

Hi Andrew,

Should be fixed now if you reinstall the binding. The code was updating min and max temperatures from observation XML for Day1, which is incorrect as those are not forecast temperatures but historical temperatures.

Regards,
Tom