šŸŒ» Lovelace UI ā€¢ Minimalist

@Patonon

It looks like you donā€™t have any cards included in your configuration, but only the templates for the cards.
If you want to show some cards (and have a starting point) you should check the box Add some example data to the code when generating the code.

To make things clear. The code generator does not generate a UI for you. It only sets you up the create the ui more easily.

See the instruction above the generator for more information :wink:

Here you can generate the code you need to install this ā€œthemeā€ via UI-mode.

It bundles all necessary template data, language variables and custom-cards into one single block, so you can copy & paste it into your raw-config-editor.

Show instructions

  1. Select the language you want to use
  2. Select the custom-cards you want to install
  3. Select example data, if you want to have some example code added
  4. Click ā€œGenerate template codeā€
  5. The code will be generated and shows up in the textarea underneath the generate button
  6. Copy this code and paste it in your raw-config-editor
  7. See these instructions, if you donā€™t know where to paste this.
1 Like

I have these two memojis at the bottom of my overview dashboard. I wanted to make them go grey when the person was ā€œnot_homeā€. Tried this but it seems like itā€™s grey - no matter the state:

memoji-andre:
  entity: person.andre
  template: action_button_2
  entity_picture: /local/img/andre.png
  styles:
    img_cell:
      - box-shadow: none
  state:
    - value: 'not_home'
      styles:
        card:
          - filter: opacity(80%)
        icon:
          - filter: grayscale(100%)    
  tap_action:
    action: navigate
    navigation_path: home
  show_entity_picture: true
  show_name: false

memoji-martine:
  entity: person.martine
  template: action_button_2
  entity_picture: /local/img/martine1.png
  styles:
    img_cell:
      - box-shadow: none
  state:
    - value: 'home'
      styles:
        card:
          - filter: opacity(80%)
        icon:
          - filter: grayscale(100%)
  tap_action:
    action: navigate
    navigation_path: home
  show_entity_picture: true

At the moment both person are ā€œnot_homeā€ thatā€™s why I tried to set ā€œMartineā€ to greyscale when ā€œhomeā€ just to see if it would make her memoji show in color.

2 Likes

Myyyyyyyyyyy bad! Turns out Martine was home after all - and changing her state to ā€œnot_homeā€ showed ā€œhomeā€ in color :rofl:

Anyone know why my theme is not fullscreen? Iā€™m using the mobile theme.

The theme is not fullscreen per se. You either have to manually adjust the code for that or you can use an extension like Kiosk Mode.

1 Like

After playing around with this UI and reading through the forum, i was inspired by @clemalexā€™s 2 line button card and made one for my washing machine.
Note that this is a Samsung Washing Machine integrated in Home Assistant with SmartThings

Idle
image

Running
image

Remaining Time is calculated in a template:

template:
  - sensor:
      - unique_id: washer_remaining_time
        name: 'Remaining Time'
        state: >-
          {% set rem_h = (as_timestamp(states.sensor.washer_completion_time.state) - as_timestamp(now())) | timestamp_custom('%-H', false) %}
          {% set rem_m = (as_timestamp(states.sensor.washer_completion_time.state) - as_timestamp(now())) | timestamp_custom('%-M', false) %}
          {% if int(rem_h) > 0.9 %} {{ rem_h }} hour(s) and {{ rem_m }} minute(s)  {% else %} {{ rem_m }} minute(s) {% endif %}

The icons represtent the current job state in this order:

  • weightSensing
  • washing
  • rinse
  • spinning
  • drying

I think this could also be implemented with other washing machines, as soon as they have the required attributes.
Also i have build a automation for a push notification , if anyone is interested :slight_smile:
image

Code:

Lovelace

- type: 'custom:button-card'
  template: custom_washer_state_grid
  variables:
    ulm_custom_washer_grid_machine_state: switch.washer
    ulm_custom_washer_grid_job_state: sensor.washer_job_state
    ulm_custom_washer_grid_completion_timestamp: sensor.washer_remaining_time

Templates

custom_washer_state_job_state_grid_item_list:
    styles:
      card:
        - box-shadow: none
        - padding: 0px
        - border-radius: 'var(--border-radius)'
        - pointer-events: none
        - background-color: 'rgba(var(--color-theme), 0.05)'
        - justify-items: center
      grid:
        - grid-template-areas: '"item1 item2 item3 item4 item5"'
        - grid-template-columns: 1fr 1fr 1fr 1fr 1fr
        - grid-template-rows: min-content
        - column-gap: 7px
        - justify-items: center
      img_cell:
        - justify-items: center
