Mushroom Cards - Build a beautiful dashboard easily 🍄 (Part 1)

looks really really good, well done on this one. when you are finished do you think you could post a non-translated version (so maybe english as a base) think many people might want to use this one :wink:

here is a way to have it check what day it is today and set the color appropriately.

ha-card {
  {% set days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] %}
  {% set today = days[as_timestamp(now()) | timestamp_custom('%w') | int -1] %}
  {% set day = days[as_timestamp(state_attr('weather.openweathermap', 'forecast')[2].datetime) | timestamp_custom('%w') | int -1] %}
  {% if today == day %}
    background: #5596f6;
  {% else %}
    background: transparent;
  {% endif %}
}

you can of course include your other things like getting rid of the border, setting the height and width, etc.

1 Like

OfCourse when i will finish it i will post it in english.

For the color background, i am think that only the 1st box from the left in the forecast need to change just the color because its the day that we have today.

true. that is a good point.

if you wanted you could also have it be selections using for example input booleans as the entities to toggle, then have the graph update to show the graph for that day (if it is different). so then you would color the day based on the selection of the user instead.

1 Like

This is very nice idea, it will go in the todo list :slight_smile:

1 Like

Hello,
I thought I’d share the Solar information in case anyone else needs it.
- Mushroom card :mushroom:
- Apexcharts card :chart:
- Card mod :credit_card:
- Layout card
- Custom brand icons :information_source:

  1. More Inverter active power (W) - active and inactive status (pulses blue if active, gray if inverter does not detect sun and is not charging)
  2. PW Power summary for several inverters (W) – active and inactive status (orange if active, gray if not charging)
  3. Inverters with Daily yield display (kWh)
  4. Accumulator charge level
  5. Apexcharts - Return to Grid - Grid Consumption - Total Yield 24h. In the middle, current power is indicated with flow direction (the icon and text are green if there is an export and the icon and text are red if there is an import.
  6. Daily Grid Consumption (kWh)
  7. Return to grid (kWh)
  8. Daily Yield (kWh)

type: vertical-stack
cards:
  - type: custom:layout-card
    layout_type: grid
    layout:
      width: 100%
      grid-template-columns: 1fr 1fr 1fr
    cards:
      - type: custom:mushroom-template-card
        entity: sensor.sun2000_10ktl_active_power
        primary: 10KTL Inverter
        secondary: '{{(states(''sensor.sun2000_10ktl_active_power''))}} W'
        layout: vertical
        fill_container: false
        icon: |
          {% set state=states('sensor.sun2000_10ktl_device_status') %}
          {% if state=='On-grid' %}
          phu:huawei-solar-inverter
          {% elif state!='Standby:no irradiation' %}
          phu:huawei-solar-inverter
          {% endif %}
        icon_color: |
          {% set state=states('sensor.sun2000_10ktl_device_status') %}
          {% if state=='On-grid' %}
          #41bdf5
          {% elif state!='Standby:no irradiation' %}
          disabled
          {% endif %}
        secondary_info: state
        multiline_secondary: false
        badge_icon: ''
        badge_color: ''
        tap_action:
          action: more-info
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
                
                --shape-color: none !important;
                
                {% if is_state('sensor.sun2000_10ktl_device_status', 'On-grid') %}
                --shape-animation: blink 5s linear infinite;
                {% endif %}
              }
              @keyframes blink {
                  30% {opacity: 0;}
              }
            .: |
              ha-card {
                margin-top: 10px;
                --icon-size: 50px;
                --icon-symbol-size: 30px;
                --card-secondary-font-size: 10px;
                --card-primary-font-size: 12px;
                padding-top: 5px !important;
                padding-bottom: 5px !important;
              }
      - type: custom:mushroom-template-card
        entity: sensor.sun2000_6ktl_active_power
        primary: 6KTL Inverter
        secondary: '{{(states(''sensor.sun2000_6ktl_active_power''))}} W'
        layout: vertical
        fill_container: false
        icon: |
          {% set state=states('sensor.sun2000_6ktl_device_status') %}
          {% if state=='On-grid' %}
          phu:huawei-solar-inverter
          {% elif state!='Standby:no irradiation' %}
          phu:huawei-solar-inverter
          {% endif %}
        icon_color: |
          {% set state=states('sensor.sun2000_6ktl_device_status') %}
          {% if state=='On-grid' %}
          #41bdf5
          {% elif state!='Standby:no irradiation' %}
          disabled
          {% endif %}
        secondary_info: state
        multiline_secondary: false
        tap_action:
          action: more-info
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
                
                --shape-color: none !important;
                
                {% if is_state('sensor.sun2000_6ktl_device_status', 'On-grid') %}
                --shape-animation: blink 5s linear infinite;
                {% endif %}
              }
              @keyframes blink {
                  30% {opacity: 0;}
              }
            .: |
              ha-card {
                margin-top: 10px;
                --icon-size: 50px;
                --icon-symbol-size: 30px;
                --card-secondary-font-size: 10px;
                --card-primary-font-size: 12px;
                padding-top: 5px !important;
                padding-bottom: 5px !important;
              }
      - type: custom:mushroom-template-card
        entity: sensor.solar_inverter_daily_power
        primary: PV Power
        secondary: |-
          {% set state=states('sensor.solar_inverter_daily_power') %}
                {% if state | is_number and state | float > 0 %}
                  {{(states('sensor.solar_inverter_daily_power'))}} W
                {% elif state | is_number and state | float < 0 %}
                  {{(states('sensor.solar_inverter_daily_power'))}} W
                {% else %}
                  {{(states('sensor.solar_inverter_daily_power'))}} W
                {% endif %}
        layout: vertical
        fill_container: false
        icon: |-
          {% set state=states('sensor.solar_inverter_daily_power') %}
                {% if state | is_number and state | float > 5 %}
                  mdi:solar-panel-large
                {% elif state | is_number and state | float < 0 %}
                  mdi:solar-panel-large
                {% else %}
                  mdi:grid-off
                {% endif %}
        icon_color: |-
          {% set state=states('sensor.solar_inverter_daily_power') %}
                {% if state | is_number and state | float > 0 %}
                  #FFA500
                {% elif state | is_number and state | float < 0 %}
                  #9ACD32
                {% else %}
                  disabled
                {% endif %}
        secondary_info: state
        multiline_secondary: true
        tap_action:
          action: more-info
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
                
                --shape-color: none !important;
            .: |
              ha-card {
                margin-top: 10px;
                --icon-size: 50px;
                --icon-symbol-size: 30px;
                --card-secondary-font-size: 10px;
                --card-primary-font-size: 12px;
                padding-top: 5px !important;
                padding-bottom: 5px !important;
                --secondary-text-color:  {% set state=states('sensor.solar_inverter_daily_power') %} {% if state | is_number
                  and state | float > 100 %}
                  #9ACD32
                {% elif state | is_number and state | float < 0 %}
                  #f77c7c
                {% else %}
                  #A9A9A9
                {% endif %};
                }
              }
    card_mod:
      style: |
        ha-card {
          height: 150px;
        }
  - type: custom:layout-card
    layout_type: grid
    layout:
      width: 100%
      grid-template-columns: 1fr 2fr
      grid-template-rows: auto
      margin: 0px
      padding: 0px
    cards:
      - type: custom:stack-in-card
        cards:
          - type: custom:mushroom-entity-card
            entity: sensor.sun2000_10ktl_daily_yield
            icon: mdi:solar-power-variant
            icon_color: '#FFA500'
            hold_action:
              action: none
            primary_info: name
            secondary_info: state
            name: 10KTL
            card_mod:
              style: |
                :host {
                  --mush-card-primary-font-size: 12px;
                  --mush-card-secondary-font-size: 10px;
                }
                ha-card {
                  margin-top: -10px;
                  margin-right: -8px;
                }
          - type: custom:mushroom-entity-card
            entity: sensor.sun2000_6ktl_daily_yield
            icon_color: '#FFA500'
            icon: mdi:solar-power-variant
            hold_action:
              action: none
            primary_info: name
            secondary_info: state
            name: 6KTL
            card_mod:
              style: |
                :host {
                  --mush-card-primary-font-size: 12px;
                  --mush-card-secondary-font-size: 10px;
                }
                ha-card {
                  margin-top: -10px;
                  margin-right: -8px;
                }
          - type: custom:mushroom-entity-card
            entity: sensor.luna2000_battery_state_of_capacity
            icon_color: '#9ACD32'
            hold_action:
              action: none
            primary_info: name
            secondary_info: state
            name: Battery
            card_mod:
              style: |
                :host {
                  --mush-card-primary-font-size: 12px;
                  --mush-card-secondary-font-size: 10px;
                }
                ha-card {
                  margin-top: -10px;
                  margin-right: -8px;
                }
        card_mod:
          style: |
            ha-card {

              --ha-card-box-shadow: 0px;
            }
      - type: custom:stack-in-card
        cards:
          - type: custom:apexcharts-card
            experimental:
              color_threshold: true
            chart_type: radialBar
            graph_span: 5day1s
            span:
              end: day
            show:
              loading: false
            cache: true
            update_interval: 10min
            apex_config:
              chart:
                height: 250px
              plotOptions:
                radialBar:
                  offsetY: -20
                  startAngle: -135
                  endAngle: 135
                  hollow:
                    size: 45%
                  dataLabels:
                    name:
                      show: false
                    value:
                      show: false
              legend:
                show: false
              stroke:
                dashArray: 0
                lineCap: flat
            series:
              - entity: sensor.p1_teljes_energia_visszataplalas
                type: area
                name: CPU
                color_threshold:
                  - value: 0
                    color: rgb(183, 201, 145)
                  - value: 10
                    color: rgb(173, 199, 117)
                  - value: 30
                    color: rgb(154, 205, 50)
                group_by:
                  func: diff
                  duration: 1d
              - entity: sensor.p1_teljes_energia_vetelezes
                type: area
                name: RAM
                color_threshold:
                  - value: 0
                    color: rgb(245, 201, 201)
                  - value: 25
                    color: rgb(245, 154, 154)
                  - value: 35
                    color: rgb(247, 124, 124)
                group_by:
                  func: diff
                  duration: 1d
              - entity: sensor.solar_panel_total_yield
                type: area
                name: SSD
                color_threshold:
                  - value: 0
                    color: rgb(247, 210, 141)
                  - value: 15
                    color: rgb(247, 197, 104)
                  - value: 30
                    color: rgb(255, 165, 0)
                group_by:
                  func: diff
                  duration: 1d
            card_mod:
              style: |
                ha-card {
                  background: none;
                  --ha-card-box-shadow: 0px;
                }
          - type: custom:mushroom-template-card
            entity: sensor.p1_aktiv_teljesitmeny
            tap_action:
              action: more-info
            primary: |-
              {% set state=states('sensor.p1_aktiv_teljesitmeny') %}
                {% if state | is_number and state | float > 0 %}
                  - {{(states('sensor.p1_aktiv_teljesitmeny'))}} kWh
                {% elif state | is_number and state | float < 0 %}
                  {{(states('sensor.p1_aktiv_teljesitmeny'))}} kWh
                {% else %}
                  No data
                {% endif %}
            icon_color: |-
              {% set state=states('sensor.p1_aktiv_teljesitmeny') %}
                {% if state | is_number and state | float > 0 %}
                  #f77c7c
                {% elif state | is_number and state | float < 0 %}
                  #9ACD32
                {% else %}
                  disabled
                {% endif %}
            icon: |-
              {% set state=states('sensor.p1_aktiv_teljesitmeny') %}
                {% if state | is_number and state | float > 0 %}
                  mdi:transmission-tower-export
                {% elif state | is_number and state | float < 0 %}
                  mdi:transmission-tower-import
                {% else %}
                  mdi:transmission-tower-off
                {% endif %}
            layout: vertical
            card_mod:
              style: |
                :host {
                  --mush-card-primary-font-size: 12px;
                  --mush-icon-border-radius: 50%;
                  --mush-icon-size: 72px; 
                  --primary-text-color:  {% set state=states('sensor.p1_aktiv_teljesitmeny') %} {% if state | is_number
                  and state | float > 0 %}
                  #f77c7c
                {% elif state | is_number and state | float < 0 %}
                  #32CD32
                {% else %}
                  black
                {% endif %};
                }
                ha-card {
                  background: transparent;
                  margin-top: -112px;
                  width: 120px;
                  margin-left: auto;
                  margin-right: auto;
                }
  - type: custom:layout-card
    layout_type: grid
    layout:
      width: 100%
      grid-template-columns: 1fr 1fr 1fr
      grid-template-rows: auto
      margin: 0px
      padding: 0px
    cards:
      - type: custom:mushroom-template-card
        icon: mdi:transmission-tower-export
        layout: vertical
        primary: Grid Consumption
        icon_color: '#f77c7c'
        secondary: '{{(states(''sensor.energia_vetelezes_napi''))}} kWh'
        entity: sensor.energia_vetelezes_napi
        tap_action:
          action: more-info
        card_mod:
          style: |
            :host {
              margin-top: -10px;
              --mush-icon-size: 60px;
              --mush-card-primary-font-size: 12px;
              --mush-card-secondary-font-size: 10px;
            }
            mushroom-shape-icon {
              --shape-color: none !important; 
            }
            ha-card {
              padding-top: 5px !important;
              padding-bottom: 5px !important;
            }
        badge_icon: ''
        badge_color: ''
      - type: custom:mushroom-template-card
        icon: mdi:transmission-tower-import
        layout: vertical
        primary: Return to grid
        icon_color: '#9ACD32'
        tap_action:
          action: more-info
        secondary: '{{(states(''sensor.energia_visszataplalas_napi''))}} kWh'
        entity: sensor.energia_visszataplalas_napi
        card_mod:
          style: |
            :host {
              margin-top: -10px;
              --mush-icon-size: 60px;
              --mush-card-primary-font-size: 12px;
              --mush-card-secondary-font-size: 10px;
            }
            mushroom-shape-icon {
              --shape-color: none !important; 
            }
            ha-card {
              padding-top: 5px !important;
              padding-bottom: 5px !important;
            }
      - type: custom:mushroom-template-card
        icon: mdi:sun-wireless
        layout: vertical
        primary: Daily Yield
        icon_color: '#FFA500'
        tap_action:
          action: more-info
        secondary: '{{(states(''sensor.solar_panel_daily_yield''))}} kWh'
        entity: sensor.solar_panel_daily_yield
        card_mod:
          style: |
            :host {
              margin-top: -10px;
              --mush-icon-size: 60px;
              --mush-card-primary-font-size: 12px;
              --mush-card-secondary-font-size: 10px;
            }
            mushroom-shape-icon {
              --shape-color: none !important; 
            }
            ha-card {
              padding-top: 5px !important;
              padding-bottom: 5px !important;
            }


