Customising the BOM Weather and lovelace - now in HACS

Great, thanks!

Believe me you’re streets ahead of me on js!

OK it will be released and available shortly.

BUT… It will be a config option, not hard wired. I also set the ability to set the font size for the summary text as well as the top margin. You WILL need to add 2 new variables in Lovelace as per:
image
ie summary_top_margin and summary_font_size.
With 1em and 0.9em it will look like this:
image

I need to change the docs and examples then I’ll push a release to HACS for it… so give me 5

OK see how you guys like this one…

Amazing! Thanks David

Should also say I changed the text from Possible Today to Forecast and Possible Tomorrow to Forc. Tom. as the full text was screwing up the card on a Tablet in portrait mode.

2 Likes

So far I’ve had one reply from fiver. Quoted $10 per icon and his sample had the moon on the wrong side of the clouds, dispite extensive design notes. :man_facepalming: Waiting for the others to get back to me.

Bloody hell!

How hard can it be I wonder? Might have a look in GIMP but I really do suck at GIMP.

Updated and looks great, thanks again David!

1 Like

I downloaded inkscape and tried and… failed.

Assume you found this… https://codecanyon.net/item/animated-svg-weather-icons/12631845 for $8 so $10 seems OTT…

Just a heads up… I found an issue with the possibilty of rain wrapping and causing issues with the summary text. So I have changed the way it is doing the spacing. I also renamed the variable in the lovelace configuration like so:

summary_top_padding: 1em
summary_font_size: 0.8em

Further to this, I finally worked out I was applying the 0.8em multiplier for the font size TWICE instead of once for the summary text. So I have fixed that and done another new release. Sorry about that and hopefully this will be the last change for a while. You might find you will need to adjust your summary text size if you use em instead of pixel size.

I just released a new version that is compatible with cast (no red wall of text). It doesn’t seem to be rendering the svg icons though at least on my TV with Chromecast v1.

Please leave feedback here…

OK the problem is that the icons are being pulled from a non-https URL and cast requires https - same as issues with iFrames. I have a few ideas/ways to fix this, probably tomorrow.

I doubt I’ll ever use the cast feature but good to hear you are on top of it.

Hi @DavidFW1960
Thanks again for all your work on this, love having a great looking card that works with BOM!

I mainly access HA on my mobile and have a full weather view including your card, the BOM radar and openuv.io information;

I also use the simple-weather-card on my main view to display basic information however it doesn’t play nice with BOM data or use the same icon set.

Is it possible to have your card just display the top section only, icon, summary, current temp and feels like temp?

Anything is possible but that’s likely a lot of work. I’ll think about it.

Not sure if I’ve stuffed up, but for some reason I can’t get the icons or summary to show. It pulls down everything else like min/max and current temp but thats it.

Any ideas where I messed up would be greatly appreciated 14
That’s what the output is.

Here’s my code:
sensor.yaml

- platform: bom
  station: IDS60901.94648
  name: adelaide
  monitored_conditions:
    - apparent_t
    - delta_t
    - gust_kmh
    - gust_kt
    - air_temp
    - dewpt
    - rain_trace
    - rel_hum
    - wind_dir
    - wind_spd_kmh
    - wind_spd_kt

- platform: bom_forecast
  product_id: IDS10034
  name: Adelaide
  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'

