A different take on designing a Lovelace UI

Got new errors on my Update-Popup. :frowning:
If there is a new update for some hacs integration, i got this error:

And in my error logs are always three errors:

homeassistant.exceptions.TemplateError: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ states('sensor.template_other_updates') | int }}' but no default was specified

and:

TemplateError('ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ states('sensor.template_other_updates') | int }}' but no default was specified') while processing template 'Template("{{ states('sensor.template_other_updates') | int }}")' for attribute 'other_updates' in entity 'sensor.template_updates'
TemplateError('TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'') while processing template 'Template("{{ this.attributes.values() | sum }}")' for attribute '_attr_native_value' in entity 'sensor.template_updates'

But I think the last two are because of the first one.
If I update the hacs Integration, the popup error is gone, but the error in the system log is still there.

I had a similar error when I had no other updates defined. Check that all sensors that are used are working.

Thanks, I think this will fix that

I should start checking my logs…

2 Likes

Thanks a lot!
It works like a charm now. :slight_smile:

1 Like

@Mattias_Persson Is there any way to use a custom:button-card with a camera and have live preview on the button?
I tried using show_live_stream: true but it does not help.

Double clicking on button opens normal camera stream which is live, but on the button card it is a static image all the time, refreshing browser tab updates images, but it is never as a live preview on the button

          - type: custom:button-card
            entity: camera.dvoriste_straznji_dio_hd
            name: " "
            template:
              - camera
              - icon_unifi_cam
            tap_action:
              !include popup/camera_single.yaml

thank you André… but it doesn’t work. I’ve created a template file and adjusted the button-card in the ui yaml. But it shows always the mushroom light card.

I just can not manage it.

I’ve just started this week with your dashboard. Really great work.
Suddenly my left icons are a larger then the middle and left ones… Any idea how this has gone wrong?

I get this sometimes, refreshing or resizing the page tends to fix it for me, I think It is an issue with the side card used for media

if you update the template files, you also need to make a change to the dashboard.yaml for it to pick up the changes. or restart home assistant

your titles are prob too long, try this

1 Like

I don’t have any cameras, so I can’t test :slight_smile:

Hi,
i have this error with Update popup any one can help me to fix it plz :blush:

Made by mistake the full blur for media obviously :slight_smile:
however, how can one add the blur effect as “shadow”

The idea would be to have the shadow as an extension of the media thumbnail, instead of just a random color (I know how to do the random color using drop-shadow()

I tried to make an example in paint (Below)

I love the project!! Super clean and gorgeous! I’m new to HA! I was able to install hacs and get the dashboard, but it’s all in Swedish. How can I change the language to English? The only way to modify the dashboard is thru yaml?? Can’t I just use GUI?

Thanks and regards!

Yes you have to change the language in yaml

Check the repository to see if you have all the sensors needed for the update. You can go back a dozen or so posts because from time to time someone has such a problem.

It’s this

1 Like

Hello @Mattias_Persson, thanks for the great work on updates, it really simplified the management.
I just noticed one problem related to it in case someone is using a supervised install.
In that case when there’s an home assistant core update sensor update.home_assistant_core_update is activated and consequentially I can see the update counted twice in home_assistant and update_entities.

Do you think that it can be fixed? Here’s the involved code in version_updates.yaml

      - unique_id: updates
        state: >
          {{ this.attributes.values() | sum }}
        attributes:
          home_assistant: >
            {% set installed = states('sensor.current_version') %}
            {% set latest = states('sensor.home_assistant_versions_beta') if version(installed).beta else states('sensor.home_assistant_versions') %}
            {{ iif(version(latest) > version(installed) and '.' in installed and '.' in latest, 1, 0) }}
          update_entities: >
            {{ states.update | selectattr('state','eq','on') | list | count }}
          other_updates: >
            {{ states('sensor.template_other_updates') | int(0) }}

Thanks,
Davide

{{ states.update | selectattr('state','eq','on') | rejectattr('entity_id', 'match', 'update.home_assistant_core_update') | list | count }}
1 Like

thanks Mattias! this worked for the counter.
For anyone that may be interested this s how I fixed state_display that was still showing the update.

  // update entities
  Object.keys(states).forEach(key => {
    let s = states[key], e = s.entity_id, a = s.attributes;
    if (e.includes('update.') && s.state === 'on') {
      if (!e.includes('update.home_assistant_core_update')) {
        output += `<li><b><a href="#" onclick="window.open('${a.release_url}');">
        ${rename(a)}</a></b> ${a.installed_version} <b>&rarr;</b> ${a.latest_version}</li>`
      }
    }
  });

Davide