Lovelace Card Preloader

Update the plugin, it’s working for me after latest update

1 Like

Nope, I’m good.

It was just an errant “/” in the URL

Thanks tho. :slightly_smiling_face:

Thanks for the heads up. It works now

In my ui-lovelace.yaml I have

preload:
  - hui-picture-elements-card
  - decluttering-card
  - picture-elements

This is the error I am getting
1

And this is how it looks in my conifg

      - type: horizontal-stack
        cards:
          - type: custom:decluttering-card
            template: parent_person
card:
    type: picture-elements
    image: '[[image]]'
    elements:
        - type: state-label
          entity: '[[last_seen]]'
          prefix: 'Last: '
          style: 
              color: red
              left: 35%
              top: 70%
              font-size: 16px
              line-height: 14px

I’m sure I’m doing something wrong and it’s probably a simple fix but I just can’t seem to figure it out. Anyone have any idea?
Thanks

how do you fix the error ?? @Jeremy_S

Cards should be referenced in the preload exactly the same as if you were referencing them in a card or view.

  • Custom cards (these probably don’t need preloading) should be “custom:cardname”. For example, for the Decluttering Card use "custom:decluttering-card"
  • Built-in cards can be reference in two ways
    • Just using cardname so for the Picture Elements card just use picture-elements
    • Using “custom:hui-cardname-card” so Picture Elements would be “custom:hui-picture-elements-card”

So, your configuration should just be either:

preload:
  - picture-elements

or

preload:
  - 'custom:hui-picture-elements-card'

The first one would be the cleaner way of doing it.

1 Like

Correct me if I’m wrong but do we need to preload built-in cardsonly if we use them in a non-standard way? I mean, if we just use them as described in the docs, they should work out of the box or there is a catch?

That’s correct, you should only need to preload them in one of these cases:

  1. You are using them in a non-standard way, for example using a built-in card as an entity row in an entities card like this:
type: entities
entities:
  - entity: sensor.battery_level
    type: 'custom:hui-gauge-card'
  1. You are using them in custom card that hasn’t been fully updated for the 0.107 changes (I believe the vertical-stack-in-card custom card is one of these).
1 Like

I’ve just released a new version (0.0.2). Not much has changed except that a couple of Node.js packages have been updated to fix some vulnerabilities and I have implemented some code which hides error messages from the console while preloading the cards.

This doesnt seem to work for me.
I just installed it from HACS, im using picture-elements in an entities-card.

I tried both

preload:
  - picture-elements

and

preload:
  - 'custom:hui-picture-elements-card'

and then refreshing the page/clearing cache, but i still get this


Am I missunderstanding anything?

What is the config of that card? With that I can try to replicate your issue and see what the problem is.

I didn´t use lovelace.yaml where i can put the code:

preload:
  - markdown
  -  gauge

?

Use the Lovelace RAW editor. Where you have shown it is correct.

what i showed you was lovelace raw editor…

@Steven_Rollason Thanks for this. The issue had been dirving me crazy.

And as I said, what you have done is correct.

That doesn’t seem to work for me

  1. Installed Car Preloader via HACS
  2. Added the following lines in ui-lovelace under resources:
  - url: /hacsfiles/lovelace-card-preloader/lovelace-card-preloader.js
    type: module

Tried to add

preload:
  - picture-glance

just before views. Still fails for me…
Here is an example of my cards:

cards:
  - !include /config/lovelace_views/persistent_notifications.yaml
  - !include /config/lovelace_views/alert_card.yaml
  - type: custom:vertical-stack-in-card
    cards:
    - type: gauge
      unit_of_measurement: '%'
      entity: sensor.cpu_usage
      severity:
        green: 0
        yellow: 50
        red: 85
    - type: history-graph
      entities:
        - sensor.cpu_usage

image
What am I missing?

Why picture-glance ?
The gauge card is missing, so

preload:
  - gauge

lol that’s because it was way past my bed time last night and I copied the wrong block to the wrong section
However even when correcting my mistake and setting

preload:
  - gauge

it still doesn’t work and I don’t really know where to look as I don’t seem to get anything in the logs… :frowning:

Use the new location instead https://www.home-assistant.io/lovelace/yaml-mode/#advanced-configuration