Lovelace: Button card

Hello Folks. I am still struggling with the transition to fire-dom-event. This popup works as a standard button card, but not as a custom button card. With the custom button card, the popup just, doesn’t popup. I’ll be supremely grateful if some kind and wise soul could please help me out!

Not working:

type: custom:button-card
icon: mdi:microsoft-xbox
name: Xbox Remote
layout: icon_name
tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    title: Xbox Remote
    card:
      type: vertical-stack
      cards:
        - type: horizontal-stack
          cards:
            - type: custom:button-card
              color_type: blank-card
            - type: custom:button-card
              color_type: blank-card
            - type: custom:button-card
              color_type: card
              color: rgb(223, 255, 97)
              icon: mdi:volume-plus
              tap_action:
                action: call-service
                service: media_player.volume_up
                service_data:
                  entity_id: media_player.xbox
            - type: custom:button-card
              color_type: card
              color: rgb(223, 255, 97)
              icon: mdi:volume-minus
              tap_action:
                action: call-service
                service: media_player.volume_down
                service_data:
                  entity_id: media_player.xbox
            - type: custom:button-card
              color_type: blank-card
            - type: custom:button-card
              color_type: blank-card
        - type: picture-elements
          image: >-
            data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjEwIiBoZWlnaHQ9IjkwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogPG1ldGFkYXRhPgogIDxyZGY6UkRGPgogICA8Y2M6V29yayByZGY6YWJvdXQ9IiI+CiAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgIDxkYzp0eXBlIHJkZjpyZXNvdXJ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A5Ljc0ODcgMi40NzM3IDIuOTAzOSA2LjgzNzEgMy4yNTcyIDkuNzQ4NyAwLjc4MzU4IDEuNTUxOC0xLjMxMzYgMi40MzUyLTMuMjQ5NiAyLjQzNTItNS4yODUzIDAtMi4wMjA0LTAuODkxMTMtMy45NDEtMi40MzUyLTUuMjQ2OXoiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9Ii43NjgyMiIgc3R5bGU9InBhaW50LW9yZGVyOnN0cm9rZSBmaWxsIG1hcmtlcnMiLz4KIDwvZz4KPC9zdmc+Cg==
          elements:
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Up
              style:
                top: 45.35%
                left: 14.3%
                width: 6.2%
                height: 15%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Down
              style:
                top: 74.7%
                left: 14.3%
                width: 6.2%
                height: 15%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Left
              style:
                top: 60%
                left: 8.05%
                height: 14.4%
                width: 6.4%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Right
              style:
                top: 60%
                left: 20.65%
                height: 14.4%
                width: 6.4%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: A
              style:
                top: 82.5%
                left: 80.05%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: X
              style:
                top: 60.0%
                left: 70.6%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: B
              style:
                top: 60.0%
                left: 89.5%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: 'Y'
              style:
                top: 37.9%
                left: 80.05%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.toggle
              service_data:
                entity_id: remote.xbox_remote
              style:
                top: 80.2%
                left: 47.2%
                width: 7%
                height: 16%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: media_player.play_media
              service_data:
                entity_id: media_player.xbox
                media_content_type: ''
                media_content_id: Home
              style:
                top: 22.2%
                left: 47.2%
                width: 13.4%
                height: 31.2%
                border-radius: 100%
                overflow: hidden

Working:

