Australian Weather Forecast using BOM Public FTP

Manifest is what worked for me

and for the record, just upgraded from 91.4 to 92.2, with just an empty __init__.py file - no errors, all works.

I firstly tried with just an empty __init__.py but HA still complained, created the manifest.json and then it was happy and working nicely. It seems odd that people are having differing results for the same custom_component

Could someone help me with which IDV value i should be using for Frankston.

When i look the forecast up it seems to have two IDV values but neither of these match Frankston

http://www.bom.gov.au/vic/forecasts/frankston.shtml

How good are your python skills?
I’m in the same boat. The info is on the BOM FTP site, but not at a dedicated Product ID (eg. IDV10450).

The Frankston forecast is in ftp://ftp.bom.gov.au/anon/gen/fwo/IDV10753.xml
But you’d need an extra layer of detail to pull out it’s forecast data, while ignoring all the other towns/areas.
For example:
product_id: IDV10753
aac: VIC_PT023

It’s beyond me.

Yeah my python skills are non-exisit, and i wouldnt have the time or the will to learn at this point

Then your closest is IDV10450, City Forecast - Melbourne (VIC).

Hi, I have saved the bom_forecast.py into /hass_config/custom_components/sensor directory. /hass_config is where my configuration.yaml is located.

Then I edited the configuration.yaml as per indicated. But when i start home assistant, it says:

"Integration bom_forecast not found when trying to verify its sensor platform"

I know I am missing something here. Help appreciated.Thanks

Rename the directory to custom_components/bom_forecast. Rename the bom_forecast.py file to sensor.py

This has been required since 0.91 https://www.home-assistant.io/blog/2019/04/03/release-91/#notable-breaking-change

Hi Tom, I have just tried. it is throwing the same error. Any ideas?

The log says:
Integration bom_forecast not found when trying to verify its sensor platform.
9:55 PM components/homeassistant/init.py (ERROR)

add a empty __init__.py to the same directory.

thats a double underscore before and after init

And if that doesn’t fix it, add a manifest file as per these instructions:

Thanks. I have now done this. Doesn’t work. Still the same error.

Thanks. Have now done this too. If I run the check config button, it says:
Configuration invalidCHECK CONFIG

Invalid config for [sensor.bom_forecast]: Malformed Product ID for dictionary value @ data[‘product_id’]. Got ‘IDW60901.94608’. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.bom_forecast/

Your product id should be: IDW60901 not IDW60901.94608

Thanks mate. That does it. No more errors!

But when i add a sensor card in Lovelace, I am not seeing any relevant sensor associated with the weather forecast. Am I expected to see ‘max’, ‘min’, ‘chance of rain’ etc?

Edit: it turns out there are other errors.

Sun May 12 2019 00:16:40 GMT+0800 (Australian Western Standard Time)
Error while setting up platform bom_forecast
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/bom_forecast/sensor.py", line 241, in setup_platform
    bom_forecast_data.update()
  File "/usr/src/app/homeassistant/util/__init__.py", line 224, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/bom_forecast/sensor.py", line 421, in update
    ftp.retrbinary('RETR ' + self._product_id + '.xml', file_obj.write)
  File "/usr/local/lib/python3.7/ftplib.py", line 442, in retrbinary
    with self.transfercmd(cmd, rest) as conn:
  File "/usr/local/lib/python3.7/ftplib.py", line 399, in transfercmd
    return self.ntransfercmd(cmd, rest)[0]
  File "/usr/local/lib/python3.7/ftplib.py", line 365, in ntransfercmd
    resp = self.sendcmd(cmd)
  File "/usr/local/lib/python3.7/ftplib.py", line 273, in sendcmd
    return self.getresp()
  File "/usr/local/lib/python3.7/ftplib.py", line 246, in getresp
    raise error_perm(resp)
ftplib.error_perm: 550 Failed to open file.

edit 2: I am using home assistant 0.92.1 in a docker in ubuntu if that makes a difference?

Anyone any ideas? Thanks much.

I am getting these as well
 anyone know why the forecast is not included in the official bom package?

I had a look through the BoM FTP server. The product id you want for the Perth forecast is: IDW12300.

IDW60901 is the latest Perth observations.

1 Like

You are a legend Tom. I edited the product ID and restart home assistant, now everything is working. no errors. and I can see the daily forecast.

1 Like

Awesome, thanks for posting these instructions, worked like a charm!

I’ve created a pull request on this repo to contain your instructions, as no doubt more people will run into this too. :slight_smile:

1 Like