Some HACS installed Custom Cards not working

Hello, I’m new to Home Assistant and I am having a problem with adding custom cards. I am using HACS to install them, and two of the four are working.

The first two are working. The last two are not. After installing surveillance-card from HACS, I checked Lovelace - Manage Resources and all four are listed there. The cards that are not working do not show up when adding a new card, and when I add a manual card (by pasting, for example the YAML example listed in surveillance-card step 3 EXAMPLE YAML), I get “No card type configured”. The bar-card is working and hass-hue-icons is not a card, but it is also working.

I’ve restarted (and rebooted) the HA multiple times, I’ve purged internet browser cache, and I started troubleshooting at the lovelace_resources file under .storage

{
    "version": 1,
    "key": "lovelace_resources",
    "data": {
        "items": [
            {
                "url": "/hacsfiles/bar-card/bar-card.js?hacstag=163363577320",
                "type": "module",
                "id": "f16222c441ed4105af1f42f970bf2115"
            },
            {
                "url": "/hacsfiles/lovelace-battery-entity-row/battery-entity-row.js?hacstag=303857065131",
                "type": "module",
                "id": "12c3e6499dbc46c1a757ed72fbbb3bdb"
            },
            {
                "url": "/hacsfiles/hass-hue-icons/hass-hue-icons.js?hacstag=3844345221028",
                "type": "module",
                "id": "4a0414e5ab6f42639621f6acc46864be"
            },
            {
                "url": "/hacsfiles/surveillance-card/surveillance-card.js?hacstag=147764937005",
                "type": "module",
                "id": "37b97180df5b46d0968836d7b643b6f1"
            }
        ]
    }
}

Everything looks right, but I thought I would try and change the Managed Resources URL from /hacsfiles/ to /local/community/ (because I looked at the file system where www=local) and tried to go direct to the files which resulted in HACS saying that two modules are not loaded propery and reinstalled them. The types are supposed to module, so that all checks out.

All the searching I’ve found seems to say that doing it via HACS is the right way to go, but it doesn’t seem to be working for me. All other search results seem to reference the before time when modifying lovelace files directly was how to do it, but everything seems to discourage that now. Any thoughts on what I’m doing wrong?

HACS is updated to 1.13.2. HA is 2021.7.3. Any suggestions?

1 Like

To be sure /hacsfiles/ is a short-cut to /www/community/ so leaving the url as is should work.
I just tried adding the surveillance-card to my system. Everything works.
I’m not using the GUI to work with Lovelace. (I set my Lovelace mode to yaml and edit a ui-lovelace.yaml file to make my front end.)
To do that, I install the surveillance-card using HACS and then change my configuration.yaml file as follows:

# I had this already:
lovelace:
  mode: yaml
  resources:
    - url: /browser_mod.js
      type: module
    - url: /hacsfiles/button-card/button-card.js
      type: module
    - url: /hacsfiles/lovelace-layout-card/layout-card.js
      type: module
    - url: /hacsfiles/lovelace-swipe-navigation/swipe-navigation.js
      type: module
    - url: /local/decluttering-card.js
      type: module
    - url: /hacsfiles/simple-weather-card/simple-weather-card-bundle.js
      type: module
    - url: /hacsfiles/lovelace-card-mod/card-mod.js
      type: module
    - url: /hacsfiles/slider-button-card/slider-button-card.js
      type: module
# and I added this:
    - url: /hacsfiles/surveillance-card/surveillance-card.js
      type: module

If you’re using the GUI to work with Lovelace, go to Configuration | Lovelace Dashboards and click on the Resources tab, then add the resource as
URL: /hacsfiles/surveilance-card/surveilance-card.js
type: JavaScript Module
After I did that, I restarted Home Assistant and it all worked. It looks a bit wonky on a small screen (phone) but it’s all there.

1 Like

Thanks, I tried what you suggested. Thanks for the confirmation that /hacsfiles/ is a shortcut to /www/community. I assumed since the two other HACS addons were working that it was, but just wanted to confirm. Interesting about not using GUI for Lovelace. I am not quite ready to switch from GUI (because I wanna keep gui available for others in my household who said they would help with HA, but of course, haven’t yet, thus I am the only one doing stuff in Lovelace…)

I verified all the same configurations you have, but still no love on the lovelace for those two cards. Modules is set, and full restarts and reboots later, still nothing. Very odd.

Odd indeed. I’ll see if anything else comes to mind.
I held on to GUI Lovelace as long as possible but eventually I was doing all my editing in the Raw Configuration page anyway. I finally made the move to yaml only.
I did set up a separate view where I try out some of my ideas before putting them on the main view so my family doesn’t bear the brunt of my experimentation.

Yeah, I’m starting to think that I might wanna backup and rebuild. This is my first deploy of HA and I was mostly compelled by a rush to switch off of SmartThings. I did a lot of minimum viable product stuff and I think I’m at a point where I understand things well enough, can do a lot of stuff right this time (plus not have all the trial and error stuff). Maybe I did something wrong somewhere along the line and I just need to start fresh and try again. Thanks so much for your help and replies though.