Customising the BOM Weather and lovelace - now in HACS

Hi David, I put the template into my main configuration.yaml file. It all works but is this bad practice and I will end up with a very big config file. If so is it better to reference it in another stand alone file? If I understand correctly your weather.yaml can sit in the /config folder then in config.yaml use the include function?

My examples are set up to include packages in configuration.yaml and I then have a weather.yaml package. It’s all on my github repo
Configuration.yaml

homeassistant:
  packages: !include_dir_named packages

Then in config directory (where your configuration.yaml is) create a packages directory and put the weather.yaml in there and restart HA.
image
(note I use a lot of packages… even for scripts and automations so I can be sure the GUI editor doesn’t screw them up)

2 Likes

This is very strange. Are there potential conflicts between your card and the dark sky card? I can literally paste 'type: ‘custom:dark-sky-weather-card’ into my Lovelace config, and then replace it with ‘type: ‘custom:bom-weather-card’’, and it reverses the highs and lows. The high is always bold, but with yours, the high is listed 2nd, not first. (IE. 34/58 vs. 58/34).

No idea. I have not touched that code anywhere at any time. In any case if you change the parsed variable you can have it display as you like. but I have not touched that.
I compared the code and it looks the same to me…
This is the graphic from the old card:
image
Looks like low/high as well

Looks like low first needs

old_daily_format: true

Thanks David, appreciate your assistance, below is a copy of my config.

Template Set up in configuration.yaml

  • platform: template
    sensors:

    bom_current_text:
    value_template: >
    {% set val = states(‘sensor.preston_short_text_0’).split(’.’)[0] %}
    {{ val | title }}
    bom_uv_alert:
    value_template: >
    UV Today: Sun Protection
    {{ as_timestamp(states(‘sensor.preston_uv_start_time_0’)) | timestamp_custom(’ %I:%M%p’) | lower | replace(" 0", “”) }} to {{ as_timestamp(states(‘sensor.preston_uv_end_time_0’)) | timestamp_custom(’ %I:%M%p’) | lower | replace(" 0", “”) }}, UV Index predicted to reach {{ states(‘sensor.preston_uv_max_index_0’) }} [{{ states(‘sensor.bom_uv_alert_summary’) }}]
    bom_uv_alert_summary:
    value_template: >
    {% set uv = states(‘sensor.preston_uv_category_0’) %}
    {% if uv == ‘extreme’ %} {% set uv = ‘Extreme’ %}
    {% elif uv == ‘veryhigh’ %} {% set uv = ‘Very High’ %}
    {% elif uv == ‘high’ %} {% set uv = ‘High’ %}
    {% elif uv == ‘moderate’ %} {% set uv = ‘Moderate’ %}
    {% elif uv == ‘low’ %} {% set uv = ‘Low’ %}
    {% endif %}
    {{ uv }}

    bom_fire_danger:
    value_template: “Fire Danger Today: {{ states(‘sensor.preston_fire_danger_1’) }}”

Beaufort

https://en.wikipedia.org/wiki/Beaufort_scale

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

Heatindex