type: button
icon: mdi:microsoft-xbox
name: Xbox Remote 2
layout: icon_name
tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    title: Xbox Remote
    card:
      type: vertical-stack
      cards:
        - type: horizontal-stack
          cards:
            - type: custom:button-card
              color_type: blank-card
            - type: custom:button-card
              color_type: blank-card
            - type: custom:button-card
              color_type: card
              color: rgb(223, 255, 97)
              icon: mdi:volume-plus
              tap_action:
                action: call-service
                service: media_player.volume_up
                service_data:
                  entity_id: media_player.xbox
            - type: custom:button-card
              color_type: card
              color: rgb(223, 255, 97)
              icon: mdi:volume-minus
              tap_action:
                action: call-service
                service: media_player.volume_down
                service_data:
                  entity_id: media_player.xbox
            - type: custom:button-card
              color_type: blank-card
            - type: custom:button-card
              color_type: blank-card
        - type: picture-elements
          image: >-
            data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjEwIiBoZWlnaHQ9IjkwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1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m0zLjcxMDUgMS42NjctMS4wOTA5IDEuMDkwOWMxLjI1OTkgMS4wMTQgMS45ODk3IDIuNTQyOCAxLjk4OTcgNC4xNTYxYTUuMzc3NSA1LjM3NzUgMCAwIDEtNS4zNzc1IDUuMzc3NWMtMi45NjUzIDAtNS4zNzc1LTIuMzk2OC01LjM3NzUtNS4zNzc1IDAtMS42MDU2IDAuNzI5ODEtMy4xNDIgMS45ODItNC4xNjM3bC0xLjA4MzItMS4wODMyYy0yLjkxMTUgMi40NzM3LTMuMjY0OSA2LjgzNzEtMC43OTEyNiA5Ljc0ODcgMi40NzM3IDIuOTAzOSA2LjgzNzEgMy4yNTcyIDkuNzQ4NyAwLjc4MzU4IDEuNTUxOC0xLjMxMzYgMi40MzUyLTMuMjQ5NiAyLjQzNTItNS4yODUzIDAtMi4wMjA0LTAuODkxMTMtMy45NDEtMi40MzUyLTUuMjQ2OXoiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9Ii43NjgyMiIgc3R5bGU9InBhaW50LW9yZGVyOnN0cm9rZSBmaWxsIG1hcmtlcnMiLz4KIDwvZz4KPC9zdmc+Cg==
          elements:
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Up
              style:
                top: 45.35%
                left: 14.3%
                width: 6.2%
                height: 15%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Down
              style:
                top: 74.7%
                left: 14.3%
                width: 6.2%
                height: 15%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Left
              style:
                top: 60%
                left: 8.05%
                height: 14.4%
                width: 6.4%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: Right
              style:
                top: 60%
                left: 20.65%
                height: 14.4%
                width: 6.4%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: A
              style:
                top: 82.5%
                left: 80.05%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: X
              style:
                top: 60.0%
                left: 70.6%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: B
              style:
                top: 60.0%
                left: 89.5%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.send_command
              service_data:
                entity_id: remote.xbox_remote
                command: 'Y'
              style:
                top: 37.9%
                left: 80.05%
                width: 10.5%
                height: 24.4%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: remote.toggle
              service_data:
                entity_id: remote.xbox_remote
              style:
                top: 80.2%
                left: 47.2%
                width: 7%
                height: 16%
                border-radius: 100%
                overflow: hidden
            - type: service-button
              title: ''
              service: media_player.play_media
              service_data:
                entity_id: media_player.xbox
                media_content_type: ''
                media_content_id: Home
              style:
                top: 22.2%
                left: 47.2%
                width: 13.4%
                height: 31.2%
                border-radius: 100%
                overflow: hidden

Hi all
I am trying to make a simple (I think card) but can’t find the right way.
I have the following card and I want to just add the watts of a sensor

color: rgb(253, 106, 2)
color_type: label-card
name: Kid Room
type: custom:button-card

sensor = sensor.sonoff_1000fe3b9b_power

Ideally I would like to in the name to add the watts. like the example below

Kid room: 1.200 watts

Any help how I can get there?

image

you could of course have a look at the documentation which explains this: button-card/README.md at master · custom-cards/button-card · GitHub

did you try any of this?

Don’t set the width and the height, use aspect_ratio instead.

Dwains dashboard is based on button-card (for most of the buttons), you can find all the templates in his github repository.

Where do you want to display the temperature? Like the percentage of brightness (which is also supposed to draw a circle but doesn’t display it)?

Did you clear your cache? Make sure you do it on ALL your devices a’d also make sure you are running the latest version before that. Also try in private navigation mode, if it works there, it’s 200% a caching issue.

2 Likes

Hi
Temperature in the middle of the card/box. And maybe the possibility to add “C” for Celsius after?

hi,
for the fun of it, I am trying to have a custom-fields button spin, with a speed based on the actual fanspeed of an entity, sensor.argon_one_addon_fan_speed, and following the states it can have, as you see in the color template below

Of course I’ve read @Ildar_Gabdullin on Lovelace: mini graph card - #1706 by Ildar_Gabdullin but am still a bit stuck on how to move that to a button-card, so seek some assistance please…

this is my button:

Schermafbeelding 2021-06-24 om 23.56.26 Schermafbeelding 2021-06-25 om 09.55.54

template:
  - button_body
  - plot_list
entity: sensor.cpu_temperature
variables:
  plot_entities: >
    [[[ return [entity.entity_id,
                states['sensor.attic_sensor_calibrated_temperature'].entity_id
                ];
    ]]]
name: Cpu temp
custom_fields:
  fan:
    >
      [[[ return `<ha-icon icon=mdi:fan style='width:15px;color: var(--speed-color);'> </ha-icon>
          <span style='color: var(--primary-color);'>
          ${states['sensor.argon_one_addon_fan_speed'].state} % </span>`; ]]]

styles:
  custom_fields:
    fan:
      - font-size: 11px
      - font-weight: bold
      - padding: 0px 3px
      - position: absolute
      - right: 5%
      - top: 10%
      - --speed-color: >
          [[[ var speed = states['sensor.argon_one_addon_fan_speed'].state;
              var mapper = {0:'green',
                            1:'darkgreen',
                            3:'orange',
                            33:'orangered'
                            66:'maroon'}
              return mapper[speed] ? mapper[speed] : 'red' ; ]]]
