Button-Card Issue

I’m fairly new to HA and have run into an issue for which I can’t seem to find a solution.

I installed button-card through HACS and everything seems to be in the right folder location. I restarted HA after installing and added the following to ui-lovelace.yaml:

resources:
  - url: /hacsfiles/weather-card/weather-card.js
    type: module

  - url: /hacsfiles/button-card/button-card.js
    type: module


      - type: custom:button-card
        entity: light.playroom

Unfortunately all I get is the following error:

Custom element doesn't exist: button-card.

type: 'custom:button-card'
entity: light.playroom

It took me a while to figure out how to get the weather one working but I can’t seem to find what is wrong with the button-card. I’ve tried clearing the browser cache and used different browsers but that has not resolved the problem.

Appreciate any help!

Thanks!

Resources should be in configuration.yaml if you’re using yaml mode for lovelace.
https://www.home-assistant.io/lovelace/dashboards-and-views/#adding-more-dashboards-with-yaml
How did you get the weather card working?

I moved the resources to the configuration.yaml file and now it’s working.

I’ve looked through so many posts and guides for HACS the weather-card and button-card components where that detail is not explicitly shown. I’m not sure how the weather-card was working as it was in the ui-lovelace.yaml file but now they’re both working.

Thanks for your help!