Customising the BOM Weather and lovelace - now in HACS

Thank you,
These are my Donvale states


and the weather.yaml

sensor:

  - platform: template
    sensors:

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

      uv_cat_formatted:
        value_template: "{{ states('sensor.donvale_uv_category_0') | replace('veryhigh', 'Very High') | title }}"

      bom_uv_alert:
        value_template: >
            UV Today: Sun Protection
            {{ as_timestamp(states('sensor.donvale_uv_start_time_0'),default='n/a') | timestamp_custom(' %I:%M%p',default='n/a') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.viewbank_uv_end_time_0'),default='n/a') | timestamp_custom(' %I:%M%p',default='n/a') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.viewbank_uv_max_index_0') }} [{{ states('sensor.uv_cat_formatted') }}]

      bom_fire_danger:
        value_template: "Fire Danger Today: {{ states('sensor.donvale_fire_danger_0') }}"

# Beaufort

      beaufort:
        value_template: >
            {%- if states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 118 -%}
            12
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 103 -%}
            11
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 89 -%}
            10
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 75 -%}
            9
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 62 -%}
            8
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 50 -%}
            7
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 39 -%}
            6
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 29 -%}
            5
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 20 -%}
            4
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 12 -%}
            3
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 6 -%}
            2
            {%- elif states('sensor.viewbank_wind_speed_kilometre') | float(default='n/a')  >= 2 -%}
            1
            {%- else -%}
            0
            {%- endif -%}

