🌻 Lovelace UI • Minimalist

Hey guys,

I’ve made a vacuum card to match the theme. Code below, should work with light/dark themes.

Minimalist

custom_card_vacuum:
  variables:
    ulm_custom_card_vacuum_name: "n/a"
  triggers_update: "all"
  styles:
    icon:
    #  - color: "rgba(var(--color-blue),0.7)"
    grid:
      - grid-template-areas: "'item1' 'item2'"
      - grid-template-columns: "1fr"
      - grid-template-rows: "min-content  min-content"
      - row-gap: "12px"
    card:
      - border-radius: "var(--border-radius)"
      - box-shadow: "var(--box-shadow)"
      - padding: "12px"

  custom_fields:
    item1:
      card:
        type: "custom:button-card"
        template:
          #  - "icon_info"
          - "card_generic_swap"
          - "ulm_language_variables"

        styles:
          card:
            - padding: "0px"
            - box-shadow: "none"
          icon:
            - color: "rgba(var(--color-blue),1)"
          img_cell:
            - background-color: "rgba(var(--color-blue),0.2)"

        tap_action:
          action: "more-info"
        entity: "[[[ return variables.ulm_custom_card_vacuum_entity ]]]"
        name: "[[[ return variables.ulm_custom_card_vacuum_name ]]]"

    item2:
      card:
        type: "custom:button-card"
        template: "list_3_items"
        custom_fields:
          item1:
            card:
              type: "custom:button-card"
              template: "widget_icon"
              tap_action:
                action: "call-service"
                service: "vacuum.start"
                service_data:
                  entity_id: "[[[ return variables.ulm_custom_card_vacuum_entity ]]]"
              icon: "mdi:play-outline"
          item2:
            card:
              type: "custom:button-card"
              template: "widget_icon"
              tap_action:
                action: "call-service"
                service: "vacuum.stop"
                service_data:
                  entity_id: "[[[ return variables.ulm_custom_card_vacuum_entity ]]]"
              icon: "mdi:stop"
          item3:
            card:
              type: "custom:button-card"
              template: "widget_icon"
              tap_action:
                action: "call-service"
                service: "vacuum.return_to_base"
                service_data:
                  entity_id: "[[[ return variables.ulm_custom_card_vacuum_entity ]]]"
              icon: "mdi:home"

5 Likes

Can you share ui?

To be sure: Your custom:layout-card is working?

So all I get when I try this is?

Unable to parse YAML: YAMLException: unknown tag !<!include> (13:80) 10 | ... 11 | ... 12 | ... 13 | ... tes/button_card_templates.yaml -----------------------------------------^

EDIT: Scratch that, not support in UI Mode, Copy and Pasted.

Can you pls share your .yaml config and folder structure @TJohnson93 .
Looks like you are not in yaml mode: Dashboards - Home Assistant (home-assistant.io)
“!” tags can only be parsed in lovelace yaml mode

Sorry @CM000n, was in UI mode and yeah just found in a reply to someone else, not supported. Ended up copy and pasting into Raw Config.

Great work with team on the HACS support btw… Exciting times.

I am trying to create something similar.

But where did you get this screenshot?

Hi, I did a sketch in Photoshop of the look I wanted. I see you are onto something quite similar.

Hello, I just started with this templates and is working good.
The Theme light and dark is also working good, the only thing is I use a Lenovo TAB M10+ with fully kiosk, and here the automatic light, dark mode is not working…
So is there a why to set the dark and light theme by automation for this device?

Done!!

6 Likes

Hello @SildeHoop my friend, you can put the code on the buttons to the scene, I’m just trying to fight how to get it and something does not work out, and I see that you did it

1 Like

I have created a pr

4 Likes

Since we are a bit behind on the wiki…
How do I implement chips_alarm?
Is there any good buttons for toggling my alarm?


type: custom:button-card
entity: alarm_control_panel.your_alarm
template: chips_alarm

Bild

1 Like

Can anyone help with having the person cards show “Away” instead of “not_home”?

STATES

####Edit: #######
I ended up fixing this by changing the template for the label.

label: >
    [[[
            if (states[variables.ulm_card_person_entity].state === 'not_home'){
              return "Away";
            } 
            if (states[variables.ulm_card_person_entity].state === 'home'){
              return "Home";
            } 
              else {
              return states[variables.ulm_card_person_entity].state;
            }
          ]]]
5 Likes

I am pretty close but struggling with a script. I have adjust the card_light_slider to support light groups (incl. slider that only adjust the brightness of lights that are actually on).

Next step is to not just toggle the lights but instead store the scene and restore the scene on tap_action (see code below). I am passing on the current state, entity and a name for the scene to the script.

        tap_action:
          action: call-service
          service: script.turn_on
          service_data:
            entity_id: script.store_scene_and_turn_off_lights
            variables:
              state: "[[[ return entity.state ]]]"
              light_entity: "[[[ return entity.entity_id ]]]"
              scene_name: light_bg_zit_revert

However, I am unable to read the light_entity properly. The light is turned off but the scene is not stored; there seems to be an issue with {{ light_entity}} in the state_attr command. See code below

sequence:
  - data:
      scene_id: '{{ scene_name }}'
      snapshot_entities: >-
        {{ expand(state_attr('{{ light_entity }}', 'entity_id'))
        |map(attribute='entity_id')|list }}
    service: scene.create
  - service: light.turn_off
    target:
      entity_id: '{{ light_entity }}'

Anybody that knows how I can solve this? Highly appreciated!

Yes you can use an automation. Take a look at this UI/set_theme.yaml at 936a1701cd06d3f054ac4725ab21adcd2402dad5 · stokkie90/UI · GitHub

Set theme on backend selected and it should work. I know there are also some blueprints that do it based on state of the sun.

How did you make the temperature in the background of the card? (Graph card)
For example the network card.
can you post your config?
Thank you.

comes probably with next release: Make state of person card translatable by pierrecle · Pull Request #186 · UI-Lovelace-Minimalist/UI (github.com)

2 Likes

That’s just the normal behaviour of our card_graph card:

- type: 'custom:button-card'
  template: card_graph
  variables:
    ulm_card_graph_color: "var(--google-blue)"
    ulm_card_graph_name: Temperature Livingroom
    ulm_card_graph_entity: sensor.livingroom_temperature