https://en.wikipedia.org/wiki/Heat_index

  heatindex:
    unit_of_measurement: °C
    device_class: temperature
    value_template: >
        {%- if states('sensor.preston_temperature') | float > 27 and states('sensor.preston_humidity') | float > 40 -%}
        {% set T = states('sensor.preston_temperature') | float %}
        {% set R = states('sensor.preston_humidity') | float %}
        {% 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  >= 54 -%}
        Extreme danger: heat stroke imminent
        {%- elif states('sensor.heatindex') | float  >= 41 -%}
        Danger: cramps, exhaustion heat stroke probable
        {%- elif states('sensor.heatindex') | float  >= 32 -%}
        Extreme caution: cramps and exhaustion possible
        {%- elif states('sensor.heatindex') | float  >= 26 -%}
        Caution: fatigue possible
        {%- else -%}
        Normal
        {%- endif -%}
  bom_forecast_0:
    friendly_name: "Today"
    value_template: >
      {% if states('sensor.preston_min_0') == 'unknown' %} {% set min = states('sensor.bom_today_min') %} {% else %} {% set min = states('sensor.preston_min_0') %} {% endif %}
      {% if states('sensor.preston_max_0') == 'unknown' %} {% set max = states('sensor.bom_today_max') %} {% else %} {% set max = states('sensor.preston_max_0') %} {% endif %}
      {{ max|round(0)}}°/{{ min|round(0)}}°/{{states('sensor.preston_rain_chance_0')|round(0)}}%
    entity_picture_template: >-
      {%- if states('sun.sun') == 'below_horizon' and (states('sensor.preston_icon_0') == 'fog' or states('sensor.preston_icon_0') == 'haze' or states('sensor.preston_icon_0') == 'light-showers' or states('sensor.preston_icon_0') == 'partly-cloudy' or states('sensor.preston_icon_0') == 'showers' or states('sensor.preston_icon_0') == 'shower' or states('sensor.preston_icon_0') == 'light_showers' or states('sensor.preston_icon_0') == 'partly_cloudy') -%}
      {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_0') ~ '-night.png' }}
      {%- else -%}
      {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_0') ~ '.png' }}
      {%- endif -%}
  bom_forecast_1:
    friendly_name_template: >
      {%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
      {{ date | timestamp_custom('Tomorrow') }}
    value_template: >
      {{states('sensor.preston_max_1')|round(0)}}°/{{states('sensor.preston_min_1')|round(0)}}°/{{states('sensor.preston_rain_chance_1')|round(0)}}%
    entity_picture_template: >-
      {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_1') ~ '.png' }}
  bom_forecast_2:
    friendly_name_template: >
      {%- set date = as_timestamp(now()) + (2 * 86400 ) -%}
      {{ date | timestamp_custom('%A') }}
    value_template: >
      {{states('sensor.preston_max_2')|round(0)}}°/{{states('sensor.preston_min_2')|round(0)}}°/{{states('sensor.preston_rain_chance_2')|round(0)}}%
    entity_picture_template: >-
      {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_2') ~ '.png' }}
  bom_forecast_3:
    friendly_name_template: >
      {%- set date = as_timestamp(now()) + (3 * 86400 ) -%}
      {{ date | timestamp_custom('%A') }}
    value_template: >
      {{states('sensor.preston_max_3')|round(0)}}°/{{states('sensor.preston_min_3')|round(0)}}°/{{states('sensor.preston_rain_chance_3')|round(0)}}%
    entity_picture_template: >-
      {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_3') ~ '.png' }}
  bom_forecast_4:
    friendly_name_template: >
      {%- set date = as_timestamp(now()) + (4 * 86400 ) -%}
      {{ date | timestamp_custom('%A') }}
    value_template: >
      {{states('sensor.preston_max_4')|round(0)}}°/{{states('sensor.preston_min_4')|round(0)}}°/{{states('sensor.preston_rain_chance_4')|round(0)}}%
    entity_picture_template: >-
      {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_4') ~ '.png' }}
  bom_forecast_5:
    friendly_name_template: >
      {%- set date = as_timestamp(now()) + (5 * 86400 ) -%}
      {{ date | timestamp_custom('%A (%-d/%-m)') }}
    value_template: >
      {{states('sensor.preston_max_5')|round(0)}}°/{{states('sensor.preston_min_5')|round(0)}}°/{{states('sensor.preston_rain_chance_5')|round(0)}}%
    entity_picture_template: >-
      {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_5') ~ '.png' }}

ONLY USE ONE bom_today_max below:

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

bom_today_max:

value_template: >

{%- if states(‘sensor.preston_max_0’) == ‘n/a’ -%}

{{ state_attr(‘sensor.today_temp_bom’, ‘max_value’) }}

{% else %}

{{ states(‘sensor.preston_max_0’) }}

{% endif %}

ONLY USE ONE bom_today_min below:

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

bom_today_min:

value_template: >

{%- if states(‘sensor.preston_min_0’) == ‘n/a’ -%}

{{ state_attr(‘sensor.today_temp_bom’, ‘min_value’) }}

{% else %}

{{ states(‘sensor.preston_min_0’) }}

{% endif %}

IMPORTANT NOTE IF YOU USE statistics, you must comment out the above average sensor. Both cannot exist

- platform: statistics

name: today_temp_bom

sampling_size: 150

entity_id: sensor.preston_temperature

max_age:

hours: 24

lovelace config

type: ‘custom:bom-weather-card’
title: BOM Weather
entity_current_conditions: sensor.preston_icon_0
entity_temperature: sensor.preston_temperature
entity_forecast_high_temp_1: sensor.preston_max_1
entity_forecast_high_temp_2: sensor.preston_max_2
entity_forecast_high_temp_3: sensor.preston_max_3
entity_forecast_high_temp_4: sensor.preston_max_4
entity_forecast_high_temp_5: sensor.preston_max_5
entity_forecast_icon_1: sensor.preston_icon_1
entity_forecast_icon_2: sensor.preston_icon_2
entity_forecast_icon_3: sensor.preston_icon_3
entity_forecast_icon_4: sensor.preston_icon_4
entity_forecast_icon_5: sensor.preston_icon_5
entity_forecast_low_temp_1: sensor.preston_min_1
entity_forecast_low_temp_2: sensor.preston_min_2
entity_forecast_low_temp_3: sensor.preston_min_3
entity_forecast_low_temp_4: sensor.preston_min_4
entity_forecast_low_temp_5: sensor.preston_min_5
entity_summary_1: sensor.preston_short_text_1
entity_summary_2: sensor.preston_short_text_2
entity_summary_3: sensor.preston_short_text_3
entity_summary_4: sensor.preston_short_text_4
entity_summary_5: sensor.preston_short_text_5
entity_sun: sun.sun
entity_daytime_high: sensor.bom_today_max
entity_daytime_low: sensor.bom_today_min
entity_wind_bearing: sensor.preston_wind_direction
entity_wind_speed: sensor.preston_wind_speed
entity_wind_gust: sensor.preston_gust_speed
entity_humidity: sensor.preston_humidity
entity_apparent_temp: sensor.preston_temperature_feels_like
entity_daily_summary: sensor.preston_extended_text_0
entity_pop: sensor.preston_rain_chance_0
entity_pop_intensity: sensor.preston_rain_since_9am
entity_possible_today: sensor.preston_rain_amount_range_0
entity_pos_1: sensor.preston_rain_amount_range_1
entity_pos_2: sensor.preston_rain_amount_range_2
entity_pos_3: sensor.preston_rain_amount_range_3
entity_pos_4: sensor.preston_rain_amount_range_4
entity_pos_5: sensor.preston_rain_amount_range_5
entity_pop_1: sensor.preston_rain_chance_1
entity_pop_2: sensor.preston_rain_chance_2
entity_pop_3: sensor.preston_rain_chance_3
entity_pop_4: sensor.preston_rain_chance_4
entity_pop_5: sensor.preston_rain_chance_5
entity_current_text: sensor.bom_current_text
entity_uv_alert: sensor.bom_uv_alert
entity_fire_danger: sensor.bom_fire_danger
entity_uv_alert_summary: sensor.bom_uv_alert_summary
entity_fire_danger_summary: sensor.preston_fire_danger_0
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: 0.8em
slot_l1: daytime_high
slot_l2: daytime_low
slot_l3: wind
slot_l4: sun_next
slot_l5: sun_next
slot_r1: pop
slot_r2: humidity
slot_r3: uv_summary
slot_r4: fire_summary
slot_r5: sun_following

Please fix your formatting. See point 11 here: Help us help you

1 Like

As Tom said please format using the </> tool or backticks…

I must apologize; after spending a lot of time, I figured out, I had apparently modified, and subsequently abandoned my copy of the dark sky version, hence why it was different. Thank-you.

1 Like

sorry gents, below reformatted…

configuration.yaml

  - platform: template
    sensors:

      bom_current_text:
        value_template: >
            {% set val = states('sensor.preston_short_text_0').split('.')[0] %} 
            {{ val | title }}
      bom_uv_alert:
        value_template: >
            UV Today: Sun Protection 
            {{ as_timestamp(states('sensor.preston_uv_start_time_0')) | timestamp_custom(' %I:%M%p') | lower | replace(" 0", "") }} to {{ as_timestamp(states('sensor.preston_uv_end_time_0')) | timestamp_custom(' %I:%M%p') | lower | replace(" 0", "") }}, UV Index predicted to reach {{ states('sensor.preston_uv_max_index_0') }} [{{ states('sensor.bom_uv_alert_summary') }}]
      bom_uv_alert_summary:
        value_template: >
            {% set uv = states('sensor.preston_uv_category_0') %}
            {% if uv == 'extreme' %} {% set uv = 'Extreme' %}
            {% elif uv == 'veryhigh' %} {% set uv = 'Very High' %} 
            {% elif uv == 'high' %} {% set uv = 'High' %}
            {% elif uv == 'moderate' %} {% set uv = 'Moderate' %}
            {% elif uv == 'low' %} {% set uv = 'Low' %}
            {% endif %}
            {{ uv }}
          
      bom_fire_danger:
        value_template: "Fire Danger Today: {{ states('sensor.preston_fire_danger_1') }}"

# Beaufort
# https://en.wikipedia.org/wiki/Beaufort_scale
      beaufort:
        value_template: >
            {%- if states('sensor.preston_wind_speed') | float  >= 118 -%}
            12
            {%- elif states('sensor.preston_wind_speed') | float  >= 103 -%}
            11
            {%- elif states('sensor.preston_wind_speed') | float  >= 89 -%}
            10
            {%- elif states('sensor.preston_wind_speed') | float  >= 75 -%}
            9
            {%- elif states('sensor.preston_wind_speed') | float  >= 62 -%}
            8
            {%- elif states('sensor.preston_wind_speed') | float  >= 50 -%}
            7
            {%- elif states('sensor.preston_wind_speed') | float  >= 39 -%}
            6
            {%- elif states('sensor.preston_wind_speed') | float  >= 29 -%}
            5
            {%- elif states('sensor.preston_wind_speed') | float  >= 20 -%}
            4
            {%- elif states('sensor.preston_wind_speed') | float  >= 12 -%}
            3
            {%- elif states('sensor.preston_wind_speed') | float  >= 6 -%}
            2
            {%- elif states('sensor.preston_wind_speed') | float  >= 2 -%}
            1
            {%- else -%}
            0
            {%- endif -%}
# Heatindex
# https://en.wikipedia.org/wiki/Heat_index
      heatindex:
        unit_of_measurement: °C
        device_class: temperature
        value_template: >
            {%- if states('sensor.preston_temperature') | float > 27 and states('sensor.preston_humidity') | float > 40 -%}
            {% set T = states('sensor.preston_temperature') | float %}
            {% set R = states('sensor.preston_humidity') | float %}
            {% 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  >= 54 -%}
            Extreme danger: heat stroke imminent
            {%- elif states('sensor.heatindex') | float  >= 41 -%}
            Danger: cramps, exhaustion heat stroke probable
            {%- elif states('sensor.heatindex') | float  >= 32 -%}
            Extreme caution: cramps and exhaustion possible
            {%- elif states('sensor.heatindex') | float  >= 26 -%}
            Caution: fatigue possible
            {%- else -%}
            Normal
            {%- endif -%}
      bom_forecast_0:
        friendly_name: "Today"
        value_template: >
          {% if states('sensor.preston_min_0') == 'unknown' %} {% set min = states('sensor.bom_today_min') %} {% else %} {% set min = states('sensor.preston_min_0') %} {% endif %}
          {% if states('sensor.preston_max_0') == 'unknown' %} {% set max = states('sensor.bom_today_max') %} {% else %} {% set max = states('sensor.preston_max_0') %} {% endif %}
          {{ max|round(0)}}°/{{ min|round(0)}}°/{{states('sensor.preston_rain_chance_0')|round(0)}}%
        entity_picture_template: >-
          {%- if states('sun.sun') == 'below_horizon' and (states('sensor.preston_icon_0') == 'fog' or states('sensor.preston_icon_0') == 'haze' or states('sensor.preston_icon_0') == 'light-showers' or states('sensor.preston_icon_0') == 'partly-cloudy' or states('sensor.preston_icon_0') == 'showers' or states('sensor.preston_icon_0') == 'shower' or states('sensor.preston_icon_0') == 'light_showers' or states('sensor.preston_icon_0') == 'partly_cloudy') -%}
          {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_0') ~ '-night.png' }}
          {%- else -%}
          {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_0') ~ '.png' }}
          {%- endif -%}
      bom_forecast_1:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
          {{ date | timestamp_custom('Tomorrow') }}
        value_template: >
          {{states('sensor.preston_max_1')|round(0)}}°/{{states('sensor.preston_min_1')|round(0)}}°/{{states('sensor.preston_rain_chance_1')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_1') ~ '.png' }}
      bom_forecast_2:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (2 * 86400 ) -%}
          {{ date | timestamp_custom('%A') }}
        value_template: >
          {{states('sensor.preston_max_2')|round(0)}}°/{{states('sensor.preston_min_2')|round(0)}}°/{{states('sensor.preston_rain_chance_2')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_2') ~ '.png' }}
      bom_forecast_3:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (3 * 86400 ) -%}
          {{ date | timestamp_custom('%A') }}
        value_template: >
          {{states('sensor.preston_max_3')|round(0)}}°/{{states('sensor.preston_min_3')|round(0)}}°/{{states('sensor.preston_rain_chance_3')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_3') ~ '.png' }}
      bom_forecast_4:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (4 * 86400 ) -%}
          {{ date | timestamp_custom('%A') }}
        value_template: >
          {{states('sensor.preston_max_4')|round(0)}}°/{{states('sensor.preston_min_4')|round(0)}}°/{{states('sensor.preston_rain_chance_4')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_4') ~ '.png' }}
      bom_forecast_5:
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (5 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)') }}
        value_template: >
          {{states('sensor.preston_max_5')|round(0)}}°/{{states('sensor.preston_min_5')|round(0)}}°/{{states('sensor.preston_rain_chance_5')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.preston_icon_5') ~ '.png' }}
# ONLY USE ONE bom_today_max below:
      bom_today_max:
        value_template: >
          {{ state_attr('sensor.today_temp_bom', 'max_value') }}
#      bom_today_max:
#        value_template: >
#          {%- if states('sensor.preston_max_0') == 'n/a' -%} 
#            {{ state_attr('sensor.today_temp_bom', 'max_value') }}
#          {% else %}
#            {{ states('sensor.preston_max_0') }}
#          {% endif %}

# ONLY USE ONE bom_today_min below:
      bom_today_min:
        value_template: >
          {{ state_attr('sensor.today_temp_bom', 'min_value') }}
#      bom_today_min:
#        value_template: >
#          {%- if states('sensor.preston_min_0') == 'n/a' -%} 
#            {{ state_attr('sensor.today_temp_bom', 'min_value') }}
#          {% else %}
#            {{ states('sensor.preston_min_0') }}
#          {% endif %}

# IMPORTANT NOTE IF YOU USE statistics, you must comment out the above average sensor. Both cannot exist
#  - platform: statistics
#    name: today_temp_bom
#    sampling_size: 150
#    entity_id: sensor.preston_temperature
#    max_age:
#      hours: 24

Custom Card

type: custom:bom-weather-card
title: BOM Weather
entity_current_conditions: sensor.preston_icon_0
entity_temperature: sensor.preston_temperature
entity_forecast_high_temp_1: sensor.preston_max_1
entity_forecast_high_temp_2: sensor.preston_max_2
entity_forecast_high_temp_3: sensor.preston_max_3
entity_forecast_high_temp_4: sensor.preston_max_4
entity_forecast_high_temp_5: sensor.preston_max_5
entity_forecast_icon_1: sensor.preston_icon_1
entity_forecast_icon_2: sensor.preston_icon_2
entity_forecast_icon_3: sensor.preston_icon_3
entity_forecast_icon_4: sensor.preston_icon_4
entity_forecast_icon_5: sensor.preston_icon_5
entity_forecast_low_temp_1: sensor.preston_min_1
entity_forecast_low_temp_2: sensor.preston_min_2
entity_forecast_low_temp_3: sensor.preston_min_3
entity_forecast_low_temp_4: sensor.preston_min_4
entity_forecast_low_temp_5: sensor.preston_min_5
entity_summary_1: sensor.preston_short_text_1
entity_summary_2: sensor.preston_short_text_2
entity_summary_3: sensor.preston_short_text_3
entity_summary_4: sensor.preston_short_text_4
entity_summary_5: sensor.preston_short_text_5
entity_sun: sun.sun
#           entity_visibility: sensor.dark_sky_visibility
entity_daytime_high: sensor.bom_today_max
entity_daytime_low: sensor.bom_today_min
entity_wind_bearing: sensor.preston_wind_direction
entity_wind_speed: sensor.preston_wind_speed
entity_wind_gust: sensor.preston_gust_speed
#           entity_wind_speed_kt: sensor.preston_wind_speed_knots
#           entity_wind_gust_kt: sensor.preston_gust_speed_knots
entity_humidity: sensor.preston_humidity
############################## IMPORTANT!!! BOM are NOT providing Pressure sensor for forecast.
############################## IF you use my entity_pressure sensor the card won't display
# entity_pressure: sensor.nodemcu_lounge_bme280_seapressure CAN USE OWN PRESSURE
entity_apparent_temp: sensor.preston_temperature_feels_like
entity_daily_summary: sensor.preston_extended_text_0
entity_pop: sensor.preston_rain_chance_0
entity_pop_intensity: sensor.preston_rain_since_9am
entity_possible_today: sensor.preston_rain_amount_range_0
entity_pos_1: sensor.preston_rain_amount_range_1
entity_pos_2: sensor.preston_rain_amount_range_2
entity_pos_3: sensor.preston_rain_amount_range_3
entity_pos_4: sensor.preston_rain_amount_range_4
entity_pos_5: sensor.preston_rain_amount_range_5
entity_pop_1: sensor.preston_rain_chance_1
entity_pop_2: sensor.preston_rain_chance_2
entity_pop_3: sensor.preston_rain_chance_3
entity_pop_4: sensor.preston_rain_chance_4
entity_pop_5: sensor.preston_rain_chance_5
entity_current_text: sensor.bom_current_text
entity_uv_alert: sensor.bom_uv_alert
entity_fire_danger: sensor.bom_fire_danger
entity_uv_alert_summary: sensor.bom_uv_alert_summary
entity_fire_danger_summary: sensor.preston_fire_danger_0
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
#           show_decimals: true
refresh_interval: 60
show_separator: false
temp_top_margin: 0px            #default 0px px or em Note: pre-0.109.x default was -0.3em
temp_font_weight: 300           #default 300 numeric
temp_font_size: 4em             #default 4em em
temp_right_pos: 0.85em          #default .85em px or em
temp_uom_top_margin: -12px      #default -12px px or em Note: pre-0.109.x default was -9px
temp_uom_right_margin: 4px      #default 4px px or em
apparent_top_margin: 45px       #default 45px px or em
apparent_right_pos: 1em         #default 1em px or em
apparent_right_margin: 1em      #default 1em px or em
current_text_top_margin: 4.5em  #default 4.5em px or em pre-0.109.x default was 39px
current_text_left_pos: 0px      #default 0px px or em pre-0.109.x default was 5em
current_text_font_size: 1.5em   #default 1.5em em
current_text_alignment: center  #default center
current_text_width: 100%        #default 100%
current_data_top_margin: 10em   #default 10em px or em pre-0.109.x default was 7em
large_icon_top_margin: -3.2em   #default -3.2em px or em Note: pre-0.109.x default was -3.5em
large_icon_left_position: 0px   #default 0em px or em
separator_top_margin: 6em       #default 6em px or em
summary_top_padding: 2em        #default 2em px or em pre-0.109.x default was 1em
summary_font_size: 0.8em        #default 0.8em px or em
slot_l1: daytime_high           #daytime_high
slot_l2: daytime_low            #daytime_low
slot_l3: wind                   #wind
######### change slot_l4 to something else if you don't have a pressure entity (otherwise it will be blank on the card
slot_l4: pressure               #pressure
slot_l5: sun_next               #sun_next
slot_r1: pop                    #pop
slot_r2: humidity               #humidity
slot_r3: uv_summary             #uv_summary
slot_r4: fire_summary           #fire_summary
slot_r5: sun_following          #sun_following

I don’t see the statistics or average component used.
Either of those creates the sensor.today_temp_bom sensor which I assume doesn’t exist in dev_tools?
The sensor.bom_today_min and sensor.bom_today_max are derived from that sensor.

(Also, check in dev_tools that all the sensors in red exist… The only reason a card won’t display is if entities are not there)

(Note if you used templates.md file it was missing the stats/average sensor. I fixed that just now)

Thanks David, I found the entities which are not valid and for some reason is due to it being set up for Viewbank when all other entities mapped to the coordinates I entered upon installation. Is there a way to reload these and enter coordinates again or is it a case of remove and reinstall?

image

Yeah so the observations will be for the closest BOM obs station whereas they use computer modelling to interpolate the forecasts for your exact suburb. In your case the BOM Obs station is Viewbank while your entered suburb for forecasts is Preston. (Same as my Obs is Gosford but forecast is Kariong)

IF you’re saying you are not in Viewbank then remove the integration and re-add it…

That’s fine, view bank is like 3 - 4 kilometers away I’m OK with that and thanks for the great card and your assistance!

1 Like

Hey thanks for all the awesome work you guys do!!! Much appreciated. Have updated to the new integration and it works a treat.

1 Like

I Brendan,

I do a calculation to calculate the effectiveness of my evaporative air conditioner with Delta_t.

Simply subtracting 80% of the delta_t from the current air temp gives a very good estimate of the air temperature that your evaporative air conditioner can manage. When the humidity is high, the delta_t is small and so when the resultant calculated temperature is more than say 24 degrees then it is not worth running the evap and time for the refrigerated aircon instead!

Just as a follow-up to this… If you don’t want to hack the card like you did before you can just change the entity you pass through like this:
change this:

            entity_forecast_high_temp_1: sensor.kariong_max_1
            entity_forecast_high_temp_2: sensor.kariong_max_2
            entity_forecast_high_temp_3: sensor.kariong_max_3
            entity_forecast_high_temp_4: sensor.kariong_max_4
            entity_forecast_high_temp_5: sensor.kariong_max_5
            entity_forecast_low_temp_1: sensor.kariong_min_1
            entity_forecast_low_temp_2: sensor.kariong_min_2
            entity_forecast_low_temp_3: sensor.kariong_min_3
            entity_forecast_low_temp_4: sensor.kariong_min_4
            entity_forecast_low_temp_5: sensor.kariong_min_5

to this:

            entity_forecast_high_temp_1: sensor.kariong_min_1
            entity_forecast_high_temp_2: sensor.kariong_min_2
            entity_forecast_high_temp_3: sensor.kariong_min_3
            entity_forecast_high_temp_4: sensor.kariong_min_4
            entity_forecast_high_temp_5: sensor.kariong_min_5
            entity_forecast_low_temp_1: sensor.kariong_max_1
            entity_forecast_low_temp_2: sensor.kariong_max_2
            entity_forecast_low_temp_3: sensor.kariong_max_3
            entity_forecast_low_temp_4: sensor.kariong_max_4
            entity_forecast_low_temp_5: sensor.kariong_max_5

Yes, that is correct, I could do that, however, would it not show the numbers as: high/low? (the low now being in bold?). I’ll admit, I haven’t tried it, but, I suspect that’s what it would do. I prefer my forecast to look like the attached image. If you felt so inclined to add an option for this, that’d be great, otherwise, I’ll just keep tweaking the code with each new update. I appreciate your work! image

1 Like

Yeah it will always bold the second one. It’s probably not a difficult change. I will take a look and see.

ok. Can you pull master instead of 0.82 and add a flag

tempformat: highlow

and then it will show this:

If it is working for you then I will push an update.

Empty cache and hard reload and ctrl+r a few times…

OH CRAP… hang on… I need another change cos when it refreshes it reverses again…

ok I fixed that. it should work as you want now. Please let me know.

DAMN I need to push to master… DONE.