10 Likes

WLED control card

In this community post, I introduce a comprehensive Home Assistant configuration that enhances my lighting control and makes my WLED lighting more efficient. I will explain the code and the functions of each card step by step.

I also use the WLED Strip in this example as an Ambielight for my TV via Hyperion.ng. When I operate it in normal mode, I would like to have 2 different colours displayed, as it is aesthetically more appealing. Therefore it is divided into 2 segments (right and left). This map is based on this. You can of course adapt it to your liking. I hope you find a good use for it

Let’s dive in and discover how these cards optimize my lighting choices. Whether I’m a Home Assistant pro or just starting out, this post offers valuable insights to enhance my smart home experience.

1. Title Card:

image

This card is a custom title card that displays “AMBIELIGHT” as the title in the center of the card. It doesn’t have any tap actions.

type: vertical-stack
cards:
  - type: custom:mushroom-title-card
    title: A  M  B  I  E  L  I  G  H  T
    subtitle: ''
    alignment: center
    title_tap_action:
      action: none

2. Chips Card:

image

All of these chips are aligned in the center of the card. The chips provide quick access to various functions and information related to your WLED setup, making it a convenient control panel for your lighting system. The different icons and colors help to distinguish the chips and make them visually appealing.

  1. Arrow Left Chip:
  • Icon: mdi:arrow-left
  • Icon Color: Cyan
  • Action: When tapped, it opens a URL to the device configuration page within Home Assistant.
  1. Uptime Chip:
  • Entity: sensor.wledambie_uptime
  • Icon Color: Red
  • Content Info: Displays the state of the sensor.wledambie_uptime entity.
  1. Wi-Fi Signal Chip:
  • Entity: sensor.wledambie_wi_fi_signal
  • Icon Color: Green
  • Content Info: Displays the state of the sensor.wledambie_wi_fi_signal entity.
  1. Estimated Current Chip:
  • Entity: sensor.wledambie_estimated_current
  • Icon: mdi:flash-triangle-outline
  • Icon Color: Yellow
  • Content Info: Displays the state of the sensor.wledambie_estimated_current entity.
  1. Arrow Right Chip:
  • Icon: mdi:arrow-right
  • Icon Color: Cyan
  • Action: When tapped, it opens a URL to http://192.168.0.17/.
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        icon: mdi:arrow-left
        tap_action:
          action: url
          url_path: >-
            http://homeassistant.local:8123/config/devices/device/df8f160715eed439b5dd3e4cf60277fb
        icon_color: cyan
      - type: entity
        entity: sensor.wledambie_uptime
        icon_color: red
        content_info: state
      - type: entity
        entity: sensor.wledambie_wi_fi_signal
        icon_color: green
      - type: entity
        entity: sensor.wledambie_estimated_current
        icon: mdi:flash-triangle-outline
        icon_color: yellow
      - type: template
        icon: mdi:arrow-right
        tap_action:
          action: url
          url_path: http://192.168.0.17/
        icon_color: cyan
    alignment: center