# Heatindex

      heatindex:
        unit_of_measurement: Ā°C
        device_class: temperature
        value_template: >
            {%- if states('sensor.viewbank_temp') | float(default='n/a') > 27 and states('sensor.viewbank_humidity') | float(default='n/a') > 40 -%}
            {% set T = states('sensor.viewbank_temp') | float(default='n/a') %}
            {% set R = states('sensor.viewbank_humidity') | float(default='n/a') %}
            {% set c1 = -8.78469475556 %}
            {% set c2 = 1.61139411 %}
            {% set c3 = 2.33854883889 %}
            {% set c4 = -0.14611605 %}
            {% set c5 = -0.012308094 %}
            {% set c6 = -0.0164248277778 %}
            {% set c7 = 0.002211732 %}
            {% set c8 = 0.00072546 %}
            {% set c9 = -0.000003582 %}
            {% set HI = c1 + (c2 * T ) + (c3 * R) + ( c4 * T * R ) + ( c5 * T**2 ) + ( c6 * R**2 ) + ( c7 * T**2 * R ) + ( c8 * T * R**2 ) + ( c9 * T**2 * R**2 ) %}
            {{ HI | round }}
            {%- else -%}
            n/a
            {%- endif -%}
      heatindexrating:
        value_template: >
            {%- if states('sensor.heatindex') == 'n/a' -%}
            Out of range
            {%- elif states('sensor.heatindex') | float(default='n/a')  >= 54 -%}
            Extreme danger: heat stroke imminent
            {%- elif states('sensor.heatindex') | float(default='n/a')  >= 41 -%}
            Danger: cramps, exhaustion heat stroke probable
            {%- elif states('sensor.heatindex') | float(default='n/a')  >= 32 -%}
            Extreme caution: cramps and exhaustion possible
            {%- elif states('sensor.heatindex') | float(default='n/a')  >= 26 -%}
            Caution: fatigue possible
            {%- else -%}
            Normal
            {%- endif -%}

      bom_forecast_0:
        friendly_name: "Today"
        value_template: >
          {% if states('sensor.donvale_temp_min_0') == 'unknown' %} {% set min = states('sensor.bom_today_min') %} {% else %} {% set min = states('sensor.donvale_temp_min_0') %} {% endif %}
          {% if states('sensor.donvale_temp_max_0') == 'unknown' %} {% set max = states('sensor.bom_today_max') %} {% else %} {% set max = states('sensor.donvale_temp_max_0') %} {% endif %}
          {{ max|round(0,default='none')}}Ā°/{{ min|round(0,default='none')}}Ā°/{{states('sensor.donvale_rain_chance_0')|round(0,default='none')}}%
        entity_picture_template: >-
          {%- if states('sun.sun') == 'below_horizon' and (states('sensor.donvale_icon_descriptor_0') == 'fog' or states('sensor.donvale_icon_descriptor_0') == 'haze' or states('sensor.donvale_icon_descriptor_0') == 'hazy' or states('sensor.donvale_icon_descriptor_0') == 'light-showers' or states('sensor.donvale_icon_descriptor_0') == 'partly-cloudy' or states('sensor.donvale_icon_descriptor_0') == 'showers' or states('sensor.donvale_icon_descriptor_0') == 'shower' or states('sensor.donvale_icon_descriptor_0') == 'light_showers' or states('sensor.donvale_icon_descriptor_0') == 'light_shower' or states('sensor.donvale_icon_descriptor_0') == 'partly_cloudy' or states('sensor.donvale_icon_descriptor_0') == 'mostly_sunny') -%}
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_0') ~ '-night.png' }}
          {%- else -%}
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_0') ~ '.png' }}
          {%- endif -%}

      bom_forecast_1:
        friendly_name_template: >
          {%- set date = as_timestamp(now(),default='n/a') + (1 * 86400 ) -%}
          {{ date | timestamp_custom('Tomorrow (%-d/%-m)',default='n/a') }}
        value_template: >
          {{states('sensor.donvale_temp_max_1')|round(0)}}Ā°/{{states('sensor.donvale_temp_min_1')|round(0)}}Ā°/{{states('sensor.donvale_rain_chance_1')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_1') ~ '.png' }}

      bom_forecast_2:
        friendly_name_template: >
          {%- set date = as_timestamp(now(),default='n/a') + (2 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)',default='n/a') }}
        value_template: >
          {{states('sensor.donvale_temp_max_2')|round(0)}}Ā°/{{states('sensor.donvale_temp_min_2')|round(0)}}Ā°/{{states('sensor.donvale_rain_chance_2')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_2') ~ '.png' }}

      bom_forecast_3:
        friendly_name_template: >
          {%- set date = as_timestamp(now(),default='n/a') + (3 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)',default='n/a') }}
        value_template: >
          {{states('sensor.donvale_temp_max_3')|round(0)}}Ā°/{{states('sensor.donvale_temp_min_3')|round(0)}}Ā°/{{states('sensor.donvale_rain_chance_3')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_3') ~ '.png' }}

      bom_forecast_4:
        friendly_name_template: >
          {%- set date = as_timestamp(now(),default='n/a') + (4 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)',default='n/a') }}
        value_template: >
          {{states('sensor.donvale_temp_max_4')|round(0)}}Ā°/{{states('sensor.donvale_temp_min_4')|round(0)}}Ā°/{{states('sensor.donvale_rain_chance_4')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_4') ~ '.png' }}

      bom_forecast_5:
        friendly_name_template: >
          {%- set date = as_timestamp(now(),default='n/a') + (5 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)',default='n/a') }}
        value_template: >
          {{states('sensor.donvale_temp_max_5')|round(0)}}Ā°/{{states('sensor.donvale_temp_min_5')|round(0)}}Ā°/{{states('sensor.donvale_rain_chance_5')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_5') ~ '.png' }}

      bom_forecast_6:
        friendly_name_template: >
          {%- set date = as_timestamp(now(),default='n/a') + (6 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)',default='n/a') }}
        value_template: >
          {{states('sensor.donvale_temp_max_6')|round(0)}}Ā°/{{states('sensor.donvale_temp_min_6')|round(0)}}Ā°/{{states('sensor.donvale_rain_chance_6')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.donvale_icon_descriptor_6') ~ '.png' }}


      bom_today_max:
        value_template: >
          {{ state_attr('sensor.today_temp_bom', 'max_value') }}


      bom_today_min:
        value_template: >
          {{ state_attr('sensor.today_temp_bom', 'min_value') }}

  - platform: statistics
    name: today_temp_bom
    sampling_size: 150
    entity_id: sensor.donvale_temp
    max_age:
      hours: 24

automation:
- alias: 'Update BOM Icons'
  trigger:
    - event: start
      platform: homeassistant
    - entity_id: sun.sun
      platform: state
      to: 'above_horizon'
    - entity_id: sun.sun
      platform: state
      to: 'below_horizon'
  action:
    - service: homeassistant.update_entity
      entity_id: sensor.bom_forecast_0, sensor.bom_forecast_1, sensor.bom_forecast_2, sensor.bom_forecast_3, sensor.bom_forecast_4, sensor.bom_forecast_5strong text

Thank you @tom_l , I deleted the integration and added it again selecting the maximum days and now it works. I might have not picked enogh days. Thanks for all your help and have safe holidays break.

When you set up the bom weather integration how many days forecast did you select?

You only appear to have 1 days worth of sensors. e.g. here are some of mine:

Iā€™ve got the old NaN errors all over my card today. Reloaded the BoM integration, confirmed the sensors exist (returns a state of unknown though)ā€¦ Any ideas?

Check your entities havenā€™t changed name when you reloaded integration. Check the min/max template sensor as well. It will only show what home assistant is parsing to it

1 Like

Managed to get all working, except the humidity one, that still returns an unknown state, cannot figure that one out.

what does dev-tools show for Humidity?

ok so BOM isnā€™t publishing humidity. Not much I can do to fix that. Youā€™ll see itā€™s missing on the BOM web page as well probably. Only thing you can do is add a nearby location that does publish humidity and pass that through to the card config

1 Like

would that mean adding an entire new integration of it to get just that one sensor?

Yes exactly. You can add the integration multiple times with different areas.

1 Like

A quick search shows that the Lucas Heights readings are not managed by BOM but come from ANSTO, and BOM just publish them. You might be better off just using Holsworthy.

2 Likes

Legend thanks mate, although Iā€™d like to think the shire is a few degrees cooler than that hell hole (spent my fair share of time at Holsworthy Barracks when I was in the Army)

Iā€™ve followed the installation instructions, but I get the following error when I perform a Check Configuration after modifying my configuration.yaml.

Error loading /config/configuration.yaml: mapping values are not allowed here
  in "/config/packages/weather.yaml", line 149, column 65

I have version 0.91 installed.

The weather.yaml file I am using is straight from the github page.

My configuration.yaml looks like this:

homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
        - 192.168.86.0/24
    - type: homeassistant
  packages: !include_dir_named packages

Any clues?

What is on this line in weather.yaml? Clearly a copying error likely indentation of you missed a : at the end of a line where you specified a sensor

Thanks David, I sorted this out. I made a rookie error.

I had downloaded the weather.yaml file from github by right-clicking and selecting save link as. This created a completely different file than expected.
Iā€™m still learning github. I have since downloaded the whole package as a .zip file and grabbed the file from that, all sorted.

Iā€™ve progressed further, but Iā€™m struggling to understand a couple of things mentioned in the README.md.

Iā€™ve modified the weather.yaml file according to my area. I already had the BOM sensors installed a while ago. I can see them and they are reporting values.

Iā€™ve also taken the example lovelace.yaml and modified it accordingly.

I created a new card from the picker and pasted in the modified example lovelace.yaml.

I got a blank card.

Quoting the following section of the README.md


Required entries must be present in your configuration. The card will not work at all if any of these lines are missing. EDIT gosford/kariong to match your observations/forecasts

type: custom:bom-weather-card
title: BOM Weather
entity_current_conditions: sensor.kariong_icon_descriptor_0
entity_temperature: sensor.gosford_temp
entity_forecast_high_temp_1: sensor.kariong_temp_max_1
entity_forecast_high_temp_2: sensor.kariong_temp_max_2
entity_forecast_high_temp_3: sensor.kariong_temp_max_3
entity_forecast_high_temp_4: sensor.kariong_temp_max_4
entity_forecast_high_temp_5: sensor.kariong_temp_max_5
entity_forecast_icon_1: sensor.kariong_icon_descriptor_1
entity_forecast_icon_2: sensor.kariong_icon_descriptor_2
entity_forecast_icon_3: sensor.kariong_icon_descriptor_3
entity_forecast_icon_4: sensor.kariong_icon_descriptor_4
entity_forecast_icon_5: sensor.kariong_icon_descriptor_5
entity_forecast_low_temp_1: sensor.kariong_temp_min_1
entity_forecast_low_temp_2: sensor.kariong_temp_min_2
entity_forecast_low_temp_3: sensor.kariong_temp_min_3
entity_forecast_low_temp_4: sensor.kariong_temp_min_4
entity_forecast_low_temp_5: sensor.kariong_temp_min_5
entity_summary_1: sensor.kariong_short_text_1
entity_summary_2: sensor.kariong_short_text_2
entity_summary_3: sensor.kariong_short_text_3
entity_summary_4: sensor.kariong_short_text_4
entity_summary_5: sensor.kariong_short_text_5
entity_sun: sun.sun

I donā€™t understand what these entries are and where they go in my ā€˜configurationā€™. Which file?

When I look in Developer Tools, I have sensors for ā€¦temp_max_1 and ā€¦_temp_min_1 etc, but I donā€™t see any entries related to the icon_descriptor or short_text (as below), so I guess I havenā€™t configured them due to my lack of understand how it is done.

entity_current_conditions: sensor.kariong_icon_descriptor_0

or

entity_summary_1: sensor.kariong_short_text_1

Apologies if I am missing something obvious, Iā€™m still learning. Big thanks to the community for putting integrations like these out there.

Almost all those sensors are created by the Bom integration perhaps add the integration again

Thanks David, that brought all of the required entities in.
Unfortunately, I am still not getting anything displayed in the card. I used the exact same code from your lovelace.yaml example (modified to suit my location) and checked and confirmed that all of my entities exist.

I installed your card ages ago (> 1 year). I canā€™t remember whether I installed via HACS or manually. With that in mind, I thought it might be worth deleting it and adding it again, but that didnā€™t help.

Perhaps I am still missing something? Iā€™ve read through the readme again. I think everything is setup correctly. However I am a bit unsure whether the Custom Animated Weather Card is really installed correctly.

Thanks for your patience.