custom_washer_state_grid_job_state_item_list_items:
    show_icon: true
    show_name: false
    size: 20px
    tap_action:
      action: none
    styles:
      card:
        - box-shadow: none
        - padding: 0px
        - border-radius: 50%
        - place-self: center
        - height: 42px
        - width: 42px
        - pointer-events: auto
        - background-color: transparent
      grid:
        - grid-template-areas: '"i"'
      icon:
        - color: var(--google-grey)
custom_washer_state_grid_state_item_list:
  styles:
    card:
      - box-shadow: none
      - padding: 0px
    grid:
      - grid-template-areas: '"item1 item2"'
      - grid-template-columns: 1fr 1fr
      - grid-template-rows: min-content
      - column-gap: 7px
custom_washer_state_grid:
  styles:
    card:
      - border-radius: 'var(--border-radius)'
      - box-shadow: 'var(--box-shadow)'
      - padding: 12px
    grid:
      - grid-template-areas: '"item1" "item2"'
      - grid-template-columns: 1fr
      - grid-template-rows: min-content  min-content
      - row-gap: 12px
  custom_fields:
    item1:
      card:
        type: custom:button-card
        template: custom_washer_state_grid_state_item_list
        custom_fields:
          item1:
            card:
              type: custom:button-card
              template:
                - icon_info
              entity: '[[[ return variables.ulm_custom_washer_grid_machine_state ]]]'
              icon: 'mdi:washing-machine'
              name: Washing machine
              tap_action:
                action: more-info
              label: 'not running'
              state:
                - value: 'on'
                  label: 'running'
                  styles:
                    icon:
                      - color: 'rgba(var(--color-blue), 1)'
                    img_cell:
                      - background-color: 'rgba(var(--color-background-blue), 0.2)'
          item2:
            card:
              type: conditional
              conditions:
                - entity: '[[[ return variables.ulm_custom_washer_grid_machine_state ]]]'
                  state: 'on'
              card:
                type: custom:button-card
                template:
                  - icon_info
                entity: '[[[ return variables.ulm_custom_washer_grid_completion_timestamp ]]]'
                icon: 'mdi:progress-clock'
                tap_action:
                  action: none
                label: '[[[ return states[variables.ulm_custom_washer_grid_completion_timestamp].state ]]]'
    item2:
      card:
        type: custom:button-card
        template: custom_washer_state_job_state_grid_item_list
        custom_fields:
          item1:
            card:
              type: custom:button-card
              icon: mdi:scale
              template: custom_washer_state_grid_job_state_item_list_items
              entity: '[[[ return variables.ulm_custom_washer_grid_job_state ]]]'
              state:
                - value: 'weightSensing'
                  styles:
                    icon:
                      - transform: scale(1.2)
                      - color: black
                    card:
                      - background-color: 'white'
          item2:
            card:
              type: custom:button-card
              icon: mdi:waves
              template: custom_washer_state_grid_job_state_item_list_items
              entity: '[[[ return variables.ulm_custom_washer_grid_job_state ]]]'
              state:
                - value: 'wash'
                  styles:
                    icon:
                      - transform: scale(1.2)
                      - color: black
                    card:
                      - background-color: 'white'
          item3:
            card:
              type: custom:button-card
              icon: mdi:water
              template: custom_washer_state_grid_job_state_item_list_items
              entity: '[[[ return variables.ulm_custom_washer_grid_job_state ]]]'
              state:
                - value: 'rinse'
                  styles:
                    icon:
                      - transform: scale(1.2)
                      - color: black
                    card:
                      - background-color: 'white'
          item4:
            card:
              type: custom:button-card
              icon: mdi:fan
              template: custom_washer_state_grid_job_state_item_list_items
              entity: '[[[ return variables.ulm_custom_washer_grid_job_state ]]]'
              state:
                - value: 'spin'
                  styles:
                    icon:
                      - transform: scale(1.2)
                      - color: black
                    card:
                      - background-color: 'white'
          item5:
            card:
              type: custom:button-card
              icon: mdi:tumble-dryer
              template: custom_washer_state_grid_job_state_item_list_items
              entity: '[[[ return variables.ulm_custom_washer_grid_job_state ]]]'
              state:
                - value: 'drying'
                  styles:
                    icon:
                      - transform: scale(1.2)
                      - color: black
                    card:
                      - background-color: 'white'

Automation

id: '1637957448045'
alias: Notify Washing maschine job state
description: ''
trigger:
  - platform: state
    entity_id: sensor.washer_job_state
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: sensor.washer_job_state
        state: none