state:
  - operator: '<'
    value: 50
    styles:
      card:
        - color: green
  - operator: '<'
    value: 60
    styles:
      card:
        - color: darkgreen
  - operator: '<'
    value: 70
    styles:
      card:
        - color: orange
  - operator: '<'
    value: 80
    styles:
      card:
        - color: maroon
  - default:
    styles:
      card:
        - color: red

appreciate a little help here, thanks!

Hi Marius, is it typo?

yep… C&P error, edited it now… sorry
I could of course also add it to a top variable, and use it in the styles for the color… same for the speed could be done:

      speed-rotation: >
          [[[ var speed = states['sensor.argon_one_addon_fan_speed'].state;
              var mapper = {0:'0',
                            1:'4s',
                            3:'3s',
                            33:'2s',
                            66:'1s'}
              return mapper[speed] ? mapper[speed] : '0.3s' ; ]]]

maybe the 0 should be taken out, and a condition on state not being 0 should be included.

that way I could use the variable speed-rotation in the animation?>

Trying to simulate your case, can I have a code for

template:
  - button_body
  - plot_list

?

sure, they’re all here

@RomRider immediately related to the post above, how can I use a top level variables:

variables:
  speed_color: >
    [[[ var speed = states['sensor.argon_one_addon_fan_speed'].state;
        var mapper = {0:'green',
                      1:'darkgreen',
                      3:'orange',
                      33:'orangered'
                      66:'maroon'}
        return mapper[speed] ? mapper[speed] : 'red' ; ]]]

in a custom fields style:

custom_fields:
  fan:
    >
      [[[ return `<ha-icon icon=mdi:fan style='width:15px;color: var(--speed-color);'> </ha-icon>
          <span style='color: var(--primary-color);'>
          ${states['sensor.argon_one_addon_fan_speed'].state} % </span>`; ]]]

replacing the color: var(--speed-color) which I use up to now, with color: variables.speed_color or even color: ${variables.speed_color} is unsuccessful unfortunately. Can’t this be done?

It would be very cool, because I would only need the 1 top variable, and use it in more places of course

UPDATE:
yes we can:

custom_fields:
  fan:
    >
      [[[ return `<ha-icon icon=mdi:fan style='width:15px;color: ` + variables.speed_color + `;'> </ha-icon>
          <span style='color: var(--primary-color);'>
          ${states['sensor.argon_one_addon_fan_speed'].state} % </span>`; ]]]

thanks to Ildar.

again typo - missing comma

I am still trying, wait a little…

no typo there…Color Theory

33:'orangered' COMMA
1 Like

oops… :blush: sorry… also the closing third ] was missing…

First, regarding color of fan’s icon:

variables:
  speed_color: |
    [[[ var speed = states['sensor.iiyama_ohm_fans_fan_1'].state;
        var mapper = {500:'green',
                      600:'darkgreen',
                      700:'orange',
                      800:'orangered',
                      900:'maroon'}
        return mapper[speed] ? mapper[speed] : 'yellow'; ]]]
...
custom_fields:
  fan: >
    [[[ return `<ha-icon icon=mdi:fan style='width:32px;color: ` + variables.speed_color + `;'> </ha-icon>
        <span style='color: var(--primary-color);'>
        ${states['sensor.iiyama_ohm_fans_fan_1'].state} rpm </span>`; ]]]

Note this:
color: ` + variables.speed_color + `;

Do not bother about “500,600,700”, “rpm”, that was for my testing case.

Also, note that your construction "mapper" works only for THESE values, i.e. for 500,600,700 - for 550, 650 it will return default value (this is not good)

A yes, that should work.

Thanks.
About the speeds: they are fixed in my fan add-on. So no worries about other speeds :wink:

That’s why I didn’t make a Template with <

1 Like

As for conditional rotation - add this style with card-mod, and define conditions for speeds:

type: custom:button-card
card_mod:
  style: |
    div#container > div#fan > ha-icon {
      animation: rotation 1s linear infinite;
    }
    @keyframes rotation {
      0% {
        transform: rotate(0deg);
      }
      100% {
        transform: rotate(360deg);
      }
    }

aaaaa
Do not bother about colors & font-sizes - that was changed while reverse-engineering your code))

1 Like

can we replace the ‘1s’ with a variables.speed_rotation?

and encapsulate it in a template:

if (states['sensor.argon_one_addon_fan_speed'].state != 0) return

You can define "1s" by using usual ways like:

                        animation:
                          {% if states('input_number.servicewithhistory_value')|int <= 250|int -%}
                          rotation 4s
                          {%- elif states('input_number.servicewithhistory_value')|int > 250|int and states('input_number.servicewithhistory_value')|int <= 500|int -%}
                          rotation 2s
                          {%- elif states('input_number.servicewithhistory_value')|int > 500|int and states('input_number.servicewithhistory_value')|int <= 750|int -%}
                          rotation 1s
                          {%- else -%}
                          rotation 0.3s
                          {%- endif %}
                          linear infinite;