Lovelace: Button card

Is there a code for iframe?

What do you mean?

@RomRider I still have the Alarm_away in my button state. Do I need to change the state to something else? I though you had a fix for it a few versions ago, but there are so many docs about this button that I couldnā€™t find it that quickly haha.

Argh, yeah it should be fixed (since 1.7.0), but apparently not for alarmā€¦ Iā€™ll need to look but I donā€™t have a alarm to test with :sweat_smile:

BTW, why is the first caracter in capital?

Make sure you are using the latest version (not in custom updater but on your disk) and if itā€™s still not working please open an issue on github so that I can trace it. Also post your config if you donā€™t mind :slight_smile:

1 Like

You can setup a manual one: https://www.home-assistant.io/components/manual/

1 Like

It is because I have used capitalize on the state.

@iantrich it is a manual alarm panel :stuck_out_tongue:

I was just letting @RomRider know that he could easily set one up without having to have a physical alarm

Iā€™m trying to get the ā€˜color the icon & shadowā€™ working using var(ā€“button-card-light-color) and it doesnā€™t appear to be working for me. These are not rgb lights, they are just normal dimmers.

Iā€™ve tried:

box shadow in the style -> card field w/ var(ā€“button-card-light-color)
box shadow in the state -> style -> card field w/ var(ā€“button-card-light-color)
-webkit-box-shadow in the style -> card field w/ var(ā€“button-card-light-color)
-webkit-box-shadow in the state -> style -> card field w/ var(ā€“button-card-light-color)
both in the style -> card field w/ var(ā€“button-card-light-color)
both in the state -> style -> card field w/ var(ā€“button-card-light-color)

anything special that I need to do to get it to work?

  custom_button_light_active_glow: &custom_button_light_active_glow
    type: "custom:button-card"
    layout: icon_label
    color: auto
    show_state: true
    show_name: true
    show_label: true
    styles:
      grid:
        - grid-template-rows: 30px auto 30px
      card:
        - border-radius: 15px
        - height: 105px
        - width: 105px
        - margin: 5px 5px 0px 0px
      icon:
        - align-self: end
        - height: 30px
        - width: 30px
      name:
        - justify-self: start
        - padding: 0px 10px
        - font-size: 13px
      label:
        - align-self: end
        - padding: 1px
        - font-size: 11px
        - font-weight: bold
        - font-family: Helvetica
      state:
        - font-size: 11px
        - font-family: Helvetica
        - text-transform: capitalize
        - font-weight: bold
        - align-self: end
        - justify-self: start
        - padding: 5px 10px
    state:
      - value: "on"
        styles:
          card:
            - --paper-card-background-color: rgba(40, 40, 40)
            - box-shadow: 0px 0px 20px 3px var(--button-card-light-color)
          name:
            - color: white
          state:
            - color: white
          label:
            - color: white
      - value: "off"
        styles:
          label:
            - color: rgba(0, 0, 0, 0.0)
    tap_action:
      action: toggle
    hold_action:
      action: more-info

EDIT: To me looking through the code, it looks like it should work but I donā€™t actually see the style in F12.

Just wanted to say thanks @RomRider for the amazing and quick turnaround on new features! This is by far the most versatile card Iā€™m using. Love it!

1 Like

Are you sure you donā€™t have caching issues and are you sure that the version used by HA on disk is the latest one? Iā€™m using your exact config and it works in FF, Chrome, Safari and Chrome Android. Can you test in a private browser (as this disables the cache the first time it loads)
Same for you @jimz011, caching?

@jimz011 @petro, I canā€™t reproduce any of your problems on the 1.8.0.

The value of the variable should be declared in the <button-card> style part, and itā€™s not as far as I can see in your screenshot. Youā€™re probably not using the latest version as this should ALWAYS be there now (itā€™s done by the button itself), whatever the entity is.

1 Like

Yup seemed to be a caching issue, oh well. I guess I will have to reinstall the app (again) as there is no way to clear the cache on an iphone with the app.

If you use custom_updater, use the /customcards/ instead of /local/ for your resources. This should disable the cache for those specific files.

/customcards/ is an alias for /local/ (= www folder on disk) so no need to change where the files are.

Had to have been a caching problem. Reloaded page w/ dev open and it fixed it :man_shrugging:

1 Like

Is it possible to change a inherited colors alpha channel?

Thatā€™s maybe something you should report to @robbiet480.

Yeah I will, would be handy if we could just clear the cache in the app. But so if I put /customcards/ as opposed to /local/ it should disable caching?

Yep, it should, thatā€™s how custom_updater is documented :slight_smile:

K that is great, I did manage to clear the cache though. I changed version number at resources. But shouldnā€™t custom updater do this automatically? Usually I do not have to clear the cache unless I change something manually.

Thanks for your input though, could be handy for troubleshooting, though I think a cached version would probably be less data hungry.

Or are there any benefits of using customcards instead of local?

No need for versions if you use the /customcards/ path.
Eg: mine is

- url: /customcards/custom-cards/button-card/dist/button-card.js
  type: module

And thatā€™s it, no version, and itā€™s usually never cached (sometimes I have to refresh twice instead of once)

It just disables the cache, but thatā€™s amazing for cards :slight_smile:

Ok I will definitely try that, I never knew that was possible. How about performance? I guess cached cards load up way much faster no?

Thank you @RomRider not only are you a great dev, but also a very likable person (as far as I can see that is). Very helpful and friendly. Thanks a lot!

1 Like