action:
  - service: notify.notify
    data:
      title: šŸ§ŗ Washing machine state changed
      message: |-
        {% if is_state("sensor.washer_job_state", "weightSensing") %}
          Sensing load, program may be finished at approx. {{ as_timestamp(states('sensor.washer_completion_time')) | timestamp_custom('%H:%M') }}
        {% elif is_state("sensor.washer_job_state", "wash") %}
          Washing, program may be finished at approx. {{ as_timestamp(states('sensor.washer_completion_time')) | timestamp_custom('%H:%M') }}
        {% elif is_state("sensor.washer_job_state", "rinse") %}
          Rinsing, program may be finished at approx. {{ as_timestamp(states('sensor.washer_completion_time')) | timestamp_custom('%H:%M') }}
        {% elif is_state("sensor.washer_job_state", "spin") %}
          Spinning, program may be finished at approx. {{ as_timestamp(states('sensor.washer_completion_time')) | timestamp_custom('%H:%M') }}
        {% elif is_state("sensor.washer_job_state", "drying") %}
          Drying, program may be finished at approx. {{ as_timestamp(states('sensor.washer_completion_time')) | timestamp_custom('%H:%M') }}
        {% elif is_state("sensor.washer_job_state", "finish") %}
          Program finished, please empty the washing machine.
        {% else %}
          Unknown State, please check the washing machine!
        {% endif %}
mode: single

Feel free to use/edit/implement this :slight_smile: I would submit a pull request, but iā€™m not very familiar with github sadly.

29 Likes

It should be full-screen with the mobile-theme (with card-mod-root in the minimalist-mobile.yaml) , but somehow it broke in one stage: Theme: hide app-toolbar with card-mod issue Ā· Issue #47 Ā· UI-Lovelace-Minimalist/UI Ā· GitHub

2 Likes

Has anyone heard from @paddy0174 ? I hope he is doing well. Itā€™s been a while now (21 days :smiley: ) since he was last active on Giuthub

1 Like

I also check Github regularly to see if anything new is coming up. Unfortunately, there are no new updates from @paddy0174 at the moment.

Not sure if Iā€™m an idiot, but I have been looking at this for the last 3 hours and cannot get it to work.

I tried everything, did the installation from scratch.

button-card is installed.

button_card_templates: !include_dir_merge_named minimalist-templates/

views:
  - title: Minimalist
    resources:
        - url: /local/community/button-card/button-card.js
          type: module
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            template: edge
          - type: custom:button-card
            template: title
            name: Welcome to UI-Lovelace-Minimalist
          - type: custom:button-card
            template: edge
  - title: Minimalist page 2
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            template: edge
          - type: custom:button-card
            template: title
            name: UI-Lovelace-Minimalist second page
          - type: custom:button-card
            template: edge

Please help, about to cry of frustration

1 Like

Hey all!

Love this theme, been using it and adapting it to my setup since @tben originally posted it. Wanted to share a chip I added to my setup to display an Alarm state with a colored icon and State label. Itā€™s two templates: one for the labels and colors of the alarm state (chips_alarm) and another for styling this into a chip with an icon next to the label (chips_ icon_label). I thought about keeping this as one template, but I think the icon and label template may be useful for other chip types too.

Screenshot_20211130-203517_Home Assistant~2

Screenshot_20211130-203850_Home Assistant

chips_ alarm

chips_alarm:
  template:
    - chips
    - chips_icon_label   
  label: |
    [[[
      var alarm_label = 'unknown';
      if (entity.state == 'armed_home'){
        var alarm_label = 'Armed';
      } else if(entity.state == 'disarmed'){
        var alarm_label = 'Disarmed';
      }
      return alarm_label;
    ]]]
  icon: |
    [[[
      var alarm_icon = 'mdi:shield-outline';
      if (entity.state == 'armed_home'){
        var alarm_icon = 'mdi:shield-lock';
      } else if(entity.state == 'disarmed'){
        var alarm_icon = 'mdi:shield';
      }
      return alarm_icon;
    ]]]
  styles:
    icon:
      - color: |
          [[[
            var alarm_color = 'yellow';
            if (entity.state == 'armed_home'){
              var alarm_color = 'red';
            } else if(entity.state == 'disarmed'){
              var alarm_color = 'green';
            }
            return alarm_color;
          ]]]

chips_icon_label

chips_icon_label:
  show_icon: true
  show_name: false
  show_label: true
  size: 100%
  styles:
    card:
      - box-shadow: var(--box-shadow)
      - padding-top: 6px
      - padding-button: 6px
      - padding-left: 12px
      - padding-right: 6px
    grid:
      - grid-template-areas: '"i l"'
      - grid-template-columns: max_content auto
      - grid-template-rows: min-content
    img_cell:
      - place-self: center
      - width: 14px
      - height: 24px
    label:
      - justify-self: center
      - font-weight: bold
      - font-size: 12px
      - margin-left: 0px

