Lovelace: Button card


Thank you for this! I found the error as well but hadn’t refreshed the cache.


Thanks for the example. This card might be useful in certain scenarios.


Thanks for the work !
Yesterday everything was ok, but this morning I have this error :
Custom element doesn't exist: button-card.
Any ideas ?


I’m getting this for another custom card too… So I guess its not relating to the card but something else going on…


This fixed a few custom cards for me.


Yeah, I did that one already :confused:


edit : it’s ok !
change first line of button-card.js
import { LitElement, html, } from '[email protected]/lit-element.js?module';
and delete cache


Wait, so does this mean Lovelace can’t run locally?

Does it always require an internet connection?


seems that way, for custom-cards. I believe the normal cards are ok without internet


is-it possible to store custom-cards local ?


That is well f#$%ed totally unacceptable.


Are you on 0.85.1? According to @thomasloven (in discord) it should have been fixed in that…


So don’t use custom cards then…


no…still on 0.84.6 I haven’t updated as I’m away at the moment and would rather be at home in case I need to SSH in to fix something. I am always rather wary of updates. Perhaps thats the reason for my custom-card issues elsewhere too :thinking:


I’d prefer not to use Lovelace at all but that’s not going to be an option. So custom cards will be required to replace my current functionality using Custom UI: Tiles.


Dunno. It’s weird that it only cropped up now and not before 0.85.1 though…


I only tried the dark-sky card for the first time yesterday. I didn’t have any other cards using these tools prior to that


I think you misunderstood what I said on discord.

The problem that’s been fixed with 0.85.1 is that resources weren’t saved in the GUI Raw editor.

The problem with some custom cards that some are experiencing right now is because unpkg - a repository of javascript packages - seems to be having problems.
In other words, the problems are due to the reliance of an external source (which also, yes, makes some custom cards depend on an internet connection).
I know some cards have had fixes already proposed by @iantrich to minimize this dependency, but it might take a while to roll them out.

For information, none of my plugins rely on unpkg or any external source except Home Assistant itself.

Edit: To be fair, The example code for custom cards in the developer documentation also uses unpkg, and that seems to be common practice among web developers - but I’m not one, so I wouldn’t know.


Ah thanks for clarifying. I did misunderstand.


If you read my post you’ll see that I am using conditional cards, and that it is working, but the issue is that some icons are not working