🌻 Lovelace UI • Minimalist

Depending on what you have, you can use templates for that as well. Templates from button-card (that’s what this is basically about) can be inherited from other templates. So what you need in the end, is a template like my_chips that inherit from the default chips.

Like this:
first_page_chips → inherits from my_chips → inherits from chips. :slight_smile:

I’m guessing you took the idea from this comment from @paddy0174?
That’s what I’m referring to :slight_smile:

Thats correct, yes my inherits as I think of it is just from the standard button_card_templates.yaml file. So nothing fancy there. Maybe Paddy0174 have some tips, hint hint paddy;)

Solution:

  - title: Hjemme 
    icon: 'mdi:home-variant'
    path: home
    cards:
      - cards:
          - cards:
             - !include /config/lovelace/felles/chips.yaml
            type: horizontal-stack

Then just add the cards you like in the chips.yaml file:)

1 Like

I just found this and now I feel I have to change up my own ui to this!! :heart_eyes:

2 Likes

@bms and @steinis
Sorry, little lost here… :slight_smile: What do you mean? Give me a hint, please! :slight_smile:

I currently have my themes set up like this

frontend:
  themes: !include_dir_merge_named themes

How do I go about adding the new theme? when I put it in the theme folder i get invalid config.

In this case you need to adapt a few things, to make it run. You need to adjust the file locations and you need to refit the theme files.

I can just give the mysterious hint, that you should wait a few days. :wink: There are some people working on a little project to make this “theme” (technically it is unfortunately not only a theme) easier to use and maintain. :slight_smile: One of the things included will be a change in file locations and coming with this, a structure that already fits the use of themes like you (and all users of HACS) do. :slight_smile: Stay tuned! :slight_smile:

2 Likes

Oh im excited

@paddy0174

We were wondering how you did the following in your code:

first_page_chips → inherits from my_chips → inherits from chips.

Because we can’t figure it out :slight_smile:

Same question as @jompa68, how are made the following sensors used for your scenes ?

sensor.presence
sensor.absent
sensor.travail

Thanks for the great work here !

Hey @tben really like it, but hoping you could also share the chips that you have not added in your github (such as the spotify title-artist thing)

Thanks!

Is there a solution for this:

I’m assuming you’re trying to fix an issue is your screen is to narrow?

There is a solution but not an easy one. And it will require you to do some tinkering on your own :stuck_out_tongue:

If you take a look at the following repository:

He has build a different layout but while using the same techniques
(button card + heavily depending on templates)
In the file ui-lovelace.yaml he has defined a default layout for his tiles + some different configurations when the mobile screen is portrait or landscape.

This is the exact piece of code he uses:

  - type: custom:grid-layout
    path: 0
    layout:
      #default
      grid-gap: var(--custom-layout-card-padding)
      grid-template-columns: repeat(4, 1fr) 0
      grid-template-rows: 0 repeat(2, fit-content(100%)) 0fr
      grid-template-areas: |
        "sidebar  .           .       .       ."
        "sidebar  vardagsrum  studio  sovrum  ."
        "sidebar  media       övrigt  hemma   ."
        "sidebar  footer      footer  footer  ."
      mediaquery:
        #phone
        "(max-width: 800px)":
          grid-gap: calc(var(--custom-layout-card-padding) * 1.5)
          grid-template-columns: 0 repeat(2, 1fr) 0
          grid-template-rows: 0 repeat(5, fit-content(100%)) 0fr
          grid-template-areas: |
            ".  .           .        ."
            ".  sidebar     sidebar  ."
            ".  vardagsrum  sovrum   ."
            ".  studio      övrigt   ."
            ".  media       hemma    ."
            ".  footer      footer   ."
            ".  .           .        ."
        #portrait
        "(max-width: 1200px)":
          grid-gap: var(--custom-layout-card-padding)
          grid-template-columns: repeat(3, 1fr) 0
          grid-template-rows: 0 repeat(3, fit-content(100%)) 0fr
          grid-template-areas: |
            "sidebar  .           .       ."
            "sidebar  vardagsrum  sovrum  ."
            "sidebar  studio      övrigt  ."
            "sidebar  media       hemma   ."
            "sidebar  footer      footer  ."
            "sidebar  .           .       ."
    cards:
        ..... (define your cards here) .....

You could try to use the same technique to adjust the cards based on the available room there is :slight_smile:
But as I said, this will not be easy.

1 Like

I think you just need to put those two cards into a vertical stack.

I would love to see this also. I am struggling getting the scenes working

Hi @jompa68 and @martheijnen :wave:
Here are some details on this sensor
127768397-24ab76fc-b037-4fc5-a2ef-45e96285cd46

I have been using this method for 4 years now and am super happy with it, there might be another way to do it now.
I make an API call with my phone using Tasker to change the value of the input select according to the wifi network I’m connected to.

Here is an example with the Present location

input_select

localisation_thomas:
    name: 'Thomas • Localisation '
    icon: mdi:face
    options:
      - Present
      - Absent
      - Travail

I then use a history_stats to find out how long I have been in a state
This sensor is reset to 0 when I go to bed (launch of the automation: automation.thomas_nuit_on)

sensor

platform: history_stats
name: Present
entity_id: input_select.localisation_thomas
state: 'Present'
type: time
start: "{{ as_timestamp(state_attr('automation.thomas_nuit_on', 'last_triggered')) }}"
end: '{{ now() }}'
9 Likes

Hello!

Could anyone do a little explanation a bit more complete than just those command lines from the configuration.yaml? I have no experience and I can’t get it to work, neither can I get it by copying the views.

Thanks for your patience.

2 Likes

As this could be a bit more extensive, it could be easier, when you start with some info if you know custom!button-card and which mode (yaml, storage or ui) you are using.

1 Like

I’m using default mode because I don’t have experience with yaml. Is there a possibility to use this without switching to yaml?

The problem I have is the following. After following the three installation steps, when I copy one of the example cards I have an error of templates are missing.

Thank you!

This is possible, but not very clear due to the extensive code. If this does not bother you, simply copy the template code you want to use into the raw config above the first line views: The template code must begin with button_card_templates: (no indentation), the rest has to be indentated, for example:


button_card_templates:
  icon:
    color: var(--google-grey)
    show_icon: true
    show_name: false
    show_label: false
    size: 20px
    custom_fields:
      notification: >
          …
   

Which template you need is shown in the error notice: „ Template blablabla is missing!“