After adding these two templates, all you need to do is use the chips_alarm template and give it an entity in the alarm domain.

3 Likes

The error seems to suggest that lovelace canā€™t find the button-card custom element. Your posted code shows the resource for it is in the lovelace dashboard, but thatā€™s not where it goes. It either goes in the resources part in the lovelace configuration menu (if using UI mode for lovelace) or in the configuration.yaml file (if using yaml mode for lovelace). Do you have a ui-lovelace.yaml file? If not, and you edit lovelace via UI or by going to raw editor in the UI, you should put it in the resources.

Also, Iā€™m guessing from your resource url you didnā€™t install this through hacs, correct? You may want to check the url path, as after local you should go to the folder itā€™s in, so unless you have a community folder in your root, it wonā€™t find it. If you did install via hacs, the url should be

/hacsfiles/button-card/button-card.js

Hello and thank you for sharing your custom card. Iā€™m new to all this of the home assistant and home automation. I would like to know how did you get the following:

1.     ulm_custom_washer_grid_machine_state: switch.washer
2.     ulm_custom_washer_grid_job_state: sensor.washer_job_state
3.     ulm_custom_washer_grid_completion_timestamp: sensor.washer_remaining_time
1.   is this the plug I'm using to power the washing machine? I have a sonoff s31 switch will this work?
2.  this one I don't know where to get it from.
3.  this one is the sensor template to calculate the time. 

Am I correct on number 1 and 3? Thank you for your time and help.

Thanks for your reply! I initially tried via HACS with no success.

I had that in my configuration.yaml but it didnā€™t work

I put it again and it still does not work.

Hereā€™s how it looks

lovelace:
  mode: storage
  resources:
    - url: /hacsfiles/button-card/button-card.js
      type: module
  dashboards:
    lovelace-minimalist:
      mode: yaml
      title: lovelace-minimalist
      icon: mdi:monitor-dashboard 
      show_in_sidebar: true 
      filename: lovelace-minimalist.yaml

Why do i keep getting ā€˜undefinedā€™ when I use the ā€˜Power Outlet Cardā€™ card?
image

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            template: edge
          - type: 'custom:button-card'
            template: card_power_outlet
            variables:
              ulm_card_power_outlet_consumption_sensor: sensor.metered_wall_plug_switch_power
            entity: switch.woonkamer_socket
            name: Power Outlet Livingroom
          - type: custom:button-card
            template: edge

The state of the switch is on.

If youā€™re in storage mode, it means youā€™re using the UI to edit lovelace, which means the resources needs to go into the resources section, not the configuration.yaml. I assume you donā€™t have a ui-lovelave.yaml file that you add the yaml to for your lovelace then, correct?

Hacs should add the resource when you installed the custom card, but if it didnā€™t you can add it yourself. Is hacs asking to restart or anything? Typically youā€™ll need to restart HA after installing a custom card. Iā€™d recommend trying the following:

  1. Make sure there is a folder and a .js file in that folder in the config/www/community/ for button card. If its not setup like that, hacs didnā€™t install it properly.
  2. Make sure there is a resource added for this under configuration - lovelace - resources. If itā€™s not there then lovelace wonā€™t be able to find/use it.
  3. Remove the resources yaml code from your configuration.yaml and your lovelace dashboardā€™s yaml code. If you are in storage mode (modifying lovelave via the UI and raw editor) you donā€™t need to add it to either location.
  4. Resart HA to get everything to reload/refresh.
  5. Open your dashboard, click the three vertical dots in the top right menu and reload the resources.

I think you havenā€™t added the language file EN.yaml (if you are using english). You should have EN.yaml inside the same folder as button_card_templates.yaml

If you are using any other language:
Installation of non-english languages

Thanks for the reply! Yes I do have that file with the correct strings.
image

@DrHouseIOT

The card is made for the Samsung washer. Therefore there might be some sensors that you will not be able to reproduce when using this card with a power plug.

  1. This is the sensor to determine whether the washer is on or off.
  2. The washer integration provides a job_state sensor. This sensor lets HA know what the washer is doing. E.g.: weighing, washing, spinning, drying. You will not have this sensor when using the power plug.
  3. The washer also provides a sensor for when the washer thinks he will be done. You can create your own sensor here based on the start time of your washer and the average runtime or something.

I hope this helps to clarify your questions :wink:

1 Like

@msmits2011

Okey, 2 more things that could go wrong then:

  1. Is the EN.yaml included in your lovelace configuration? How did you import the theme?
  2. Do you have a uml_on property in your EN.yaml?
1 Like