Configure BOM Australia component for Home Assistant

Last modified date

Comments: 10

I live in Melbourne in Australia and have installed the Bureau of Meteorology (BOM) Australia component on my Home Assistant server to present the local weather. I have used the Bureau of Meteorology custom component / integration and the Custom Animated Weather Card to present the current weather and forecasts. Both of these are installed from HACS (integration and frontend). I have also added two variables to store the maximum and minimum temperatures for the day. I have an of automation that periodically checks if the current temperature is the max or min so far in the day, and another that resets the variables at mid-night. I also noticed that the BOM Australia calls some of the icons different names to those provided by the Weather Card – so over time as I noticed an icon that was not displaying, I would find a representative icon and change the name to match the BOM name. I now seem to have a pretty complete set of BOM compatible icons. I had to decide if ‘partly cloudy’ was the same as ‘partly sunny’ – decided it was.

BOM Weather Card

Bureau of Meteorology Custom Component

The Bureau of Meteorology custom component can be installed from HACS – it is straight forward. Installation details can be found at https://github.com/bremor/bureau_of_meteorology

After you have installed the custom component:

  1. Go to the Configuration -> Integrations page.
  2. On the bottom right of the page, click on the + Add Integration sign to add an integration.
  3. Search for Bureau of Meteorology. (If you don’t see it, try refreshing your browser page to reload the cache.)
  4. Click Submit so add the integration.

You will need to find the BOM identifier for your location – this can be found from the BOM website. This integration creates a whole pile of entities. I live in Carlton North, so all the entities are prefixed with Carlton North – you will need to change to suit your location. These entities will be used by the Weather Card to display the weather.

Custom Animated Weather Card

Installing the Custom Animated Weather Card from HACS frontend is pretty straight forward. The fun is assigning all the entities to those required by the card. I used to do this in YAML, but now I do in the online Dashboard editor. This where you assign entities, styles and any additional variables. I have created to variable which tracks the current maximum and minimum temperatures for the day. I was also not sure where to put the maximum forecast temperature for the day, so I created a new sensor entity and added the max forecast to the BOM long description for the day’s forecast.

The card configuration is provided in the following:

type: 'custom:bom-weather-card'
title: BOM Weather
entity_current_conditions: sensor.carlton_north_icon_descriptor_0
entity_temperature: sensor.melbourne_olympic_park_temp
entity_forecast_high_temp_1: sensor.carlton_north_temp_max_1
entity_forecast_high_temp_2: sensor.carlton_north_temp_max_2
entity_forecast_high_temp_3: sensor.carlton_north_temp_max_3
entity_forecast_high_temp_4: sensor.carlton_north_temp_max_4
entity_forecast_high_temp_5: sensor.carlton_north_temp_max_5
entity_forecast_icon_1: sensor.carlton_north_icon_descriptor_1
entity_forecast_icon_2: sensor.carlton_north_icon_descriptor_2
entity_forecast_icon_3: sensor.carlton_north_icon_descriptor_3
entity_forecast_icon_4: sensor.carlton_north_icon_descriptor_4
entity_forecast_icon_5: sensor.carlton_north_icon_descriptor_5
entity_forecast_low_temp_1: sensor.carlton_north_temp_min_1
entity_forecast_low_temp_2: sensor.carlton_north_temp_min_2
entity_forecast_low_temp_3: sensor.carlton_north_temp_min_3
entity_forecast_low_temp_4: sensor.carlton_north_temp_min_4
entity_forecast_low_temp_5: sensor.carlton_north_temp_min_5
entity_summary_1: sensor.carlton_north_short_text_1
entity_summary_2: sensor.carlton_north_short_text_2
entity_summary_3: sensor.carlton_north_short_text_3
entity_summary_4: sensor.carlton_north_short_text_4
entity_summary_5: sensor.carlton_north_short_text_5
entity_pos_1: sensor.carlton_north_rain_amount_range_1
entity_pos_2: sensor.carlton_north_rain_amount_range_2
entity_pos_3: sensor.carlton_north_rain_amount_range_3
entity_pos_4: sensor.carlton_north_rain_amount_range_4
entity_pos_5: sensor.carlton_north_rain_amount_range_5
entity_pop_1: sensor.carlton_north_rain_chance_1
entity_pop_2: sensor.carlton_north_rain_chance_2
entity_pop_3: sensor.carlton_north_rain_chance_3
entity_pop_4: sensor.carlton_north_rain_chance_4
entity_pop_5: sensor.carlton_north_rain_chance_5
entity_wind_speed: sensor.melbourne_olympic_park_wind_speed_kilometre
entity_gust_speed: sensor.melbourne_olympic_park_gust_speed_kilometre
entity_pop: sensor.carlton_north_rain_chance_0
entity_pop_intensity: sensor.melbourne_olympic_park_rain_since_9am
entity_possible_today: sensor.carlton_north_rain_amount_range_0
entity_sun: sun.sun
entity_current_text: sensor.bom_current_text
entity_uv_alert: sensor.bom_uv_alert
entity_wind_bearing: sensor.melbourne_olympic_park_wind_direction
entity_apparent_temp: sensor.melbourne_olympic_park_temp_feels_like
entity_humidity: sensor.melbourne_olympic_park_humidity
entity_daily_summary: sensor.bom_current_extended_text
entity_daytime_high: var.max_temperature
entity_daytime_low: var.min_temperature
locale: en
sunset: true
static_icons: false
old_icon: hybrid
tooltip_bg_color: 'rgb( 75,155,239)'
tooltip_border_color: 'rgb(255,161,0)'
tooltip_border_width: 1
tooltip_caret_size: 5
tooltip_fg_color: '#fff'
tooltip_left_offset: -12
tooltip_width: 110
tooltips: true
old_daily_format: false
time_format: 12
show_beaufort: false
refresh_interval: 60
show_separator: false
temp_top_margin: 0px
temp_font_weight: 300
temp_font_size: 4em
temp_right_pos: 0.85em
temp_uom_top_margin: '-12px'
temp_uom_right_margin: 4px
apparent_top_margin: 45px
apparent_right_pos: 1em
apparent_right_margin: 1em
current_text_top_margin: 4.5em
current_text_left_pos: 0px
current_text_font_size: 1.5em
current_text_alignment: center
current_text_width: 100%
current_data_top_margin: 10em
large_icon_top_margin: '-3.2em'
large_icon_left_position: 0px
separator_top_margin: 6em
summary_top_padding: 2em
summary_font_size: 1.1em
slot_l1: daytime_high
slot_l2: daytime_low
slot_l3: wind
slot_l4: pressure
slot_l5: sun_next
slot_r1: pop
slot_r2: humidity
slot_r3: uv_summary
slot_r4: fire_summary
slot_r5: sun_following
show_decimals: false

