Skip to content

[Feature]: Template secondary information in Select card #1733

Open
@oneseventhree

Description

@oneseventhree

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

No

Describe the solution you'd like

Currently my Select card looks like this:

Image

where the secondary info is:

{{ is_state('binary_sensor.iphone_home', 'on') |
          iif(states('sensor.iphone_tracker_area') ~ " – " ~
          states('sensor.iphone_tracker_distance') ~ "m","Offline") }}

I am using card mod and other integrations to make it work but it would be great if the mushroom card did this:

type: custom:stack-in-card
cards:
  - type: vertical-stack
    cards:
      - type: custom:mushroom-title-card
        title: >-
          {{ is_state('binary_sensor.iphone_home', 'on') |
          iif(states('sensor.iphone_tracker_area') ~ " – " ~
          states('sensor.iphone_tracker_distance') ~ "m","Offline") }}
        subtitle: ""
        alignment: start
        subtitle_tap_action:
          action: none
        title_tap_action:
          action: none
        card_mod:
          style: |
            ha-card {
              margin-left: 43px;
              --title-font-size: 12px !important;
              border: none !important;
              margin-top: -3px;
              margin-bottom: -100px;
            }
      - type: custom:mushroom-select-card
        entity: input_select.room_dropdown
        icon: hue:room-attic
        name: Room
        secondary_info: name
        primary_info: name
        layout: horizontal
        tap_action:
          action: more-info
          entity: sensor.iphone_tracker_area
        hold_action:
          action: navigate
          navigation_path: /config/devices/device/308afc0e8644aaef48fbde8ac548c5d6
        card_mod:
          style:
            .: |
              ha-card {
                border: none;
                box-shadow: none;
                margin-top: -8px;
              }
            mushroom-state-info$: |
              .container {
                --card-secondary-color: transparent;
              }
visibility:
  - condition: state
    entity: input_select.room_dropdown
    state_not: "Off"

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions