Customising the BOM Weather and lovelace - now in HACS

Well that sucks…
delete the .gz file and then edit line 68 so it reads like this

              ${summary} <br>${uv_alert} <br>${fire_danger}

Clear cache of course (I had to refresh a few times.
I wonder it it’s because of the length of the summary?

Alternate… try this…
line 26

    var summaryplus = html`${summary} ${uv_alert} ${fire_danger}`;

line 69

              ${summaryplus}

I deleted the gz file and inserted the breaks where you indicated. Refreshed, reloaded, tried a private window… still no UV or fire. Tried Firefox, Chrome and the Beta App (I did reset frontend cache).

Will try your alternate now.

makes no sense… there is no limit to string length in javascript

OK Ultra-dumb question… did you add the 2 new entities to the card in lovelace?

did you add the 2 new entities to the card in lovelace?

Did you tell me to? :slight_smile:

I was just about to ask about that. Hang on…

hahahaha… well probably not explicitely but the instructions for the card (in the up-front info.md you see when you install in HACS) say it… and the readme in the repo…
(The testing in this thread was really only about getting the ftp component working. Guess I assumed you’d see the info.md in hacs)

That was the problem.

I guess the real problem is that I only retrieve the instructions from the rubbish when something goes wrong. :smiley:

I should probably reinstall it to revert the changes made to the js.

1 Like

I would. I’ve reverted to that and won’t change the release on github.

Done and all good. Thanks!

1 Like

Anyone fancy it displaying like this?

If you have it in the list you can remove it from the bottom summary by not adding the entity to lovelace… Thoughts?

2 Likes

Yes please.

ok. Released 0.51. Make sure you add the new templates & lines in lovelace… even read info.md lol!!

Nice. Almost worked :slight_smile:

Should this:

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

Be using the templated uv sensor as …uv_alert_0 is sometimes unavailable? Like so:

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

uv_alert_1 is available now but uv_alert_0 is not and it is generating errors.

Maybe… I was using the raw one… I’ll take a look.

      bom_uv_alert_summary:
        value_template: >
            {%- if states('sensor.bom_gosford_uv_alert_0') != 'n/a' -%} 
            {% set val = states('sensor.bom_gosford_uv_alert_0').split('[')[1].split(']')[0]%}
            {{ val | title }}
            {%- else -%}
            {% set val = states('sensor.bom_gosford_uv_alert_1').split('[')[1].split(']')[0]%}
            {%- endif -%}

EDIT: Actually yours is better… I’ll amend github template and info/readme… I’ll have to do another release though so people see new docs. Doh!

That’s not what is in your instructions! :rofl:

I think you missed this bit from the readme:

            {%- else -%}
            {% set val = states('sensor.bom_gosford_uv_alert_1').split('[')[1].split(']')[0]%}
            {%- endif -%}

Edit, also I can’t work out why bom_fire_danger: appears to be enclosed in the wrong braces:

I think it’s just the brace matching extension stuffing up. Passes config check fine.

I don’t understand??? I think it’s fixed in HACS info.md and I fixed the weather package as well as the readme.md and just did a new release…

I’d be grateful if in the card repo you check info.md and readme.md and in the FTP component check the weather.yaml… Thanks Tom. I’m not using the slots so I didn’t notice… (well not after the day changed)

Yeah something still screwy:

README.md Github:

HACS:

Should be:

    bom_uv_alert_summary:
      value_template: >
        {%- if states('sensor.bom_hobart_uv_alert_0') != 'n/a' -%}
        {% set val = states('sensor.bom_hobart_uv_alert_0').split('[')[1].split(']')[0] %}
        {%- else -%}
        {% set val = states('sensor.bom_hobart_uv_alert_1').split('[')[1].split(']')[0] %}
        {%- endif -%}
        {{ val | title }}

I did clear my cache.

I am using your one… and it’s working…

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

HACS just shows info.md from the repo and it can be screwed cachewise… can you look at the repo.

Oh, sorry. I missed that you had changed to the templated version rather than …alert_uv_0. Both should work… I think.

My summary uv sensor has the correct shortened text but I cant get it to display in the slot. Still trying to work out why.

Dev tools states menu shows:

sensor.bom_uv_alert_summary: Very High

Lovelace:

    entity_uv_alert: sensor.bom_uv_alert
    entity_uv_alert_summary: sensor.bom_uv_alert_summary
...
    slot_r1: sun_next
    slot_r2: sun_following
    slot_r3: uv_alert_summary
    slot_r4: fire_summary

Screenshot_2019-11-21%20Home%20Assistant(1)

Slot_r3: uv_summary
I think…

Thank you. That was it.

You might want to adjust the readme, it says:

slot_r3: uv_summary
1 Like