You will notice that the a number of entities are custom entities I have created in the configuration.yaml file. These are to improve formatting or add maximum day forecast to extended forecast description.

entity_current_text: sensor.bom_current_text
entity_uv_alert: sensor.bom_uv_alert
entity_daily_summary: sensor.bom_current_extended_text
entity_daytime_high: var.max_temperature
entity_daytime_low: var.min_temperature

The following is the configuration.yaml entries I have made:

sensor:
  - platform: template
    sensors:
      bom_current_text:
        value_template: >
            {% set val = states('sensor.carlton_north_short_text_0').split('.')[0] %} 
            {{ val | title  }}
      bom_current_extended_text:
        value_template: >
            {% set val = 'Forecast today : Maximum temperature ' + states('sensor.carlton_north_temp_max_0') + '°C. ' + states('sensor.carlton_north_extended_text_0') %} 
            {{ val | title  }}
      bom_uv_alert:
        value_template: >
            UV Today: Sun Protection 
            {{ as_timestamp(states('sensor.carlton_north_uv_start_time_0')) | timestamp_custom(' %I:%M%p') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.carlton_north_uv_end_time_0')) | timestamp_custom(' %I:%M%p') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.carlton_north_uv_max_index_0') }} [{{ states('sensor.carlton_north_uv_category_0') }}]

In the first template above I have split the ‘.0’ from the current temperature – it takes up too much unnecessary space, especially on a mobile phone.

Current Maximum and Minimum Temperatures

The BOM component does not provide the current maximum and minimum temperature for the day. I have created two variables to track and store each of these temperatures. Two automations check if current temperature is greater or lower than the variables, then resets at midnight.

The home-assistant-variables component needs to be installed via HACS. This provides the ability to define a var. entity in the configuration.yaml file.

var:
  max_temperature:
    initial_value: 0
    friendly_name: 'Maximum Daily Temperature'
    icon: mdi:home-thermometer
  min_temperature:
    initial_value: 0
    friendly_name: 'Minimum Daily Temperature'
    icon: mdi:home-thermometer

I have created an automation to check for the maximum temperature every time the temperature changes.

Trigger if temp changes
If temp greater than var.max – set new var.max

At midnight another automation resets the var.max to a really small number (-99).

Trigger at midnight
Set var.max to -99

Two additional automations were created to manage minimum temperature – same as above, and set var. to 99 at midnight.

I hope this helps, at least you can see how to modify the weather card, and format to meet your requirements.

ken

Share

10 Responses

    • Hi – I just checked – if you go to ‘Devices and Services’ in Settings and click the ADD INTEGRATION button. I searched ‘Bureau of Meteorology’ and it showed in the list. Also I could scroll thru the full list to find. Not sure why not showing in your list. If you still have trouble please let me know and I can investigate further. Regards Ken

    • Hi Ross – Just realised (I forgot) you need to install Bureau of Meteorology – custom component in HACS first – then it will appear in the Integrations list.

    • Hi Ross – from within HACS – select Integrations. Then select ‘+EXPLORE AND DOWNLOAD REPOSITORIES’ at bottom right of the screen. Search ‘Bureau of Meteorology’, and add custom component. Now when you go back to Home Assistant integrations the BOM integration will show in the list. (Sorry for delay – been busy with family past few days). Ken

  1. Hi Ken,

    Cheers for the run through! Great work here. Loving this card.

    Struggling to get the Min/Max automations set up correctly; any chance you could show the YAML code for one of your automations?

    Pretty sure it’s the syntax of my value_template specifically.

    Thanks again


  2. - id: '1679922971249'
    alias: Max Temperature
    description: ''
    trigger:
    - platform: state
    entity_id:
    - sensor.new_farm_temp
    condition:
    - condition: template
    value_template: '{{ states(''sensor.new_farm_temp'')|float >
    states(''var.max_temperature'')|float }}'
    action:
    - data:
    value_template: '{{ states(''sensor.new_farm_temp'') }}'
    entity_id: var.max_temperature
    service: var.set
    mode: single

  3. Corrected. Issue in configuration.yaml more globally preventing the automations.yaml from include-ing. Thanks again!

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment