Customising the BOM Weather and lovelace - now in HACS

Um… yeah… where did you find that? I actually use a custom component called average for this instead of the statistics one built into HA… Did you copy from my HA repo instead of the BOM card?

If you want you can use average but you need that custom component. I didn’t think I had any reference to that in the BOM repos…

I have been struggling for 2 weeks to get this card to work!!! Yesterday I found your repo and essentially tried copying it. It still didn’t work!
I came home this evening and my db was corrupted. Once I deleted it and restarted most of this is now working. That was the only error message I got.
I never thought I would be so happy to see a weather forecast. :rofl:

It that particular sensor is not needed for the BOM custom card I will remove it.
thanks for getting back to me.

You do need either the one created by average or the one created by the statistics sensor. What BOM does is once the forecast minimum or maximum for the day is reached, the min and max temperature get a status of N/A. So to ‘fix’ that, I use either the statistics or the custom average component to get the min/max for the day and then a template sets that for the card. So then if the temp is reported as N/A, it will instead use the high/low for the day. The reason I use the average component is that the statistics one will give max/min for say a 24hr period which means the high for today (or low) could in fact be the high/low of any time in the last 24 hours… maybe yesterday. The custom-average component lets you specify midnight as the start time so using that I always get the min/max for today. Not a big thing and in the BOM repos I maintain I just use statistics instead of average so people don’t have to use yet another custom component.

Hi @DavidFW1960

Thanks for helping me to get this working, and sorry about the slow reply … I have a 7 week old baby at home who is soaking up all my time :slight_smile:

You’re right, I’d forgotten to add the slots in the config as well as the entity_current_conditions, they’re added now and the card is working. I still have to enable dark sky to get those elements to show.

Thanks and what a great way to start the day… A weather card to remind me that it’s going to be 44 degrees today :slight_smile: :thinking:

1 Like

You should not need darksky for anything… The BOM FTP component and core BOM sensor provide all required sensors. You need to check which sensors are being parsed to the card and make sure they exist. Swap out darksky ones for the equivalent BOM ones…

FYI - your example for entity_current_text in the card repository uses a Dark Sky sensor

Thanks for pointing that out. It has been fixed. The template sensor was correct, just that one piece of text…

Thanks @DavidFW1960, Fixed the average.
I have one last issue, the summary icon doesn’t appear.

I’ve checked the sensor (I think) and if I’m looking at the right one, it says null, but all the icon sensors say null?

Check the sensors you are parsing through to the card are correct… maybe a typo. It looks like you did copy the icons otherwise the daily ones wouldn’t be showing.
Otherwise post card config…

Thanks David.
Got it working, looks like I didn’t have the most recent icons…
Once I downloaded them again, the little storm cloud appeared.
Thanks.

1 Like

Hi DavidFW1960 thanks for making this available in HACS.
Can anyone make heads or tails of these errors I’m getting after loading Bom forecast integration from HACS 0.21.5?
Im running Home Assistant 0.104.1 on a Pi4

2020-02-14 11:45:41 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform bom_forecast
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 158, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, 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 252, in setup_platform
    bom_forecast_data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/bom_forecast/sensor.py", line 486, in update
    ftp = ftplib.FTP('ftp.bom.gov.au')
  File "/usr/local/lib/python3.7/ftplib.py", line 117, in __init__
    self.connect(host)
  File "/usr/local/lib/python3.7/ftplib.py", line 155, in connect
    self.welcome = self.getresp()
  File "/usr/local/lib/python3.7/ftplib.py", line 236, in getresp
    resp = self.getmultiline()
  File "/usr/local/lib/python3.7/ftplib.py", line 222, in getmultiline
    line = self.getline()
  File "/usr/local/lib/python3.7/ftplib.py", line 210, in getline
    raise EOFError
EOFError
  - platform: template
    sensors:
      actron_temperature:
        friendly_name: "Actron Air Temp"
        unit_of_measurement: 'degrees'
        value_template: "{{ state_attr('climate.air_conditioner', 'current_temperature') }}"
  - platform: bom_forecast
    product_id: IDN11060
    name: Camden
    forecast_days: 6
    rest_of_today: true
    friendly: false
    friendly_state_format: '{max}, {summary}'
    monitored_conditions:
      - 'max'
      - 'min'
      - 'chance_of_rain'
      - 'possible_rainfall'
      - 'summary'
      - 'detailed_summary'
      - 'icon'
      - 'uv_alert'
      - 'fire_danger'      

Well that’s a bugger… it does not like the Camden station. I just ran it up in a VM… That sucks a bit huh…

I will see if it’s possible to fix it without breaking everything else.

Maybe try Katoomba IDN11109 or even just Sydney IDN10064
Not ideal I know but Camden might have a different data format in the xml file… anyway, checking…

Ok Great thanks David i will try that. Is it really that simple…

Error while setting up platform bom_forecast

2:15 PM custom_components/bom_forecast/sensor.py (ERROR)

You are using a custom integration for bom_forecast which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.

2:15 PM loader.py (WARNING)

I just tried the Sydney station and i have the same errors.
Is it possible theres a port issue Im running Pi-hole a DNS server add-on because of the actron Air add-on in HA.

I set up the VM with my station (Gosford) and it worked. Configured Camden and it errored like you posted. I didn’t try Sydney or Katoomba but pretty sure they are fine. I will try Sydney now… stand by…

Both Katoomba and Sydney stations are working correctly. It’s possible Pihole is blocking the FTP site…

Ok i read some where something about a white list
I do have a whitelist in pihole
Thanks for looking into this for me David
Ill do some reading around about pi-hole

Hi, apologies for asking such a basic question. I’m trying to set this up but there’s something, probably obvious, that I am just not understanding. Here’s my config:

Firstly the bom setup:

 # Weather observations from BoM
- platform: bom
  station: IDN60903.94926
  monitored_conditions:
    - apparent_t
    - cloud
    - gust_kmh
    - air_temp
    - local_date_time
    - press
    - rain_trace
    - rel_hum
    - vis_km
    - weather
    - wind_dir
    - wind_spd_kmh

- platform: bom_forecast
  product_id: IDN10035
  name: Canberra
  forecast_days: 3
  rest_of_today: True
  friendly: True
  friendly_state_format: '{min}, {max}, {summary}'
  monitored_conditions:
    - 'max'
    - 'min'
    - 'chance_of_rain'
    - 'possible_rainfall'
    - 'summary'
    - 'detailed_summary'
    - 'icon'
    - 'uv_alert'
    - 'fire_danger'

  # System monitor
- platform: systemmonitor
  resources:
    - type: disk_use_percent
      arg: /home
    - type: memory_free
    - type: processor_use
    - type: network_in
      arg: enp3s0
    - type: network_out
      arg: enp3s0
    - type: ipv4_address
      arg: enp3s0

Now the sensor templates:

 #Weather templates

    bom_current_text:
      value_template: >
        {% set val = states('sensor.bom_forecast_canberra_summary_0').split('.')[0] %} 
        {{ val | title }}

    bom_forecast_0:
      entity_id:
        - sensor.bom_today_max
        - sensor.bom_today_min
        - sensor.bom_canberra_chance_of_rain_0
        - sensor.bom_canberra_icon_0
      friendly_name: "Today"
      value_template: >
        {{states('sensor.bom_today_max')|round(0)}}°/{{states('sensor.bom_today_min')|round(0)}}°/{{states('sensor.bom_canberra_chance_of_rain_0')|round(0)}}%
      entity_picture_template: >-
        {%- if states('sun.sun') == 'below_horizon' and (states('sensor.bom_canberra_icon_0') == 'fog' or states('sensor.bom_canberra_icon_0') == 'haze' or states('sensor.bom_canberra_icon_0') == 'light-showers' or states('sensor.bom_canberra_icon_0') == 'partly-cloudy' or states('sensor.bom_canberra_icon_0') == 'showers') -%}
        {{ '/local/icons/bom_icons/' ~ states('sensor.bom_canberra_icon_0') ~ '-night.png' }}
        {%- else -%}
        {{ '/local/icons/bom_icons/' ~ states('sensor.bom_canberra_icon_0') ~ '.png' }}
        {%- endif -%}

This is what I see in Developer Tools:

I get unknowns in sensor.bom_forecast_0.

So I’m trying to figure out where sensor.bom_today_max comes come from? I don’t see it listed in Developer Tools, nor in the bom or bom_forecast platform configurations. Am I referencing the bom_forecast correctly?

I’m trying to setup a basic card with icons and summaries like that shown on the github page. BOM Forecast was installed by HACS and I’m trying to follow the code in the weather.yaml file.

Thanks for reading and for any pointers you may be able to offer.

You seem to have duplicated the bom_forcast component somewhere… Have you configured it in config yaml as well as a package? sensor.bom_forecast_0 and sensor.bom_forecast_canberra_0 are both from seperate integrations of the BOM ftp component.

Not that I can see. I’ve checked sensor.yaml and configuration.yaml. I do have weather platforms though. Are the BoM components (weather: & sensor:) incompatible with each other?

Also, where would I check for a duplicate entry in a package?

In configuration.yaml:

weather:
  - platform: bom
    name: "BoM Weather"
    station: IDN60903.94926

  - platform: darksky
    name: "Dark Sky"
    api_key: !secret darksky_key
    mode: daily

#BoM Radar
camera:
  - platform: bom
    name: "Canberra Radar"
    location: Canberra