bokub / rgb-light-card

💡 A Home Assistant card for RGB lights
MIT License
419 stars 24 forks source link

Custom element doesn't exist: rgb-light-card -- after installing via HACS #17

Closed wsw70 closed 4 years ago

wsw70 commented 4 years ago

I tried to install RGB Light Card via HACS, this went fine:

image

I then tried to add verbatim the example from the documentation to my ui-lovelace.yaml file (I added the previous two entries to match with the screenshot below):

- entities:
(...)
    - light.salon_bambou
    - light.salon_tete
    - type: 'custom:rgb-light-card'
      entity: light.salon_bambou
      colors:
          # Any option of the light.turn_on service can be used in each color
          - rgb_color:
                - 255
                - 127
                - 255
            brightness: 220
            transition: 1
          - hs_color:
                - 60
                - 30
            icon_color: '#fff8b0' # Override icon color

Unfortunately the component is not known:

image

It looks like, however, that it is installed at the right place:

/etc/docker/container-data/hass(master*) # ls                                                                                                                            root@srv
automations.yaml  configuration.yaml  deps              harmony_salon.conf  home-assistant_v2.db  ui-lovelace.yaml
configuration     custom_components   emulated_roku.py  home-assistant.log  known_devices.yaml    www

/etc/docker/container-data/hass(master*) # ls www/community/rgb-light-card/card.js                                                                                       root@srv
www/community/rgb-light-card/card.js

Not being knowledgeable with HACS (and so-so with HA), is there some other step to take in order to fix this? (I already restarted HA in case just adding a component via HACS would not be enough)

bokub commented 4 years ago

Looks like a HACS issue.. Can you click on "open plugin" and tell me if you see some code ?

image

If yes, are you sure you added the card to your Lovelace resources? Can you check in your raw config editor?

wsw70 commented 4 years ago

It turns out that I was missing

resources:
  - url: /community_plugin/rgb-light-card/card.js
    type: js

in the Lovelace config file (discovered that thanks to https://community.home-assistant.io/t/custom-element-doesnt-exist-rgb-light-card-after-installing-via-hacs/173981/2?u=wojwoj)

It works great now (thank you for the card BTW, it will be super useful)

Maybe it would be worthwhile to add that point to the configuration part in the docs?

bokub commented 4 years ago

Maybe it would be worthwhile to add that point to the configuration part in the docs?

  1. It's the exact same procedure for all custom cards so I usually expect users to have a minimum knowledge on this
  2. It's actually already explained in my documentation ("Installation" > 2.)
  3. You decided to use HACS which is a third party software, and I don't think it's my responsibility to teach users how to use it
  4. HACS warns you that you didn't add the card to your lovelace resources, and can even do it for your if you click the right button.
wsw70 commented 4 years ago

It is of course up to you but

It's the exact same procedure for all custom cards so I usually expect users to have a minimum knowledge on this

Well, that was my first custom card.

It's actually already explained in my documentation ("Installation" > 2.)

You are right - except if someone installs via HACS and I jumped (per the doc :)) to "Configuration".

To be frank I was so surprised to see that exact entry in the docs that I was wondering how I could have missed it - just to realize that I used HACS and skipped that part.

You decided to use HACS which is a third party software, and I don't think it's my responsibility to teach users how to use it

Of course not. The installation itself via HACS was not the issue. HACS worked great.

HACS warns you that you didn't add the card to your lovelace resources, and can even do it for your if you click the right button.

I did not get/see any warning but it is very possible there is a transcendent one.

All in all I think that this is just a matter of how user friendly (or rather "all-users friendly") the docs are. Some prefer more, some prefer less. You added a detailed installation part instead of just stating "install the card like any other" so I was thinking that you would be in the latter group.

Anyway - it works great, an issues is filled and closed so it may help others. Thanks again for that great card.