Has anyone been able to successfully implement BOM sensors?

Hi,

I have spent all day trying to build this: https://github.com/DavidFW1960/bom_forecast

They talk about Core BOM Sensor Configuration, which I’m guessing is this: https://home-assistant-china.github.io/components/sensor.bom/

I had the BOM entities which I could pull into a card as a list.
I added the following code to my sensors.yaml from https://home-assistant-china.github.io/components/sensor.bom/ to achieve this:

- platform: bom
    station: IDS60801.94675
    name: Adelaide
    monitored_conditions:
      - apparent_t
      - cloud
      - cloud_base_m
      - cloud_oktas
      - cloud_type_id
      - cloud_type
      - delta_t
      - gust_kmh
      - gust_kt
      - air_temp
      - dewpt
      - press
      - press_qnh
      - press_msl
      - press_tend
      - rain_trace
      - rel_hum
      - sea_state
      - swell_dir_worded
      - swell_height
      - swell_period
      - vis_km
      - weather
      - wind_dir
      - wind_spd_kmh
      - wind_spd_kt

I wanted to create a custom card. Per the first Github link, I added the weather.yaml file into content/packages, and merged the content above into it as the weather.yaml had less monitored conditions. I also added to configuration.yaml - weather: !include_dir_list /content/packages.

Now I get nothing. The automation within weather.yaml appears as an entity but none of the BOM sensors. I then added the core BOM sensors into sensors.yaml and they turned up again…

What gives? Can someone guide me through this shamble? Seems like some serious bugs going on in this system.

Thanks for any assistance!

I can confirm that when they are removed from sensors.yaml, they disappear, and when they’re added back in they appear again. No idea why the exact same sensor code in weather.yaml fails to load…

The indentation in your code is wrong. “station”, “name” and monitored conditions need to start at the same level, like this:

- platform: bom
  station: IDS60801.94675
  name: Adelaide
  monitored_conditions:
    - apparent_t
    - cloud
    - ....

If you copied the weather.yaml from the Github link into /content/packages, then you need to add this entry in configuration.yaml
packages: !include_dir_named content/packages
and remove the weather: !include_dir_list /content/packages from configuration.yaml, as this is then already defined inside the package. I suggest reading up on splitting your config here and about packages here.

I don’t thinks anything you observed is a bug, just wrong configuration.

Thanks Burningstone, I added packages: !include_dir_named config/packages

but now I’m getting this log error: Component error: packages - Integration ‘packages’ not found.

I confirm that config/packages does exist and it has the weather.yaml file in there. I was a bit confused when you said that weather.yaml is already definied inside the package? Do you mean that when I call the packages folder, all yaml files are automatically active?

Any thoughts on why I’m getting the integration component error?

Also, I realised I had already fixed up the indentation problem.

Thanks heaps!

Sorry, I forgot to say that this:

packages: !include_dir_named packages

needs to be inside the homeassistant: block like this:

homeassistant:
  packages: !include_dir_named packages

Then you packages folder needs to be inside the same folder as your configuration.yaml and inside the packages folder you have the weather.yaml file.

I didn’t say the weather.yaml is already defined, I said weather is already defined. The package you got from the github link, includes a block weather: ...., so it already defines the weather, that’s why you need to remove weather: from your configuration.yaml. Read the two links I provided in the previous post, they should make things clearer.

Thanks a lot! That linked the packages folder up.

The card now pulls in the dates for the next five days but next to them I get unknown°/unknown°/unknown%.

Not sure if it’s the settings I’ve used within weather.yaml?

For the observation sensor, I used Brisbane Observation: http://www.bom.gov.au/products/IDQ60901/IDQ60901.94576.shtml and set station: IDQ60901.94576.

For Brisbane forecast, I used: http://www.bom.gov.au/qld/forecasts/brisbane.shtml and set Product ID: IDQ10095.

I then renamed all the sensors to replace ‘Gosford’ with ‘Brisbane’.

Is something in that causing the above result?

I had a quick skim through the links but plan to delve into them deeper.

Thanks!

I also completed removed the Product ID which defaults to the nearest city. This didn’t help so it’s not that which is causing the issue.

And thank you for clarifying that the package defines weather. From what I understand the title of each yaml in packages becomes the blod when using include_dir_named. So weather.yaml is defined as the code block weather for instance.

I don’t use BOM forecast, I think @DavidFW1960, the author of the content from the Github link will be the best person to help you here.

No that’s not correct.

packages: !include_dir_named packages

tells home assistant that it finds the packages inside the folder packages and each package is an individual file. The weather.yaml file is one of these individual files. The name doesn’t matter, it could also be named e.g. awesome_bom_weather_forecast.yaml. However inside the weather.yaml file is a section that starts with weather: this defines the weather code block.

The advantage of all this is to keep configuration for the same thing together and also your configuration.yaml doesn’t grow to a huge file. For example a package for your living room, where you have a switch: section, a remote: section and an input_select: section.

However it’s up to you on how you want to structure your configuration.

Thanks for all your help, think I probably picked a harder plugin for my first go lol.

One thing I’m not understanding, you mentioned the weather.yaml package having a weather: block, but I can’t see it in any of the code. That’s where I assumed it must have come from the title.

Thanks again!

Ok, now I’m confused. I thought I saw it somewhere. I’ll take it back, however it still applies that weather.yaml doesn’t define the weather block code. This means you should be able to have weather: in addition to this package.

Your not alone.
I have same issue
All the bom_forecast_x
return unknown
When I look at the states page for BOM
none of those sensors in template exist
Current text doesn’t exist either.
I didn’t install it as a package just pasted it in my sensors.yaml file
Change Gosford to Sydney and still doesn’t work for me.
@DavidFW1960

Edit: I think I just found my issue
I have
weather: in my configuration.yaml for BOM
As well without any info or monitored conditions.
It’s been there since day dot.

The BOM SENSOR does not use weather: it is a sensor.
If you guys are having an issue, please log an issue in my repo.
If the BOM forecast is not giving a valid status, check the product ID - the repo gives instructions on how to get the product ID.
Someone on the weekend also had an issue with the forecast component and it turned out that HACS wasn’t pulling the component correctly so he manually downloaded everything and it started working.

Anyway, this component DOES work -many people are using it. If you can’t get it working, log an issue and I will help you.