rejuvenate / lovelace-horizon-card

Sun Card successor: Visualize the position of the Sun over the horizon.
MIT License
482 stars 35 forks source link

Config via yaml? #94

Closed Altycoder closed 1 year ago

Altycoder commented 1 year ago

I've followed the instructions but cannot get this working with HA in docker and dashboards in yaml.

I've created a 'www' directory under my HA config directory. Downloaded the .js file directly under '/config/www'

In configuration.yaml added:

lovelace:
  mode: yaml
  resources:
    - url: /www/lovelace-horizon-card.js #also tried /local/lovelace-horizon-card.js
      type: module

Added the following to my ui-lovelace.yaml:

title: home
views:
  - title: lights
    cards:
    - type: custom:horizon-card

restarted home assistant and I get a custom element does not exist error. I've tried registering the .js file via the HA GUI but can't do this as I have my dashboards in yaml. I've also tried refreshing and reloading resources in my dashboard via 3 dot menu, doesn't help.

Any ideas what I'm doing wrong?

Altycoder commented 1 year ago

Completely recreated my HA docker container and now it's working