šŸŒ» Lovelace UI ā€¢ Minimalist

Hey all, just wanted to share a card I made for the remote domain. May be useful, especially since the Harmony integration has move activity switches to deprecated. The card functions like a lot of multi-row cards, where the second row is hidden unless needed (in this case, when the remote is on).

Ive added a few buttons as examples, but with variables these could be changed to whatever you want.

Template code

remote_large:
  show_icon: false
  show_name: false
  show_state: false
  styles:
    card:
      - border-radius: var(--border-radius)
      - box-shadow: var(--box-shadow)
      - padding: 12px
    grid:
      - grid-template-areas: |
          [[[
            var areas = "'remote'";
            if (entity.state == 'on'){
              areas = areas + " 'buttons'";
            }
            return areas;
          ]]]
      - grid-template-columns: 1fr
      - grid-template-rows: |
          [[[
            var rows = "min-content";
            if (entity.state == 'on'){
              rows = rows + " min-content";
            }
            return rows;
          ]]]
      - row-gap: |-
          [[[
            if (entity.state == 'on') {
                return "12px";
              } else {
                return "0px";
              }
          ]]]
    custom_fields:
      buttons:
        - display: |
            [[[
              if(entity.state == 'on') {
              return "block";
              }
              return "none";
            ]]]
  custom_fields:
    remote:
      card:
        type: "custom:button-card"
        template:
          - icon_info
        styles:
            card:
              - border: none
        tap_action:
          action: toggle
        entity: "[[[ return entity.entity_id ]]]"
        name: "[[[ return entity.attributes.friendly_name ]]]"
        label: >-
          [[[ 
              if (entity.state == 'on'){
                var etat = "On - " + (entity.attributes.current_activity);
              }else {
                var etat = "Off";
              }
              return etat ;
          ]]]
        state:
          - operator: template
            value: "[[[ return entity.state == 'on' ]]]"
            styles:
              icon:
                - color: "rgba(var(--color-green),1)"
              img_cell:
                - background-color: "rgba(var(--color-green),0.2)"
    buttons:
      card:
        type: "custom:button-card"
        styles:
            card:
              - padding: 0px
              - border: none
            grid:
              - grid-template-areas: '"item1 item2 item3 item4"'
              - grid-template-columns: 1fr 1fr 1fr 1fr
              - grid-template-rows: min-content
              - column-gap: 7px
        custom_fields:
          item1:
            card:
              icon: "mdi:power"
              type: "custom:button-card"
              template: widget_icon
              entity: "[[[ return entity.entity_id ]]]"
              tap_action:
                action: toggle
          item2:
            card:
              icon: "mdi:volume-off"
              type: "custom:button-card"
              template: widget_icon
              tap_action: 
                action: call-service
                service: input_button.press
                service_data:
                  entity_id: "[[[ return variables.remote_mute ]]]"
          item3:
            card:
              icon: "mdi:play"
              type: "custom:button-card"
              template: widget_icon
          item4:
            card:
              icon: "mdi:menu"
              type: "custom:button-card"
              template: widget_icon
              entity: "[[[ return variables.remote_activities]]]"
              tap_action:
                action: more-info

Example use

- type: custom:button-card
  template: remote_large
  entity: remote.great_room
  variables:
    remote_activities: select.great_room_activities
    remote_mute: input_button.remote_mute_great_room
1 Like

Hi, I am creating a Minimalist dashboard for my bathroom Sonoff NSPanel Pro. In the bathroom are two heated towel rails that can be turned ON/OFF with HA Switches. I think I need to create a custom card that can be used so that I can change the switch between ON, OFF or enable a schedule (already available as another switch).
I have not created a custom card before. I have read through the docs and looked at a couple of templates but a bit lost on the best place to start. Can someone recommend a good starting card or a resource to read etc.
BTW: I already have Minimalist installed and working with some standard cards and chips.
Much appreciated.

Thankyou!!! both binary sensor cards are fixed by doing this.

This looks like a scene card , thereā€™s a custom variant where scenes are rooms.

I hope wish that on 1 line I can have 2 scenes and 3 rooms

Hey guys,

Im getting this error, not sure when it popped up, I havenā€™t looked for a while

image

In the doco I can see there was a breaking change a while back, but I seem to have that set or am I reading this wrong?

In fact Im not really sure what this meansā€¦

show_last_changed is changed to be used as variable:

variables:
  ulm_show_last_changed: true

https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_binary_sensor_alert/#usage

I have that set and its still not working?

Any help would be awesome :slight_smile:

    cards:
      - type: "custom:button-card"
        template: card_binary_sensor_alert
        variables:
          ulm_card_binary_sensor_alert: true
          ulm_card_binary_sensor_alert_name: Dishwasher
          ulm_show_last_changed: true
        entity: binary_sensor.dishwasher_door

Hi all

I am having trouble getting my popup to work with browser_mod. I have followed all instructions at browser_mod and was able to fire up a popup when in developer tools calling the service browser_mod.popup.

can anyone guide me on what is wrong here?

Thank you!

        cards:
          # Level 1
          - type: "custom:button-card"
            template:
              - card_room
              - red_on
            name: Level 1
            icon: mdi:home-floor-1
            variables:
              label_use_temperature: false
              entity_1:
                entity_id: switch.living_room_group
                tap_action:
                  action: fire-dom-event
                  browser_mod:
                    service: browser_mod.popup
                    data:
                      dismissable: true
                      autoclose: false
                      title: Living Room
                      content: testing
                templates:
                  - yellow_on

after much trying, it looks like i cannot call browser_mod from within a variable/one of the four possible room card ā€¦ one of the four subiconsā€¦ I want to create a popup after click on the subiconsā€¦ is that possible?? thank you v much for ur helpā€¦

There was another breaking change, use

ulm_card_binary_sensor_show_last_changed

instead.

2 Likes

Yeah it seems the doco is wrong :frowning:

Thanks for that :slight_smile:

Hi everyone,

i have some new hue color lights and try to get the color palette working inside the popup. But i dont know which select entity i have to select?

Think its very simple but coudnt find anything about it.

Anyone a hint for this.

Thanks in advanced.

      - type: "custom:button-card"
        template: card_light_slider_collapse
        entity: light.hue_color_luster_1
        variables:
          ulm_card_light_name: Wohnzimmer
          ulm_card_light_enable_color: true
          ulm_card_light_force_background_color: true
          ulm_card_light_enable_popup: true
          ulm_card_light_color_palette: 

For some odd reason I need to restart HA every time after a change bluhgā€¦ anyone know how to solve this?

On struggle street with the custom person card , I donā€™t have a wifi device tracker for the ā€œimswel person wifi trackerā€. I assume that means i need to create a senor in my config. Anyone have some template code or other options?

i have the following error with the CAR card,

image

image

Screen Recording 2024-01-14 at 12.36.54 AM

why is the adapative ui doing thisā€¦ Iā€™m at the setup phase trying to do the most absolute vanilla thing with popup cards for lightsā€¦

popup.yaml

---
type: "custom:state-switch"
view_layout:
  grid-area: "popup"
  show:
    # only show when screen-width is larger than 1100px
    mediaquery: "(min-width: 1100px)"
# add your input_select
entity: input_select.minimalisthelper
default: default
transition: slide-down
transition_time: 1000
# options set in the input_select
states:
  #  Devices
  #  Lights
  light 1:
    type: "custom:button-card"
    template: "popup_light_brightness"
    entity: light.main_bedroom_dresser_lamp
    # variables:
    #   ulm_popup_light_entity: light.main_bedroom_dresser_lamp
  light 2:
    type: "custom:button-card"
    template: "popup_light_brightness"
    entity: light.main_bedroom_bed_lightstrip
    # variables:
    #   ulm_popup_light_entity: light.main_bedroom_bed_lightstrip
  light 3:
    type: "custom:button-card"
    template: "popup_light_brightness"
    entity: light.main_bedroom_dresser_lightstrip
    # variables:
    #   ulm_popup_light_entity: light.main_bedroom_dresser_lightstrip

  ## Rooms
  livingroom: !include "../views/livingroom.yaml"

main.yaml

---
type: "custom:layout-card"
layout_type: "custom:grid-layout"
layout:
  # Tablet portrait
  grid-template-columns: "1fr 1fr 1fr 1fr 1fr 1fr"
  grid-template-areas: |
    "welcome welcome welcome welcome welcome welcome"
    "card1 card1 card2 card2 card3 card3"

  mediaquery:
    # Mobile
    "(max-width: 800px)":
      grid-template-columns: "1fr 1fr"
      grid-template-areas: |
        "welcome welcome"
        "card1 card1"
        "card2 card2"
        "card3 card3"
view_layout:
  grid-area: "main"
cards:
  - view_layout:
      grid-area: "welcome"
    type: "custom:button-card"
    template: "card_esh_welcome"
    triggers_update: "input_boolean.minimalist_dropdown"
    variables:
      ulm_card_esh_welcome_collapse: input_boolean.minimalist_dropdown
      ulm_weather: "weather.1553"
      entity_1:
        nav: "Livingroom"
        icon: "mdi:lightbulb"
        name: "Lights"
        color: "yellow"
      entity_2:
        nav: "Livingroom"
        icon: "mdi:shield"
        name: Secure
        color: "green"
      entity_3:
        nav: "Livingroom"
        icon: "mdi:beaker"
        name: Lab
        color: "purple"
      entity_4:
        nav: "Livingroom"
        icon: "mdi:battery-70"
        name: Batteries
        color: "red"
      entity_5:
        nav: "Livingroom"
        icon: "mdi:music-circle"
        name: "Music"
        color: "blue"

  - view_layout:
      grid-area: "card1"
    type: "custom:button-card"
    template: "card_light"
    entity: light.main_bedroom_dresser_lamp
    variables:
      ulm_card_light_enable_slider: true
      ulm_card_light_enable_color: true
      ulm_card_light_enable_popup: true
      ulm_input_select_option: light 1
      ulm_input_select: input_select.minimalisthelper

  - view_layout:
      grid-area: "card2"
    type: "custom:button-card"
    template: "card_light"
    entity: light.main_bedroom_bed_lightstrip
    variables:
      ulm_card_light_enable_slider: true
      ulm_card_light_enable_color: true
      ulm_card_light_enable_popup: true
      ulm_input_select_option: light 2
      ulm_input_select: input_select.minimalisthelper

  - view_layout:
      grid-area: "card3"
    type: "custom:button-card"
    template: "card_light"
    entity: light.main_bedroom_dresser_lightstrip
    variables:
      ulm_card_light_enable_slider: true
      ulm_card_light_enable_color: true
      ulm_card_light_enable_popup: true
      ulm_input_select_option: light 3
      ulm_input_select: input_select.minimalisthelper

adaptive-ui.yaml

---
button_card_templates: !include_dir_merge_named "../../../custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/"

title: "Control"
theme: "minimalist-desktop"
icon: "mdi:tablet-dashboard"
background: "var(--background-image)"
views:
  - type: "custom:grid-layout"
    title: "home"
    icon: "mdi:home-outline"
    path: "0"
    layout:
      grid-template-columns: "1fr 1fr"
      grid-template-rows: "min-content"
      grid-template-areas: |
        "main popup"
      mediaquery:
        "(max-width: 1100px), (orientation: portrait)":
          grid-template-columns: "100%"
          grid-template-areas: "main"
    cards:
      - !include "views/main.yaml"
      - !include "popup/popup.yaml"

  - type: "custom:grid-layout"
    title: "Livingroom"
    icon: "mdi:sofa-single-outline"
    path: "Livingroom"
    layout:
      grid-template-columns: "1fr 1fr"
      grid-template-rows: "min-content"
      grid-template-areas: |
        "livingroom popup"
      mediaquery:
        "(max-width: 1100px), (orientation: portrait)":
          grid-template-columns: "100%"
          grid-template-areas: "livingroom"
    cards:
      - !include "views/livingroom.yaml"
      - !include "popup/popup.yaml"

already answered hereā€¦ I suspect the same fix might work for meā€¦

Actually I have another questionā€¦

Iā€™ve used auto-entities quite a bit in my regular dashboard. what will be really cool is if there was a way to to also generate the switch-states that wayā€¦

icon: "mdi:battery-70"
path: "batteries"
cards:
  - type: "custom:button-card"
    template: chip_back
    variables:
      ulm_chip_back_path: /ui-lovelace-minimalist/home
  - type: "custom:button-card"
    template: card_title
    name: Batteries
  - type: custom:auto-entities
    card:
      type: grid
      columns: 1
      square: false
    card_param: cards
    filter:
      include:
        - attributes:
            device_class: battery
          options:
            type: "custom:button-card"
            template: card_battery
            variables:
              ulm_card_battery_charger_type_entity_id: this.entity_id
              ulm_card_battery_battery_level_danger: 30
              ulm_card_battery_battery_level_warning: 80
    sort:
      method: state
      numeric: True
      reverse: False
      ignore_case: True

it allows me to do things like this:

Battery card name not working?

Am I doing something wrong here?

      - type: "custom:button-card"
        template: card_battery
        entity: sensor.balcony_door_battery
        variables:
          - ulm_card_battery_charger_type_entity_id: sensor.battery_level
          - ulm_card_battery_battery_level_danger: 20
          - ulm_card_battery_battery_level_warning: 40
          - ulm_card_battery_name: Balcony Door Battery

But I just get the name of the sensor not the firendly name?

image

anyone else having the same issues?

Mine look the same and work. Only difference is mine donā€™t have ā€™ - ā€™ prefix.

      - type: "custom:button-card"
        template: card_battery
        entity: sensor.study_temp_battery
        variables:
          ulm_card_battery_charger_type_entity_id: sensor.study_temp_battery
          ulm_card_battery_battery_level_danger: 20
          ulm_card_battery_battery_level_warning: 50
          ulm_card_battery_name: Study Temp Battery
1 Like

Has anyone gotten ulm_card_dynamic_color to work in the card_esh_room card?

if (variables.ulm_custom_card_esh_room_light_entity) {    // always null if the light is on
    var color = states[variables.ulm_custom_card_esh_room_light_entity].attributes.rgb_color;
    if (states[variables.ulm_custom_card_esh_room_light_entity].state == "on") {
      if (color && variables.ulm_card_dynamic_color) {
        return 'rgba(' + color + ', 0.2)';
      }
      return 'rgba(var(--color-background-yellow), 0.2)';    // this seems to trigger anyway if the light is on
    }
  }
  return 'var(--ha-card-background, var(--card-background-color, white))';

Iā€™ve tried debugging and inside the template, it seems both entity and variables.ulm_custom_card_esh_room_light_entity are null when I console.log them, if a light is switched on. If the light is off, they seem to work fine. The card is yellow when the light is on, but for RGB lights it does not use the light color for the card background.

Beautiful! Thank you that is what it was! All working now :slight_smile: