button-card icon indicating copy to clipboard operation
button-card copied to clipboard

Button-card template 'menu_button' is missing!

Open 400HPMustang opened this issue 9 months ago • 0 comments

Checklist

  • [X] I updated the card to the latest version available
  • [X] I cleared the cache of my browser

Describe the bug Building a button card, trying to use the template 'menu_button' and receive the error is missing. This happens when trying to build the simplest of cards but here is a complex configuration that doesn't build either.

Version of the card Version: 4.1.2

To Reproduce This is the configuration I used:

entities:
  - card_type: horizontal-stack
    cards:
      - entity: sensor.front_door_status_sc_2
        card_mod:
          style: |
            ha-card {
              {% if states('sensor.front_door_status_sc_2') == 'Locked' %}
                --card-mod-icon-color: green;
              {% elif states('sensor.front_door_status_sc_2') == 'Unlocked' %}
                --card-mod-icon-color: red;
              {% elif states('sensor.front_door_status_sc_2') == 'Open' %}
                --card-mod-icon-color: blue;
              {% elif states('sensor.front_door_status_sc_2') == 'Closed' %}
                --card-mod-icon-color: yellow;
              {% else %}
                --card-mod-icon-color: orange;
              {% endif %}
                 } 
        tap_action:
          action: call-service
          service: |
            [[[
              return (entity.state === 'Locked') ? 'lock.unlock' : 'lock.lock';
            ]]]
          service_data:
            entity_id: lock.front_door
        name: Front
        template: menu_button
        type: custom:button-card
      - entity: sensor.porch_door_status_sc
        card_mod:
          style: |
            ha-card {
                {% if states('sensor.porch_door_status_sc') == 'Locked' %}
                --card-mod-icon-color: green;
                {% elif states('sensor.porch_door_status_sc') == 'Unlocked' %}
                --card-mod-icon-color: red;
                {% elif states('sensor.porch_door_status_sc') == 'Open' %}
                --card-mod-icon-color: blue;
                {% elif states('sensor.porch_door_status_sc') == 'Closed' %}
                --card-mod-icon-color: yellow;
                {% else %}
                --card-mod-icon-color: orange;
                {% endif %}
                     }
        tap_action:
          action: call-service
          service: |
            [[[
              return (entity.state === 'Locked') ? 'lock.unlock' : 'lock.lock';
            ]]]
          service_data:
            entity_id: lock.deck
        name: Porch
        template: menu_button
        type: custom:button-card
      - entity: sensor.breezeway_door_status_sc
        card_mod:
          style: |
            ha-card {
                {% if states('sensor.breezeway_door_status_sc') == 'Locked' %}
                --card-mod-icon-color: green;
                {% elif states('sensor.breezeway_door_status_sc') == 'Unlocked' %}
                --card-mod-icon-color: red;
                {% elif states('sensor.breezeway_door_status_sc') == 'Open' %}
                --card-mod-icon-color: blue;
                {% elif states('sensor.breezeway_door_status_sc') == 'Closed' %}
                --card-mod-icon-color: yellow;
                {% else %}
                --card-mod-icon-color: orange;
                {% endif %}
                     }
        tap_action:
          action: call-service
          service: |
            [[[
              return (entity.state === 'Locked') ? 'lock.unlock' : 'lock.lock';
            ]]]
          service_data:
            entity_id: lock.breezeway
        name: Breezeway
        template: menu_button
        type: custom:button-card
      - entity: sensor.basement_door_status_sc
        card_mod:
          style: |
            ha-card {
                {% if states('sensor.basement_door_status_sc') == 'Locked' %}
                --card-mod-icon-color: green;
                {% elif states('sensor.basement_door_status_sc') == 'Unlocked' %}
                --card-mod-icon-color: red;
                {% elif states('sensor.basement_door_status_sc') == 'Open' %}
                --card-mod-icon-color: blue;
                {% elif states('sensor.basement_door_status_sc') == 'Closed' %}
                --card-mod-icon-color: yellow;
                {% else %}
                --card-mod-icon-color: orange;
                {% endif %}
                     }
        name: Basement
        tap_action:
          action: call-service
          service: |
            [[[
              return (entity.state === 'Locked') ? 'lock.unlock' : 'lock.lock';
            ]]]
          service_data:
            entity_id: lock.basement
        template: menu_button
        type: custom:button-card
    type: custom:hui-element
  - card_type: horizontal-stack
    cards:
      - entity: sensor.garage_door_status_sc
        card_mod:
          style: |
            ha-card {
                {% if states('sensor.garage_door_status_sc') == 'Locked' %}
                --card-mod-icon-color: green;
                {% elif states('sensor.garage_door_status_sc') == 'Unlocked' %}
                --card-mod-icon-color: red;
                {% elif states('sensor.garage_door_status_sc') == 'Open' %}
                --card-mod-icon-color: blue;
                {% elif states('sensor.garage_door_status_sc') == 'Closed' %}
                --card-mod-icon-color: yellow;
                {% else %}
                --card-mod-icon-color: orange;
                {% endif %}
                     }
        tap_action:
          action: call-service
          service: |
            [[[
              return (entity.state === 'Locked') ? 'lock.unlock' : 'lock.lock';
            ]]]
          service_data:
            entity_id: lock.garage
        template: menu_button
        name: Garage
        type: custom:button-card
      - entity: sensor.garage_east_door_status_sc
        card_mod:
          style: |
            ha-card {
              {% if states('cover.garage_door_2') == 'open' %}
                --card-mod-icon-color: red;
              {% elif states('cover.garage_door_2') == 'closed' %}
                --card-mod-icon-color: green;
              {% else %}
                --card-mod-icon-color: orange;
              {% endif %}
                 } 
        tap_action:
          action: call-service
          service: cover.toggle
          target:
            entity_id: cover.garage_door_2
        name: East
        template: menu_button
        type: custom:button-card
      - entity: sensor.garage_west_door_status_sc
        card_mod:
          style: |
            ha-card {
              {% if states('cover.garage_door') == 'open' %}
                --card-mod-icon-color: red;
              {% elif states('cover.garage_door') == 'closed' %}
                --card-mod-icon-color: green;
              {% else %}
                --card-mod-icon-color: orange;
              {% endif %}
                 } 
        tap_action:
          action: call-service
          service: cover.toggle
          target:
            entity_id: cover.garage_door
        name: East
        template: menu_button
        type: custom:button-card
      - entity: sensor.garage_shop_door_status_sc
        card_mod:
          style: |
            ha-card {
              {% if states('cover.sgarage') == 'open' %}
                --card-mod-icon-color: red;
              {% elif states('cover.sgarage') == 'closed' %}
                --card-mod-icon-color: green;
              {% else %}
                --card-mod-icon-color: orange;
              {% endif %}
                 } 
        tap_action:
          action: call-service
          service: cover.toggle
          target:
            entity_id: cover.sgarage
        name: Shop
        template: menu_button
        type: custom:button-card
    type: custom:hui-element
show_header_toggle: false
title: All Doors
type: entities


Screenshots If applicable, add screenshots to help explain your problem.

image

Expected behavior I would expect the card to compile without an error.

Desktop (please complete the following information):

  • Browser [Chrome]
  • Version [124.0.6367.208]

Smartphone (please complete the following information):

  • Device: [iPhone 14 Peo]
  • OS: [17.4.1]
  • Browser [safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

400HPMustang avatar May 24 '24 22:05 400HPMustang