3. Conditional Card:

image

This is a conditional card that displays an iframe if the master light (light.wledambie_master) is turned on. The iframe displays a live view from the device URL.

  - type: conditional
    conditions:
      - entity: light.wledambie_master
        state: 'on'
    card:
      type: iframe
      url: http://192.168.0.17/liveview
      aspect_ratio: 5%
      title: null

4. Grid of Template Cards:
[/wrap]
image

This part of the card is a grid that contains a set of custom template cards for controlling the master light.

Cards:

  • Power Control Card:
    • Icon: mdi:power
    • Icon Color: Green
    • Layout: Vertical
    • Entity: light.wledambie_master
    • Action: Toggles the ‘light.wledambie_master’ and targets ‘light.wledambie_links’ and ‘light.wledambie_rechts’. It uses an animation to pulse the icon based on the state of ‘light.wledambie_rechts’.
  • Sync sent Card:
    • Icon: mdi:upload-network-outline
    • Icon Color: Pink
    • Layout: Vertical
    • Entity: switch.wledambie_sync_send
    • Action: Toggles the ‘switch.wledambie_sync_send’ and uses an animation to pulse the icon based on the switch state.
  • Sync Recieve Card:
    • Icon: mdi:download-network
    • Icon Color: Purple
    • Layout: Vertical
    • Entity: switch.wledambie_sync_receive
    • Action: Toggles the ‘switch.wledambie_sync_receive’ and uses an animation to pulse the icon based on the switch state.
  • TV Ambient Light Card:
    • Icon: mdi:television-ambient-light
    • Icon Color: Orange
    • Layout: Vertical
    • Entity: light.hyph_ambie_tv
    • Action: Toggles the ‘light.hyph_ambie_tv’ and uses an animation to pulse the icon based on the light state.
  • Smoothening Card:
    • Icon: mdi:waveform
    • Icon Color: Turquoise
    • Layout: Vertical
    • Entity: switch.hyph_ambie_tv_component_smoothing
    • Action: Toggles the ‘switch.hyph_ambie_tv_component_smoothing’ in Hyperion and uses an animation to pulse the icon based on the switch state.
  • Restart Card:
    • Icon: mdi:restart
    • Icon Color: Red
    • Layout: Vertical
    • Entity: button.wledambie_restart
    • Action: Restarts the device
square: false
type: grid
cards:
  - type: custom:mushroom-template-card
    primary: ''
    icon: mdi:power
    icon_color: green
    layout: vertical
    secondary: ''
    entity: light.wledambie_master
    tap_action:
      action: call-service
      service: light.toggle
      target:
        entity_id:
          - light.wledambie_links
          - light.wledambie_rechts
      data: {}
    card_mod:
      style:
        mushroom-shape-icon$: |
          ha-icon {
            --icon-animation: {% if is_state('light.wledambie_rechts', 'on') %}pulse 3s infinite{% else %}none{% endif %};
          }
          @keyframes pulse {
            0% {
              transform: scale(1);
              opacity: 1;
            }
            50% {
              transform: scale(1.2);
              opacity: 0.5;
            }
            100% {
              transform: scale(1);
              opacity: 1;
            }
          }
  - type: custom:mushroom-template-card
    primary: ''
    icon: mdi:upload-network-outline
    icon_color: '#FF69B4'
    layout: vertical
    secondary: ''
    entity: switch.wledambie_sync_send
    tap_action:
      action: call-service
      service: switch.toggle
      target:
        entity_id: switch.wledambie_sync_send
      data: {}
    card_mod:
      style:
        mushroom-shape-icon$: |
          ha-icon {
            --icon-animation: {% if is_state('switch.wledambie_sync_send', 'on') %}pulse 3s infinite{% else %}none{% endif %};
          }
          @keyframes pulse {
            0% {
              transform: scale(1);
              opacity: 1;
            }
            50% {
              transform: scale(1.2);
              opacity: 0.5;
            }
            100% {
              transform: scale(1);
              opacity: 1;
            }
          }
  - type: custom:mushroom-template-card
    primary: ''
    icon: mdi:download-network
    icon_color: '#800080'
    layout: vertical
    secondary: ''
    entity: switch.wledambie_sync_receive
    tap_action:
      action: call-service
      service: switch.toggle
      target:
        entity_id: switch.wledambie_sync_receive
      data: {}
    card_mod:
      style:
        mushroom-shape-icon$: |
          ha-icon {
            --icon-animation: {% if is_state('switch.wledambie_sync_receive', 'on') %}pulse 3s infinite{% else %}none{% endif %};
          }
          @keyframes pulse {
            0% {
              transform: scale(1);
              opacity: 1;
            }
            50% {
              transform: scale(1.2);
              opacity: 0.5;
            }
            100% {
              transform: scale(1);
              opacity: 1;
            }
          }
  - type: custom:mushroom-template-card
    primary: ''
    icon: mdi:television-ambient-light
    icon_color: '#FFA500'
    layout: vertical
    secondary: ''
    entity: light.hyph_ambie_tv
    tap_action:
      action: call-service
      service: light.toggle
      target:
        entity_id: light.hyph_ambie_tv
    card_mod:
      style:
        mushroom-shape-icon$: |
          ha-icon {
            --icon-animation: {% if is_state('light.hyph_ambie_tv', 'on') %}pulse 3s infinite{% else %}none{% endif %};
          }
          @keyframes pulse {
            0% {
              transform: scale(1);
              opacity: 1;
            }
            50% {
              transform: scale(1.2);
              opacity: 0.5;
            }
            100% {
              transform: scale(1);
              opacity: 1;
            }
          }
  - type: custom:mushroom-template-card
    primary: ''
    icon: mdi:waveform
    icon_color: '#40E0D0'
    layout: vertical
    secondary: ''
    entity: switch.hyph_ambie_tv_component_smoothing
    tap_action:
      action: call-service
      service: switch.toggle
      target:
        entity_id: switch.hyph_ambie_tv_component_smoothing
    card_mod:
      style:
        mushroom-shape-icon$: |
          ha-icon {
            --icon-animation: {% if is_state('switch.hyph_ambie_tv_component_smoothing', 'on') %}pulse 3s infinite{% else %}none{% endif %};
          }
          @keyframes pulse {
            0% {
              transform: scale(1);
              opacity: 1;
            }
            50% {
              transform: scale(1.2);
              opacity: 0.5;
            }
            100% {
              transform: scale(1);
              opacity: 1;
            }
          }
  - type: custom:mushroom-template-card
    primary: ''
    icon: mdi:restart
    icon_color: red
    layout: vertical
    secondary: ''
    entity: button.wledambie_restart
    tap_action:
      action: call-service
      service: switch.toggle
      target:
        entity_id: switch.wledambie_restart
    card_mod:
      style:
        mushroom-shape-icon$: |
          ha-icon {
            --icon-animation: {% if is_state('switch.hyph_ambie_tv_component_smoothing', 'on') %}pulse 3s infinite{% else %}none{% endif %};
          }
          @keyframes pulse {
            0% {
              transform: scale(1);
              opacity: 1;
            }
            50% {
              transform: scale(1.2);
              opacity: 0.5;
            }
            100% {
              transform: scale(1);
              opacity: 1;
            }
          }
columns: 6

5 Segment Entities Card:

Folded

image

Unfolded

image

This card is designed to control the brightness of two light segments. It allows you to adjust the brightness of the specified light entities within a foldable row.

type: entities
entities:
  type: custom:fold-entity-row
  head:
    type: custom:mushroom-light-card
    entity: light.wledambie_master
    layout: horizontal
    primary_info: none
    secondary_info: none
    show_brightness_control: true
    collapsible_controls: true
    icon_type: none
    use_light_color: true
  entities:
    type: custom:mushroom-light-card
    entity: light.wledambie_links
    use_light_color: true
    show_brightness_control: true
    primary_info: none
    secondary_info: none
    layout: horizontal
    collapsible_controls: true
    icon_type: entity-picture
    type: custom:mushroom-light-card
    entity: light.wledambie_rechts
    use_light_color: true
    show_brightness_control: true
    primary_info: none
    secondary_info: none
    layout: horizontal
    collapsible_controls: true
    icon_type: entity-picture
show_header_toggle: true

6. Grid of Light Cards

image

This grid contains custom light cards for controlling the ‘light.wledambie_links’ and 'light.wledambie_rechts

  • Type: Grid
  • Columns: 2
  • Cards:
    • Links Light Card: A custom card for controlling the ‘light.wledambie_links’.
      • Icon: mdi:arrow-collapse-left
      • Icon Color: Varies based on the RGB color of the entity.
    • Rechts Light Card: A custom card for controlling the ‘light.wledambie_rechts’.
      • Icon: mdi:arrow-collapse-right
      • Icon Color: Varies based on the RGB color of the entity.
square: false
type: grid
cards:
  type: custom:mushroom-light-card
  entity: light.wledambie_links
  icon: mdi:arrow-collapse-left
  use_light_color: true
  primary_info: none
  secondary_info: none
  show_brightness_control: false
  name: Links
  layout: vertical
  collapsible_controls: true
  card_mod:
    style: |
      ha-card {
        {% set r = state_attr(config.entity, 'rgb_color')[0] %}
        {% set g = state_attr(config.entity, 'rgb_color')[1] %}
        {% set b = state_attr(config.entity, 'rgb_color')[2] %}
        background: rgba( {{r}}, {{g}}, {{b}}, 0.2 );
      }
  type: custom:mushroom-light-card
  entity: light.wledambie_rechts
  icon: mdi:arrow-collapse-right
  use_light_color: true
  primary_info: none
  secondary_info: none
  show_brightness_control: false
  layout: vertical
  name: Rechts
  collapsible_controls: true
  fill_container: false
  card_mod:
    style: |
      ha-card {
        {% set r = state_attr(config.entity, 'rgb_color')[0] %}
        {% set g = state_attr(config.entity, 'rgb_color')[1] %}
        {% set b = state_attr(config.entity, 'rgb_color')[2] %}
        background: rgba( {{r}}, {{g}}, {{b}}, 0.2 );
      }
columns: 2

7. Horizontal Stack with Select Cards:

image

This horizontal stack contains two custom select cards for choosing color palettes and presets

  • Type: Horizontal Stack
  • Cards:
    • Color Palette Select Card:
      • Entity: select.wledambie_color_palette
    • Preset Select Card:
      • Entity: select.wledambie_preset
type: horizontal-stack
cards:
  type: custom:mushroom-select-card
  entity: select.wledambie_color_palette
  primary_info: none
  icon_color: deep-purple
  secondary_info: none
  layout: horizontal
  type: custom:mushroom-select-card
  entity: select.wledambie_preset
  layout: horizontal
  primary_info: none
  secondary_info: none

8. Grid of Number Cards:

image

This grid contains two custom number cards for adjusting intensity and speed

  • Type: Grid
  • Columns: 1
  • Cards:
    • Intensity Number Card:
      • Entity: number.wledambie_intensity
    • Speed Number Card:
      • Entity: number.wledambie_speed
square: false
type: grid
cards:
  type: custom:mushroom-number-card
  entity: number.wledambie_intensity
  primary_info: none
  fill_container: false
  display_mode: slider
  layout: horizontal
  secondary_info: none
  icon_color: orange
  type: custom:mushroom-number-card
  entity: number.wledambie_speed
  layout: horizontal
  secondary_info: none
  primary_info: none
  icon_color: deep-orange
columns: 1

This configuration has taken my smart home experience to a new level, and I hope it provides valuable inspiration for all of you.

PS:Here is the entire code to copy and use in the lovelace interface

type: vertical-stack
cards:
  - type: custom:mushroom-title-card
    title: A  M  B  I  E  L  I  G  H  T
    subtitle: ''
    alignment: center
    title_tap_action:
      action: none
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        icon: mdi:arrow-left
        tap_action:
          action: url
          url_path: >-
            http://homeassistant.local:8123/config/devices/device/df8f160715eed439b5dd3e4cf60277fb
        icon_color: cyan
      - type: entity
        entity: sensor.wledambie_uptime
        icon_color: red
        content_info: state
      - type: entity
        entity: sensor.wledambie_wi_fi_signal
        icon_color: green
      - type: entity
        entity: sensor.wledambie_estimated_current
        icon: mdi:flash-triangle-outline
        icon_color: yellow
      - type: template
        icon: mdi:arrow-right
        tap_action:
          action: url
          url_path: http://192.168.0.17/
        icon_color: cyan
    alignment: center
  - type: conditional
    conditions:
      - entity: light.wledambie_master
        state: 'on'
    card:
      type: iframe
      url: http://192.168.0.17/liveview
      aspect_ratio: 5%
      title: null
  - square: false
    type: grid
    cards:
      - type: custom:mushroom-template-card
        primary: ''
        icon: mdi:power
        icon_color: green
        layout: vertical
        secondary: ''
        entity: light.wledambie_master
        tap_action:
          action: call-service
          service: light.toggle
          target:
            entity_id:
              - light.wledambie_links
              - light.wledambie_rechts
          data: {}
        card_mod:
          style:
            mushroom-shape-icon$: |
              ha-icon {
                --icon-animation: {% if is_state('light.wledambie_rechts', 'on') %}pulse 3s infinite{% else %}none{% endif %};
              }
              @keyframes pulse {
                0% {
                  transform: scale(1);
                  opacity: 1;
                }
                50% {
                  transform: scale(1.2);
                  opacity: 0.5;
                }
                100% {
                  transform: scale(1);
                  opacity: 1;
                }
              }
      - type: custom:mushroom-template-card
        primary: ''
        icon: mdi:upload-network-outline
        icon_color: '#FF69B4'
        layout: vertical
        secondary: ''
        entity: switch.wledambie_sync_send
        tap_action:
          action: call-service
          service: switch.toggle
          target:
            entity_id: switch.wledambie_sync_send
          data: {}
        card_mod:
          style:
            mushroom-shape-icon$: |
              ha-icon {
                --icon-animation: {% if is_state('switch.wledambie_sync_send', 'on') %}pulse 3s infinite{% else %}none{% endif %};
              }
              @keyframes pulse {
                0% {
                  transform: scale(1);
                  opacity: 1;
                }
                50% {
                  transform: scale(1.2);
                  opacity: 0.5;
                }
                100% {
                  transform: scale(1);
                  opacity: 1;
                }
              }
      - type: custom:mushroom-template-card
        primary: ''
        icon: mdi:download-network
        icon_color: '#800080'
        layout: vertical
        secondary: ''
        entity: switch.wledambie_sync_receive
        tap_action:
          action: call-service
          service: switch.toggle
          target:
            entity_id: switch.wledambie_sync_receive
          data: {}
        card_mod:
          style:
            mushroom-shape-icon$: |
              ha-icon {
                --icon-animation: {% if is_state('switch.wledambie_sync_receive', 'on') %}pulse 3s infinite{% else %}none{% endif %};
              }
              @keyframes pulse {
                0% {
                  transform: scale(1);
                  opacity: 1;
                }
                50% {
                  transform: scale(1.2);
                  opacity: 0.5;
                }
                100% {
                  transform: scale(1);
                  opacity: 1;
                }
              }
      - type: custom:mushroom-template-card
        primary: ''
        icon: mdi:television-ambient-light
        icon_color: '#FFA500'
        layout: vertical
        secondary: ''
        entity: light.hyph_ambie_tv
        tap_action:
          action: call-service
          service: light.toggle
          target:
            entity_id: light.hyph_ambie_tv
        card_mod:
          style:
            mushroom-shape-icon$: |
              ha-icon {
                --icon-animation: {% if is_state('light.hyph_ambie_tv', 'on') %}pulse 3s infinite{% else %}none{% endif %};
              }
              @keyframes pulse {
                0% {
                  transform: scale(1);
                  opacity: 1;
                }
                50% {
                  transform: scale(1.2);
                  opacity: 0.5;
                }
                100% {
                  transform: scale(1);
                  opacity: 1;
                }
              }
      - type: custom:mushroom-template-card
        primary: ''
        icon: mdi:waveform
        icon_color: '#40E0D0'
        layout: vertical
        secondary: ''
        entity: switch.hyph_ambie_tv_component_smoothing
        tap_action:
          action: call-service
          service: switch.toggle
          target:
            entity_id: switch.hyph_ambie_tv_component_smoothing
        card_mod:
          style:
            mushroom-shape-icon$: |
              ha-icon {
                --icon-animation: {% if is_state('switch.hyph_ambie_tv_component_smoothing', 'on') %}pulse 3s infinite{% else %}none{% endif %};
              }
              @keyframes pulse {
                0% {
                  transform: scale(1);
                  opacity: 1;
                }
                50% {
                  transform: scale(1.2);
                  opacity: 0.5;
                }
                100% {
                  transform: scale(1);
                  opacity: 1;
                }
              }
      - type: custom:mushroom-template-card
        primary: ''
        icon: mdi:restart
        icon_color: red
        layout: vertical
        secondary: ''
        entity: button.wledambie_restart
        tap_action:
          action: call-service
          service: switch.toggle
          target:
            entity_id: switch.wledambie_restart
    columns: 6
  - type: entities
    entities:
      - type: custom:fold-entity-row
        head:
          type: custom:mushroom-light-card
          entity: light.wledambie_master
          layout: horizontal
          primary_info: none
          secondary_info: none
          show_brightness_control: true
          collapsible_controls: true
          icon_type: none
          use_light_color: true
        entities:
          - type: custom:mushroom-light-card
            entity: light.wledambie_links
            use_light_color: true
            show_brightness_control: true
            primary_info: none
            secondary_info: none
            layout: horizontal
            collapsible_controls: true
            icon_type: entity-picture
          - type: custom:mushroom-light-card
            entity: light.wledambie_rechts
            use_light_color: true
            show_brightness_control: true
            primary_info: none
            secondary_info: none
            layout: horizontal
            collapsible_controls: true
            icon_type: entity-picture
    show_header_toggle: true
  - square: false
    type: grid
    cards:
      - type: custom:mushroom-light-card
        entity: light.wledambie_links
        icon: mdi:arrow-collapse-left
        use_light_color: true
        primary_info: none
        secondary_info: none
        show_brightness_control: false
        name: Links
        layout: vertical
        collapsible_controls: true
        card_mod:
          style: |
            ha-card {
              {% set r = state_attr(config.entity, 'rgb_color')[0] %}
              {% set g = state_attr(config.entity, 'rgb_color')[1] %}
              {% set b = state_attr(config.entity, 'rgb_color')[2] %}
              background: rgba( {{r}}, {{g}}, {{b}}, 0.2 );
            }
      - type: custom:mushroom-light-card
        entity: light.wledambie_rechts
        icon: mdi:arrow-collapse-right
        use_light_color: true
        primary_info: none
        secondary_info: none
        show_brightness_control: false
        layout: vertical
        name: Rechts
        collapsible_controls: true
        fill_container: false
        card_mod:
          style: |
            ha-card {
              {% set r = state_attr(config.entity, 'rgb_color')[0] %}
              {% set g = state_attr(config.entity, 'rgb_color')[1] %}
              {% set b = state_attr(config.entity, 'rgb_color')[2] %}
              background: rgba( {{r}}, {{g}}, {{b}}, 0.2 );
            }
    columns: 2
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-select-card
        entity: select.wledambie_color_palette
        primary_info: none
        icon_color: deep-purple
        secondary_info: none
        layout: horizontal
      - type: custom:mushroom-select-card
        entity: select.wledambie_preset
        layout: horizontal
        primary_info: none
        secondary_info: none
  - square: false
    type: grid
    cards:
      - type: custom:mushroom-number-card
        entity: number.wledambie_intensity
        primary_info: none
        fill_container: false
        display_mode: slider
        layout: horizontal
        secondary_info: none
        icon_color: orange
      - type: custom:mushroom-number-card
        entity: number.wledambie_speed
        layout: horizontal
        secondary_info: none
        primary_info: none
        icon_color: deep-orange
    columns: 1
view_layout:
  grid-area: left
card_mod:
  style: |
    ha-card {
      background: #1c1c1c;
      padding-left: 25px;
      padding-right: 25px;
      padding-bottom: 25px;
    }
```
12 Likes

I get an error when i turn off and on a wled led strip with segments. How did you get around this?

A bit off topic but if it requires further info than 1 reply can you send me a message please?

Oh, I totally misunderstood that. I based the avatars on the ios Messenger avatars and then post-processed them in Gimp.

I made a card animation

type: custom:stack-in-card
cards:
  - type: custom:mushroom-chips-card
    chips:
          - type: template
            icon: mdi:power-standby
            icon_color: red
            hold_action:
              action: none
            tap_action:
              confirmation:
                text: Power OFF?
              action: call-service
              service: homeassistant.stop
              service_data: {}
              target: {}
            card_mod:
              style: |
                ha-card {
                  animation: power 1.5s infinite; 
                }
                .shape {
                    --shape-color: none;
                }                  
                @keyframes power {
                  0%, 100% { clip-path: inset(0 0 0 0); }
                  50% { clip-path: polygon(0 0, 42% 0, 42% 58%, 58% 58%, 58% 0, 100% 0, 100% 100%, 0 100%); }
                }

how to animate an icon?

1 Like

I don’t understand it by looking at some.
Can you share the entire script

corrected the card

What kind of error? Do you have more information? I have divided the segments as shown in this picture:

I have 2 segments.

Works fine in WLED and actually works in HA, but when i change anything in HA for the segment i get an error like the below:


It does complete the action, but i get the error every time… which gets annoying as i am sure you can imagine.

Have you adapted the entities to your device id’s? Check Line1 column 867. That should be where the error is.

how am i supposed to adapt them? they are just named the default:
image

am i supposed to be changing it to something like this:
image

Kann ich in der Mushroom-Entity-Card den Namen anhand des Status ändern?
Zb. state = on / name = COMFORT

Hi, I’m trying to make me some room cards.
Anyone has an idea how I can remove the border of the middle orange mushroom climate card? I don’t succeed in removing it :exploding_head: :grin:

Code
type: custom:stack-in-card
mode: horizontal
cards:
  - type: custom:mushroom-template-card
    primary: Woonkamer
    icon: mdi:sofa
    tap_action:
      action: navigate
      navigation_path: null
    icon_color: blue
    multiline_secondary: false
    card_mod:
      style: |
        ha-card {
          --ha-card-background: none;
          --ha-card-box-shadow: none;
          --ha-card-border-width: 0;
            }
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-climate-card
        entity: climate.living
        icon: none
        show_temperature_control: false
        primary_info: none
        secondary_info: none
        layout: horizontal
        tap_action:
          action: more-info
        card_mod:
          style:
            mushroom-shape-icon$: |
              .shape:after {
                content: "{{ state_attr(config.entity, 'current_temperature')|replace('.', ',') }}°";
                font-size: 14px;
                font-weight: bolder;
                color: white;
                position: absolute;
              }
              .shape {
                {% set mode = state_attr(config.entity, 'hvac_action') %}
                --shape-color: rgba(var(--rgb-
                {%- if mode == 'heating' -%}
                  orange
                {%- elif mode == 'cooling' -%}
                  blue
                {%- else -%}
                  grey
                {% endif %}));
              }
            .: |
              mushroom-badge-icon:after {
                content: "{{ states('sensor.alpha2_heat_control_ezr012b5_glv_1_valve_opening') }}";
                position: absolute;
                display: flex;
                justify-content: center;
                align-items: center;
                background: rgb(var(--rgb-green));
                color: rgb(var(--rgb-white));
                border-radius: 50%;
                border-width: 0;
                top: 0;
                width: 100%;
                height: 100%;
                font-size: 0.7em; 
              }
            mushroom-badge-icon$: |
              .badge {
                {{ 'display: none !important;' if state_attr(config.entity, 'hvac_action') == 'idle' }}
      - type: custom:mushroom-template-card
        primary: null
        icon: mdi:lightbulb
        icon_color: >-
          {%if  expand(area_entities('woonkamer')) | selectattr ( 'domain' ,
          'eq' , 'light' ) | selectattr ( 'state' , 'eq' , 'on' ) | list | count
          > 0 %} amber {% else %} grey {% endif %}
        entity: light.all_lights
        badge_icon: none
        badge_color: transparent
        card_mod:
          style: |
            mushroom-badge-icon:after {
              content: "{{ expand(area_entities('woonkamer')) | selectattr ( 'domain' , 'eq' , 'light' ) | selectattr ( 'state' , 'eq' , 'on' ) | list | count}}";         
              position: absolute;
              display: flex;
              justify-content: center;
              align-items: center;
              background: rgb(var(--rgb-orange));
              color: var(--card-background-color);
              border-radius: 50%;
              top: 0;
              width: 100%;
              height: 100%;
              font-size: 0.8em; 
            }
            ha-card {
              --ha-card-border-width: 0;  
            }
      - type: custom:mushroom-template-card
        primary: null
        icon: mdi:window-shutter-open
        icon_color: >-
          {%if  expand(area_entities('woonkamer')) | selectattr ( 'domain' ,
          'eq' , 'cover' ) | selectattr ( 'state' , 'eq' , 'open' ) | list |
          count > 0 %} blue {% else %} grey {% endif %}
        entity: light.all_lights
        badge_icon: none
        badge_color: transparent
        card_mod:
          style: |
            mushroom-badge-icon:after {
              content: "{{ expand(area_entities('woonkamer')) | selectattr ( 'domain' , 'eq' , 'cover' ) | selectattr ( 'state' , 'eq' , 'open' ) | list | count}}";         
              position: absolute;
              display: flex;
              justify-content: center;
              align-items: center;
              background: rgb(var(--rgb-orange));
              color: var(--card-background-color);
              border-radius: 50%;
              top: 0;
              width: 100%;
              height: 100%;
              font-size: 0.8em; 
            }
            ha-card {
              --ha-card-border-width: 0;  
            }

Many thanks!

1 Like

Ok, unfortunately I still don’t understand it completely. Do you want to use the entire map? To use the template card to switch on and off, you should not select the segments, but rather the master of the WLED lamp. Here is the Code for turn the device on and off. As you can see, i selected the Master first, then the segments:
image

type: custom:mushroom-template-card
primary: ''
icon: mdi:power
icon_color: green
layout: vertical
secondary: ''
entity: light.wledambie_master
tap_action:
  action: call-service
  service: light.toggle
  target:
    entity_id:
      - light.wledambie_links
      - light.wledambie_rechts
  data: {}
card_mod:
  style:
    mushroom-shape-icon$: |
      ha-icon {
        --icon-animation: {% if is_state('light.wledambie_rechts', 'on') %}pulse 3s infinite{% else %}none{% endif %};
      }
      @keyframes pulse {
        0% {
          transform: scale(1);
          opacity: 1;
        }
        50% {
          transform: scale(1.2);
          opacity: 0.5;
        }
        100% {
          transform: scale(1);
          opacity: 1;
        }
      }

Is it possible to use a variable from the theme as the color for the icons?

If so; how can I do that based on the following?

- type: custom:mushroom-template-card
  icon: mdi:trash-can
  icon_color: >
    {% set type=state_attr('sensor.meerlanden_first_upcoming', "Upcoming_waste_types") %}
    {% if type == 'gft' %}
    var(--green)
    {% elif type == 'pmd' %}
    var(--peach)
    {% elif type == 'restafval' %}
    var(--gray)
    {% endif %}

Or do I HAVE to use card mod for this?
If so, is there a way to utilize if else in card mod?
I would prefer to avoid that route…

Hi, where can I find such a card?
I am looking for chip light card which can show the brightness % as a ring around the icon!

79a83bfc4148a1f45ad201d24da4f222d1e036ed

1 Like