Timer Custom Button Card - Add/Subtract time

You are using button cards inside the button card and from my experience templating doesn’t work well on the stacked button (custom fields) The good news is the stacked card doesn’t necessarily need to be a button card. I use a Mushroom Chip card when in this scenario. For yours I used a Mushroom template card.

I tested it and it worked well
chrome-capture-2024-3-21

type: custom:button-card
variables:
  my-timer: timer.maddie_quiettime
styles:
  grid:
    - grid-template-areas: '"time plus" "time minus"'
    - grid-template-columns: 3fr 1fr
    - grid-template-rows: 1fr 1fr
custom_fields:
  time:
    card:
      type: custom:button-card
      entity: timer.maddie_quiettime
      layout: icon_name_state2nd
      icon: mdi:bed-clock
      show_name: true
      show_icon: true
      show_state: true
      show_label: true
      name: Maddie Quiet Time
      tap_action:
        action: call-service
        service: timer.start
        service_data:
          entity_id: timer.maddie_quiettime
          duration: '00:10:00'
      hold_action:
        action: more-info
      card_mod:
        style: |
          ha-card {
            border: none;
            margin-top: 0px;
            margin-left: 0px;
          }
  plus:
    card:
      type: custom:mushroom-template-card
      entity: timer.maddie_quiettime
      icon: mdi:plus
      primary: 2 Min
      tap_action:
        action: call-service
        service: script.add_time_to_timer
        service_data:
          timer_entity: timer.maddie_quiettime
          minutes: 2
      icon_color: red
      card_mod:
        style: |
          ha-card {
           border: none;
             }
  minus:
    card:
      type: custom:mushroom-template-card
      entity: light.bed_lights
      icon: mdi:minus
      primary: 2 Min
      tap_action:
        action: call-service
        service: timer.change
        target:
          entity_id: timer.maddie_quiettime
        service_data:
          duration: '-00:2:00'
      icon_color: blue
      card_mod:
        style: |
          ha-card {
           border: none;
             }

1 Like