Customising the BOM Weather and lovelace - now in HACS

added the two sensors to exclude in history.

restarted.

2021-10-10 19:28:50 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'round' got invalid input 'unknown' when rendering template '{% if states('sensor.pymble_temp_min_0') == 'unknown' %} {% set min = states('sensor.bom_today_min') %} {% else %} {% set min = states('sensor.pymble_temp_min_0') %} {% endif %} {% if states('sensor.pymble_temp_max_0') == 'unknown' %} {% set max = states('sensor.bom_today_max') %} {% else %} {% set max = states('sensor.pymble_temp_max_0') %} {% endif %} {{ max|round(0)}}Ā°/{{ min|round(0)}}Ā°/{{states('sensor.pymble_rain_chance_0')|round(0)}}%' but no default was specified. Currently 'round' will return 'unknown', however this template will fail to render in Home Assistant core 2021.12
2021-10-10 19:28:50 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'round' got invalid input 'unknown' when rendering template '{% if states('sensor.pymble_temp_min_0') == 'unknown' %} {% set min = states('sensor.bom_today_min') %} {% else %} {% set min = states('sensor.pymble_temp_min_0') %} {% endif %} {% if states('sensor.pymble_temp_max_0') == 'unknown' %} {% set max = states('sensor.bom_today_max') %} {% else %} {% set max = states('sensor.pymble_temp_max_0') %} {% endif %} {{ max|round(0)}}Ā°/{{ min|round(0)}}Ā°/{{states('sensor.pymble_rain_chance_0')|round(0)}}%' but no default was specified. Currently 'round' will return 'unknown', however this template will fail to render in Home Assistant core 2021.12

so will add a default (later)

If they are excluded in history that will be the problem. They need to be in history otherwise the sensor will not be able to calculate a value on startup until it gets data

doh.

they were not excluded, so I added. Now removed again. However, they were already excluded from recorder as per your config on githubā€¦ so I have no idea.

added defaults, is working now, so Iā€™ll watch and seeā€¦

looks like you will get also template errors from your UV check too :slight_smile:

2021-10-10 21:43:59 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'as_timestamp' got invalid input 'unknown' when rendering template 'UV Today: Sun Protection {{ as_timestamp(states('sensor.pymble_uv_start_time_0')) | times
tamp_custom(' %I:%M%p') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.pymble_uv_end_time_0')) | timestamp_custom(' %I:%M%p') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.pymble_uv_max_index_0') }}
[{{ states('sensor.pymble_uv_category_0') }}]' but no default was specified. Currently 'as_timestamp' will return 'None', however this template will fail to render in Home Assistant core 2021.12
021-10-10 21:43:59 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input 'None' when rendering template 'UV Today: Sun Protection {{ as_timestamp(states('sensor.pymble_uv_start_time_0')) | time
stamp_custom(' %I:%M%p') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.pymble_uv_end_time_0')) | timestamp_custom(' %I:%M%p') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.pymble_uv_max_index_0') }}
 [{{ states('sensor.pymble_uv_category_0') }}]' but no default was specified. Currently 'timestamp_custom' will return 'None', however this template will fail to render in Home Assistant core 2021.12
2021-10-10 21:43:59 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input 'None' when rendering template 'UV Today: Sun Protection {{ as_timestamp(states('sensor.pymble_uv_start_time_0')) | time
stamp_custom(' %I:%M%p') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.pymble_uv_end_time_0')) | timestamp_custom(' %I:%M%p') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.pymble_uv_max_index_0') }}
 [{{ states('sensor.pymble_uv_category_0') }}]' but no default was specified. Currently 'timestamp_custom' will return 'None', however this template will fail to render in Home Assistant core 2021.12

(openuv is flaky!)

I donā€™t think I have ever excluded those entities

I have not seen any such errors.
ACTUALLY I do see the uv error. I will take a look at fixing that.

home-assistant/recorder.yaml at 9c6b50017ed51e56ba53b3d7fe08d30f5e3a902c Ā· DavidFW1960/home-assistant Ā· GitHub

you right - I canā€™t read. sigh.

Yup - the new templating checks, whilst valid are a complete pain in the

Try this for the UV template

      bom_uv_alert:
        value_template: >
            UV Today: Sun Protection 
            {{ as_timestamp(states('sensor.kariong_uv_start_time_0'),'n/a') | timestamp_custom(' %I:%M%p','n/a') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.kariong_uv_end_time_0'),'n/a') | timestamp_custom(' %I:%M%p','n/a') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.kariong_uv_max_index_0') }} [{{ states('sensor.kariong_uv_category_0') }}]

2021-10-11 14:24:24 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input 'n/a' when rendering template 'UV Today: Sun Protection {{ as_timestamp(states('sensor.pymble_uv_start_time_0'),'n/a') | timestamp_custom(' %I:%M%p','n/a') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.pymble_uv_end_time_0'),'n/a') | timestamp_custom(' %I:%M%p','n/a') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.pymble_uv_max_index_0') }} [{{ states('sensor.pymble_uv_category_0') }}]' but no default was specified. Currently 'timestamp_custom' will return 'n/a', however this template will fail to render in Home Assistant core 2021.12

(when testing by manually setting sensor.pymble_uv_max_index_0 to state = unavailable)

Odd. I was using time_7 which doesnā€™t exist and didnā€™t see that.
Maybe try default=ā€˜n/aā€™ instead?

See this for the temp one (which I just saw. Think itā€™s timing now)

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

OK I donā€™t see any errors on restart now (or warnings) for temp or UV with those changes. Let me know Jon what you see before I push an update to the repo with these edited templates.

2021-10-11 15:01:43 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input 'n/a' when rendering template 'UV Today: Sun Protection {{ as_timestamp(states('sensor.pymble_uv_start_time_0'), default='n/a') | timestamp_custom(' %I:%M%p',default=='n/a') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.pymble_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.pymble_uv_max_index_0') }} [{{ states('sensor.pymble_uv_category_0') }}]' but no default was specified. Currently 'timestamp_custom' will return 'n/a', however this template will fail to render in Home Assistant core 2021.12

So uv not right based on my forced testing. timetstamp_custom isnā€™t happy with the input

I had == rather than =
fixed.

The temp min works - min_0 is currently unknown so looks like both are fixed. thanks.
btw - on the entity_picture_template - why the descriptor check (or why only on night?)

There are only night entities for a few conditions and I only use a night icon for the current day (after sunset) The night icons have -night in the name at the end

ah. fair enough - I didnt check the actual icons.

NOTE to allā€¦ I found a few more templates that require default settings so I have updated the package and also readme fileā€¦

1 Like

Question for anyone using this card in the USA.
Currently pressure for any location using imperial measurements like the USA the pressure will be assumed to be in mbar. I have had a request from someone saying that itā€™s more usual to use in/Hg for this.
I donā€™t want to screw with this if it is going to cause problems for people.
Please let me know what you think if you are currently using imperial units if you would object to this change.

Hi David, thank you for creating this card.
I have been trying to make it work but Iā€™m getting stuck.
I have edited the names in the weather.yalm and Iā€™m getting data for sensor.bom_forecast_0 but unknown for 1 to 6. Also unknown for sensor.bom_today_max.

Youā€™ll need to provide your full config for the card and also look at the states for all the variables you are parsing in dev-tools sensor.bim_today-_* is a template sensor using either the average or statistics integration. Do looks like you donā€™t have that

Thanks for the reply. Iā€™m using statistics

Fors the card configuration Iā€™m using just the most basic but not there yet as if I donā€™t get the sensor working Iā€™m guessing the card wonā€™t show.

type: custom:bom-weather-card
title: BOM Weather
entity_current_conditions: sensor.donvale_icon_descriptor_0
entity_temperature: sensor.viewbank_temp
entity_forecast_high_temp_1: sensor.donvale_temp_max_1
entity_forecast_high_temp_2: sensor.donvale_temp_max_2
entity_forecast_high_temp_3: sensor.donvale_temp_max_3
entity_forecast_high_temp_4: sensor.donvale_temp_max_4
entity_forecast_high_temp_5: sensor.donvale_temp_max_5
entity_forecast_icon_1: sensor.donvale_icon_descriptor_1
entity_forecast_icon_2: sensor.donvale_icon_descriptor_2
entity_forecast_icon_3: sensor.donvale_icon_descriptor_3
entity_forecast_icon_4: sensor.donvale_icon_descriptor_4
entity_forecast_icon_5: sensor.donvale_icon_descriptor_5
entity_forecast_low_temp_1: sensor.donvale_temp_min_1
entity_forecast_low_temp_2: sensor.donvale_temp_min_2
entity_forecast_low_temp_3: sensor.donvale_temp_min_3
entity_forecast_low_temp_4: sensor.donvale_temp_min_4
entity_forecast_low_temp_5: sensor.donvale_temp_min_5
entity_summary_1: sensor.donvale_short_text_1
entity_summary_2: sensor.donvale_short_text_2
entity_summary_3: sensor.donvale_short_text_3
entity_summary_4: sensor.donvale_short_text_4
entity_summary_5: sensor.donvale_short_text_5
entity_sun: sun.sun

Iā€™m away for a few days but I will review it when we return home next week

If you show your donvale sensor sates, and the yaml for your weather template sensors I can try to help.