Confused about lovelace resources

Tags: #<Tag:0x00007f7391f6a278>

Hi.
I have been a HA user for a long time, but for a long time I have just not had a lot of time doing stuff in my installation, and a lot of things has changed.

Today I tried to install the “Button State Card” in HACS, but it is not working.
In the GUI it is added as located in /hacsfiles/,all other old resources are in /community_plugin/
When I look at the yaml file, and the raw editor all three places are different. Can anyone tell me whats up?

Since you haven’t said, I will assume you are running the latest version of HA (113.x) and are using yaml mode for lovelace (or you wouldn’t be looking at the ui-lovelace.yaml)…

Since a few versions back all cards that are installed thru HACS are installed in the “/www/community/…” folder. Those are now referenced in the resources as “/hacsfiles/…”.

Also the resources no longer go in the ui-lovelace.yaml file. They now go in the configuration.yaml file under the “lovelace:” section.

Here is an example of my configuration.yaml:

lovelace:
  mode: yaml
  resources:
    - url: /local/lovelace/light-brightness-preset-row-2.js
      type: module
    - url: /local/lovelace/fan-control-entity-row-2.js
      type: module
    - url: /hacsfiles/aftership-card/aftership-card.js
      type: module
    - url: /hacsfiles/atomic-calendar-revive/atomic-calendar-revive.js
      type: module
    - url: /hacsfiles/bar-card/bar-card.js
      type: module

the first two cards aren’t loaded thru hacs so they still get referenced by the “loca/…” path.

My configuration.yaml doesn’t have any definition for ressources inside it.

When I need to add ressources I just use the GUI

Right. Because you haven’t made one yet.

Then you aren’t using yaml mode. So there’s no reason to be looking in the ui-lovelace.yaml file for anything. And they shouldn’t be in the raw lovelace configuration either.

All of you resources definitions (wherever they’re configured) aren’t correct for HACS installed files.

If it’s not already deprecated the “community_plugins/” endpoint will be deprecated soon. So you will want to switch those over to “hacsfiles/”.

Also as you can see from your screenshot above the “type: js” is being deprecated and will need to be switched to “type: module”.

@finity: I think you are confusing me with the OP :wink:
My remark was more to comment on your answer saying that the ressources declaration should be in the configuration.yaml.

I do have a configuration.yaml (but no ui-lovelace.yaml) and all my ressources are declared via the GUI.

Yaml mode requires it delcared in configuration.yaml inside the lovelace section:

lovelace:
  resources:
  ... blah...

declaring resources in lovelace-ui.yaml is being deprecated. It’s supposed to work, but doesn’t for some.

I must say I was not aware of that yaml mode. Having read about it your answers now make a lot more sense to me :slight_smile:

Oops!

You are completely right. Nevermind.

But to the OP…

All of my remarks are still valid.