- platform: template
  sensors:
      bom_current_text:
        value_template: >
            {% set val = states('sensor.bom_adelaide_summary_0').split('.')[0] %}
            {{ val | title }}
      bom_forecast_0:
        entity_id:
          - sensor.bom_today_max
          - sensor.bom_today_min
          - sensor.bom_adelaide_chance_of_rain_0
          - sensor.bom_adelaide_icon_0
        friendly_name: "Today"
        value_template: >
          {{states('sensor.bom_today_max')|round(0)}}°/{{states('sensor.bom_today_min')|round(0)}}°/{{states('sensor.bom_adelaide_chance_of_rain_0')|round(0)}}%
        entity_picture_template: >-
          {%- if states('sun.sun') == 'below_horizon' and (states('sensor.bom_adelaide_icon_0') == 'fog' or states('sensor.bom_adelaide_icon_0') == 'haze' or states('sensor.bom_adelaide_icon_0') == ' light-showers' or states('sensor.bom_adelaide_icon_0') == 'partly-cloudy' or states('sensor.bom_adelaide_icon_0') == 'showers') -%}
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_0') ~ '-night.png' }}
          {%- else -%}
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_0') ~ '.png' }}
          {%- endif -%}
      bom_forecast_1:
        entity_id:
          - sensor.bom_adelaide_max_temp_c_1
          - sensor.bom_adelaide_min_temp_c_1
          - sensor.bom_adelaide_chance_of_rain_1
          - sensor.bom_adelaide_icon_1
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
          {{ date | timestamp_custom('Tomorrow (%-d/%-m)') }}
        value_template: >
          {{states('sensor.bom_adelaide_max_temp_c_1')|round(0)}}°/{{states('sensor.bom_adelaide_min_temp_c_1')|round(0)}}°/{{states('sensor.bom_adelaide_chance_of_rain_1')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_1') ~ '.png' }}
      bom_forecast_2:
        entity_id:
          - sensor.bom_adelaide_max_temp_c_2
          - sensor.bom_adelaide_min_temp_c_2
          - sensor.bom_adelaide_chance_of_rain_2
          - sensor.bom_adelaide_icon_2
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (2 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)') }}
        value_template: >
          {{states('sensor.bom_adelaide_max_temp_c_2')|round(0)}}°/{{states('sensor.bom_adelaide_min_temp_c_2')|round(0)}}°/{{states('sensor.bom_adelaide_chance_of_rain_2')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_2') ~ '.png' }}
      bom_forecast_3:
        entity_id:
          - sensor.bom_adelaide_max_temp_c_3
          - sensor.bom_adelaide_min_temp_c_3
          - sensor.bom_adelaide_chance_of_rain_3
          - sensor.bom_adelaide_icon_3
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (3 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)') }}
        value_template: >
          {{states('sensor.bom_adelaide_max_temp_c_3')|round(0)}}°/{{states('sensor.bom_adelaide_min_temp_c_3')|round(0)}}°/{{states('sensor.bom_adelaide_chance_of_rain_3')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_3') ~ '.png' }}
      bom_forecast_4:
        entity_id:
          - sensor.bom_adelaide_max_temp_c_4
          - sensor.bom_adelaide_min_temp_c_4
          - sensor.bom_adelaide_chance_of_rain_4
          - sensor.bom_adelaide_icon_4
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (4 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)') }}
        value_template: >
          {{states('sensor.bom_adelaide_max_temp_c_4')|round(0)}}°/{{states('sensor.bom_adelaide_min_temp_c_4')|round(0)}}°/{{states('sensor.bom_adelaide_chance_of_rain_4')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_4') ~ '.png' }}
      bom_forecast_5:
        entity_id:
          - sensor.bom_adelaide_max_temp_c_5
          - sensor.bom_adelaide_min_temp_c_5
          - sensor.bom_adelaide_chance_of_rain_5
          - sensor.bom_adelaide_icon_5
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (5 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)') }}
        value_template: >
          {{states('sensor.bom_adelaide_max_temp_c_5')|round(0)}}°/{{states('sensor.bom_adelaide_min_temp_c_5')|round(0)}}°/{{states('sensor.bom_adelaide_chance_of_rain_5')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_5') ~ '.png' }}
      bom_forecast_6:
        entity_id:
          - sensor.bom_adelaide_max_temp_c_6
          - sensor.bom_adelaide_min_temp_c_6
          - sensor.bom_adelaide_chance_of_rain_6
          - sensor.bom_adelaide_icon_6
        friendly_name_template: >
          {%- set date = as_timestamp(now()) + (6 * 86400 ) -%}
          {{ date | timestamp_custom('%A (%-d/%-m)') }}
        value_template: >
          {{states('sensor.bom_adelaide_max_temp_c_6')|round(0)}}°/{{states('sensor.bom_adelaide_min_temp_c_6')|round(0)}}°/{{states('sensor.bom_adelaide_chance_of_rain_6')|round(0)}}%
        entity_picture_template: >-
          {{ '/local/icons/bom_icons/' ~ states('sensor.bom_adelaide_icon_6') ~ '.png' }}
      bom_today_max:
        entity_id:
          - sensor.bom_adelaide_max_temp_c_0
          - sensor.today_temp_bom_mean
        value_template: >
          {%- if states('sensor.bom_adelaide_max_temp_c_0') == 'n/a' -%}
            {{ state_attr('sensor.today_temp_bom_mean', 'max_value') }}
          {% else %}
            {{ states('sensor.bom_adelaide_max_temp_c_0') }}
          {% endif %}
      bom_today_min:
        entity_id:
          - sensor.bom_adelaide_min_temp_c_0
          - sensor.today_temp_bom_mean
        value_template: >
          {%- if states('sensor.bom_adelaide_min_temp_c_0') == 'n/a' -%}
            {{ state_attr('sensor.today_temp_bom_mean', 'min_value') }}
          {% else %}
            {{ states('sensor.bom_adelaide_min_temp_c_0') }}
          {% endif %}

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

The card

- cards:
              - entity_current_conditions: sensor.bom_adelaide_icon_0
                entity_forecast_high_temp_1: sensor.bom_adelaide_max_temp_c_1
                entity_forecast_high_temp_2: sensor.bom_adelaide_max_temp_c_2
                entity_forecast_high_temp_3: sensor.bom_adelaide_max_temp_c_3
                entity_forecast_high_temp_4: sensor.bom_adelaide_max_temp_c_4
                entity_forecast_high_temp_5: sensor.bom_adelaide_max_temp_c_5
                entity_forecast_icon_1: sensor.bom_adelaide_icon_1
                entity_forecast_icon_2: sensor.bom_adelaide_icon_2
                entity_forecast_icon_3: sensor.bom_adelaide_icon_3
                entity_forecast_icon_4: sensor.bom_adelaide_icon_4
                entity_forecast_icon_5: sensor.bom_adelaide_icon_5
                entity_forecast_low_temp_1: sensor.bom_adelaide_min_temp_c_1
                entity_forecast_low_temp_2: sensor.bom_adelaide_min_temp_c_2
                entity_forecast_low_temp_3: sensor.bom_adelaide_min_temp_c_3
                entity_forecast_low_temp_4: sensor.bom_adelaide_min_temp_c_4
                entity_forecast_low_temp_5: sensor.bom_adelaide_min_temp_c_5
                entity_summary_1: sensor.bom_adelaide_summary_1
                entity_summary_2: sensor.bom_adelaide_summary_2
                entity_summary_3: sensor.bom_adelaide_summary_3
                entity_summary_4: sensor.bom_adelaide_summary_4
                entity_summary_5: sensor.bom_adelaide_summary_5
                entity_temperature: sensor.bom_adelaide_air_temp_c
                style: |
                  ha-card {
                    --ha-card-background: rgba(88,88,88,0.3)
                    
                  }
                title: BOM Weather
                type: 'custom:bom-weather-card'

I should add, that when I used the weather.yaml package, no card displayed so I manually added the code to the relevant .yaml files.

1 Like

can you check that sensor exists?

also the whole block looks to have it’s indenting off by 2 spaces…

sensors:
  bom_current_text:

etc.
You have 4 spaces.
the statistics platform should be indented 2 spaces… it has zero currently.

You also seem to have missed some more entries for the card or maybe you just haven’t shown them and the indenting doesn’t look right either.
Lastly the style… maybe leave that out till you get it working.
The other thing to check is that all the entities exist

im getting some issues with the sensor templates.

sensor.bom_current_text Unknown friendly_name: bom_current_text
sensor.bom_forecast_0 unknown°/unknown°/unknown% friendly_name: Today entity_picture: /local/icons/bom_icons/unknown.png
sensor.bom_forecast_1 unknown°/unknown°/unknown% friendly_name: Tomorrow (21/10) entity_picture: /local/icons/bom_icons/unknown.png
sensor.bom_forecast_2 unknown°/unknown°/unknown% friendly_name: Tuesday (22/10) entity_picture: /local/icons/bom_icons/unknown.png
sensor.bom_forecast_3 unknown°/unknown°/unknown% friendly_name: Wednesday (23/10) entity_picture: /local/icons/bom_icons/unknown.png
sensor.bom_forecast_4 unknown°/unknown°/unknown% friendly_name: Thursday (24/10) entity_picture: /local/icons/bom_icons/unknown.png
sensor.bom_forecast_5 unknown°/unknown°/unknown% friendly_name: Friday (25/10) entity_picture: /local/icons/bom_icons/unknown.png
sensor.bom_forecast_6 unknown°/unknown°/unknown% friendly_name: Saturday (26/10) entity_picture: /local/icons/bom_icons/unknown.png

but sensor.bom_redcliffe_summary_0 Morning fog then mostly sunny. attribution: Data provided by the Australian Bureau of Meteorology sensor_id: summary issue_time_local: 2019-10-20T16:20:00+10:00 product_id: IDQ10095 product_location: Brisbane start_time_local: 2019-10-20T05:00:00+10:00 icon: mdi:text product_name: Redcliffe

Check the template sensor in the package as you might have different names to me (I’m in Gosford). Either that or you don’t have the BOM core component working. Check in the states.

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

See my sensors are sensor.bo_gosford etc. You need to change them for your BOM station.

yep did all that and BOM core is up and working