Home Assistant Community

Lovelace: Button card

#291

@elRadix, this is not @thomasloven’s card.
Have you tried to increment the version number in the resources section of ui-lovelace.yaml?
Also i had to hammer CTRL-F5 multiple times.

0 Likes

#292

Not having gone into the depths of the HA code yet is there a better example that could be used to that doesn’t make the cards rely on external sources?

0 Likes

#293

Hopefully, we will see most of these features become part of the official entity-button card and then we don’t have to rely on external resources for these basic features.

2 Likes

#294

For the ones that get errors since yesterday (custom:card not found) I just did this and it fixed the problem for me, go to your button-card.js file (default location /local/button-card.js, local is the www folder in your homeassistant installation) and edit the file with any text editor. Then replace line 3 with this address:

https://unpkg-gcp.firebaseapp.com/@polymer/[email protected]/lit-element.js?module

Then save and restart Home Assistant (don’t know if you have to restart it but I did it anyways :stuck_out_tongue:). When everything is back online refresh the page a few times as it will take a few tries. If it doesn’t clear out your browser cache and try again. They work fine for me now. Hope this helps.

1 Like

#295

Looks like someone have replaced the urls with localhost:5000? :rofl:

example for button card, weather card etc
https://unpkg.com/@polymer/[email protected]/lit-element.js?module=

its now:

import { PropertiesMixin } from "http://localhost:5000/@polymer/[email protected]^3.0.2/lib/mixins/properties-mixin.js?module"; import { camelToDashCase } from "http://localhost:5000/@polymer/[email protected]^3.0.2/lib/utils/case-map.js?module"; import { render } from "http://localhost:5000/[email protected]^0.10.0/lib/shady-render.js?module"; export { html, svg } from "http://localhost:5000/[email protected]^0.10.0/lib/lit-extended.js?module";

Its should be like previous version:
https://unpkg.com/@polymer/[email protected]/lit-element.js?module=

I see many custom cards tries to use the broken one at
https://unpkg.com/@polymer/[email protected]/lit-element.js?module=

Also same error for
https://unpkg.com/@polymer/[email protected]^0.6.4/lit-element.js?module

0 Likes

#296

I dropped a new release folks. It includes a fix to the cdn url and custom icon for states.

4 Likes

#297

I have just configured this card to use it as I could not change the colour of an input_boolean (using the core-card) when I switch on/off but this works GREAT!!

The only ‘issue’ is that I can’t edit this card when I use the new lovelace .storage mode.

0 Likes

#298

I agree but as per discussion earlier here I’m not going to hold my breath.

0 Likes

#299

Thank you!

0 Likes

#300

Thanks ! What do you think about storing local all the js files ?

0 Likes

#302

Reply, I just updated the card as it was broken. Now it’s fixed again tnx for that! But I have an input_boolean configured, now when I press the button this show up:

image

It didn’t before…how can I disable this popup?

Config:

    - type: "custom:button-card"
      name: Afwezig
      icon: mdi:account-arrow-right
      size: 60px
      color: rgb(28, 128, 199)
      #color_off: rgb(28, 128, 199)
      entity: input_boolean.scene_afwezig

Thaaanks :slight_smile:

0 Likes

#303

hi guys,

for some reason my custom buttons have started failing

i’m on 0.85 which i updated to on release, yet these buttons on stopped loading today

Capture

cards:
  - card_style: ''
color: var(--primary-text-color)
color_off: var(--disabled-text-color)
color_type: icon
default_color: var(--primary-text-color)
entity: script.tvvolumeup
icon: 'mdi:volume-plus'
name: TV Volume Up
size: 30%
type: 'custom:button-card'
  - card_style: ''
color: var(--primary-text-color)
color_off: var(--disabled-text-color)
color_type: icon
default_color: var(--primary-text-color)
entity: script.tvvolumedown
icon: 'mdi:volume-minus'
name: TV VOLUME DOWN
size: 30%
type: 'custom:button-card'
type: horizontal-stack

Could someone please help me

0 Likes

#304

fixed version now available (see a few posts further up)

1 Like

#305

I’ve replaced the .js card with your updated version and restarted yet it’s still the same

What am I doing wrong?

0 Likes

#306

did you delete cookies and all site data, cache?

1 Like

#307

I have now :slight_smile:
Thank you

1 Like

#308

YAY Updates!!! Thank you!

0 Likes

#309

try with :
action: toggle

0 Likes

#310

If I use hass.OS’s configure UI feature and hit edit on any of this cards they all get stuck loading. They work properly, just can’t edit them. Is there a fix for this?

0 Likes

#311

How do you know the cards work if you cannot edit the card’s settings? Which lovelace mode are you using?

0 Likes