Lovelace: Button card

Hi there,

is it me or is something broken right now?
For some reason it says:

custom card doesn’t exist: button-card.

I did not touch anything and it worked for weeks…
Is anyone else having this problem?

EDIT: Now it works again, after about 1 hour…

happened the other day. Came back after awhile, just an issue with the source location not been available.

The Light Card is difficult to tweak. I suspect the issue is with the card itself. Many have tried to tweak this card and failed.

Indeed, I also don’t get these icons working.

Same, mine just break randomly. Long-pressing and then selecting the action works; but just the tap no longer does, most of the time.

Hi All,

I would like to highly recommend an alternative to Button Card, one that is being actively developed, and whose developer is responsive!

It’s a follow-on from Custom UI: Tiles, and is a fully functional and separate LoveLace custom card that follows strongly in its original Tiles roots. It is very customisable and feature rich with what you can do!

Anyway, as a taster, this is what I’ve done with mine:
image

Discussion starts here: Custom UI: Tiles
Github here: https://github.com/rodrigofragadf/lovelace-cards/tree/master/tiles-card

5 Likes

most likely becuase the ‘@polymer/lit-element’ package this custom card depends on has been deprecated (@polymer/lit-element - npm)

Found a fix, you need to edit the the button-card.js file.

remove the ‘^’ from line 3 in the url (next to the version number 0.5.2)

} from 'https://unpkg.com/@polymer/lit-element@^0.5.2/lit-element.js?module';

becomes

} from 'https://unpkg.com/@polymer/[email protected]/lit-element.js?module';

if this does not fix it for you it is likely because HA has cached the js file. to force it to refresh add or increment the version number in your ui-lovelace.yaml
eg:

resources:
  - url: /local/button-card.js?v=1.0.5
2 Likes

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 'https://unpkg-gcp.firebaseapp.com/@polymer/[email protected]/lit-element.js?module';
and delete cache

1 Like

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.

1 Like

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