Giter Club home page Giter Club logo

ui's Introduction

UI-Lovelace-Minimalist

Discord Version hacs installs Downloads

It's kind of hard to explain what this is, so let's call it a "theme" (in quotation marks). But one thing is for sure, it is very nice! Taking the exceptional work of tben as a basis, this repository is aimed to ease installation and maintenance of his wonderful work. You can use this interpretation of a SmartHomeUI more or less like a theme in HomeAssistant.

Wiki for documentation

We have setup an extensive Wiki for our documentation. It is more comfortable for you to read and for us to handle, than this file and gives our documentation the right framework to grow. Take a look here: https://ui-lovelace-minimalist.github.io/UI/

Table of content from the WIKI

Setup Usage Development

We have provided different guides to help you install and update this "theme"

These usage guides give you a deeper knowledge about this "theme"

This is our developer corner

» Download
» Installation
» Configuration

» Cards
» Chips
» Popups
» Custom-Cards

» Card Style Guide
» Docs Style Guide
» Custom-Cards

Installation and update

We can offer you in-depth instructions for installation, as well as for future updates or from a previous version. Check our WIKI for more info:

List of templates

The actual version of this "theme" has 20 different cards, seven chips and other templates bundled into the download. We're sorry, but the list wouldn't fit into this readme. Please see this page, where you can find an extensive list of templates with code examples, screenshots and explanation.

Custom cards

The same goes for our custom_cards. As the number grows, the list would be to big for this readme, so we provide you with an overview page with pictures, code examples and additional information. Find the list here.

Credits & Contributors

  • This design was made by tben
  • A lot of inspiration is taken from 7ahang’s work found on Behance.
  • Contributions from others in the HomeAssistant forum thread, you can find it here.
  • The technical part is realised mostly by taking advantage of the great work RomRaider did with his button-card.
  • Code refactor, cleanup and maintenance by schumijo and paddy0174 & CM000n.
  • dwainscheeren for his inspiration to deliver themes via HACS.
  • Wiki by paddy0174.
  • Special thanks to clemalex and schumijofor contributing their cards to the main repository.
  • stokkie90 for implementing most of the HACS functionalities.
  • And of course all the others who cannot be named here due to space limitations.

❤️ Thank you so much for helping to keep this UI awesome

Contributions

This is a living project and all input is very welcome! If you configured and designed a card, that you would like to share, please feel free to do so! We are happy to include your contribution so others can use it as well! This project uses pre-commit for consistent and clean code. If possible, please make sure that you also use pre-commit for local development before creating a pull request.

ui's People

Contributors

actions-user avatar aehru avatar andyvrd avatar basbruss avatar benbur98 avatar cm000n avatar cruguah avatar drealine avatar edoardop13 avatar eltarius avatar gilganik avatar github-actions[bot] avatar imswel avatar irmajavi avatar jeffconrad18 avatar juvenalandres avatar matrixx567 avatar mdb17 avatar mp-se avatar ned-tom avatar paddy0174 avatar r0binj avatar schumijo avatar shogun160 avatar sildehoop avatar sisimomo avatar stokkie90 avatar tbens avatar tommatheussen avatar yagrasdemonde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ui's Issues

Chip Navigation Emoji

Is it possible to give a emoji to a Navigation Chip? For now, only a MDI will work.

When giving a card the Navigation Template and the Icon Only template, it shows the Emoji, but the margin is off.

          - type: 'custom:button-card'
            template:
              - chip_icon_only
              - chip_navigate
            variables:
              ulm_chip_navigate_path: verlichting
              ulm_chip_icon_only: '💡'  

This is what it looks like.

afbeelding

Page FAQ in repo needs to be written

The seperate page FAQ.md needs to be written. Anybody any ideas or suggestions, what we should use for this? Maybe someone could check the HA thread to see if there are some obvious questions that come up more than once?

problems with button card and variables for thermostat card

Hi, i have a problem with variables in button card.

So, i want to take the temperature of climate entity (passed with variables) and increase by 0.5 degrees.
This is for button minus and plus in a thermostat card.

But, i receive this error: undefined is not an object (evaluating variables.entity.attributes.temperature)

This is my code:

card:
              type: "custom:button-card"
              template: widget_icon
              tap_action:
                action: call-service
                service: climate.set_temperature
                service_data:
                  temperature: " [[[ return (variables.entity.attributes.temperature + 0.5) ]]]"
                  entity_id: "[[[ return variables.entity ]]]"
              icon: "mdi:plus"

And, In the same page, this code from @Tpx01 works great:

widget_temperature:
  tap_action:
    action: toggle
  color: var(--google-grey-500)
  show_icon: false
  show_name: false
  show_label: true
  size: 20px
  label: |-
    [[[
        var temperature = entity.attributes.temperature;
        if (temperature == null) {
          var temperature = '-';
        }
        return temperature + '°C'
    ]]]
  styles:
    label:
      - color: "rgb(var(--color-theme),0.9)"
    grid:
      - grid-template-areas: '"l"'
    card:
      - box-shadow: none
      - padding: 0px
      - background-color: "rgba(var(--couleur-theme),0)"
      - border-radius: 14px
      - place-self: center
      - height: 42px

Wrong variable name

Hi,

There is a typo with variable names in templates "card_light_slider_collapse" and "card_light_slider_horizontal"

card_light_slider_collapse:
  variables:
    ulm_card_light_slider_collapse_name: "[[[ return entity.attributes.friendly_name ]]]"
(...)
  custom_fields:
    item1:
      card:
        type: 'custom:button-card'
        template:
          - icon_info
          - light
        entity: "[[[ return entity.entity_id ]]]"
        name: "[[[ return variables.ulm_card_light_slider_name ]]]"  <==== Should be ulm_card_light_slider_collapse_name
card_light_slider_horizontal:
  variables:
    ulm_card_light_slider_horizontal_name: "[[[ return entity.attributes.friendly_name ]]]"
(...)
  custom_fields:
    item1:
      card:
        type: 'custom:button-card'
        template:
          - icon_info
          - light
        entity: "[[[ return entity.entity_id ]]]"
        name: "[[[ return variables.ulm_card_light_slider_name ]]]"  <==== Should be ulm_card_light_slider_horizontal_name

Pictures missing in README.md and others

These pictures are missing from README.md:

  • chip icon only (missing)
  • chip icon with state (missing)
  • chip icon with double state (missing)
  • card generic (generic pic needed, actual pic is card battery)
  • card generic swap (missing and wrong)
  • card input boolean (missing)
  • card media player with cover art (missing)
  • card battery (see card generic)
  • card media player with controls (missing)

Taken from the task-list in the old repo, here.

Also there are some pics missing in custom-cards, we need to review this.

FR: Input select template

I'm currently using input selects to bring up options for different rooms. But because my CSS is crap, it looks like a dogs breakfast.

Can I request this? Or is there already a template that would work and I've missed it?

Thanks so much and awesome work :)

Different light_slider wanted

As per suggestion from @KaherdinTristan, a different light_slider could/should find the way into the repo.

minimalist_211019_light_slider_horizontal_01

And while at this: remove the conditional card and make a selection possible for with or without conditional.

Getting config error

Fresh install - getting this error checking the config:
Error loading /config/configuration.yaml: mapping values are not allowed here
in "/config/themes/minimalist-mobile/minimalist-mobile.yaml", line 146, column 65

Allow chip to show label and icon

Hi,
I'm trying to create a custom chip with a mdi:icon and a label. But when set 'show_icon: true' it doesn't appear. I've tried changing the style (grid-template), but as I'm new to CSS, I can't figure out how to style it correctly.
Thank you :)

This styling fixes it:
styles: label: - justify-self: center - align-self: center - padding: 0px 6px - margin: 2px 0 0 0 - font-weight: bold - font-size: 14px img_cell: - width: 24px grid: - grid-template-areas: '"i l"' card: - border-radius: 18px - box-shadow: var(--box-shadow) - height: 36px - width: auto - padding-left: 6px - padding-right: 6px size: 80%

Use card-mod-view-yaml to get rid of the need for template: edge

Since you are already using card-mod. You can add padding around the whole page with card-mod-view-yaml

  card-mod-theme: minimalist-mobile
  card-mod-root: |
    app-toolbar {
      display: none;
    }
  card-mod-view-yaml: |
    "*:first-child$": |
      #columns .column > * {
        padding-left: 5px;
        padding-right: 5px;
        padding-bottom: 5px;
      }   

That way you don't need to add

- type: custom:button-card
  template: edge

Around every card

Light Card Tap Icon

Hey,

Is it possible to create a tap action just for the icon of the light card?
It would be nice if i tap on the icon the details pages opens and if i tap on the card it toggles the light.

Do you know if it is possible?

Thanks in advance!

Add support for cover without "current_position" attributes

Hi,

Can you add support for cover without "current_position" attributes ?

Here is the modified code :

cover:
  tap_action:
    action: more-info
  icon: |
    [[[
        var icon = 'mdi:help-circle';
        if (typeof states[entity.entity_id].attributes.current_position === 'undefined'){
          if (states[entity.entity_id].state == 'closed'){
            var icon = 'mdi:window-shutter';
          } else
            var icon = 'mdi:window-shutter-open';
        } else {
          if (states[entity.entity_id].attributes.current_position == 0){
            var icon = 'mdi:window-shutter';
          } else
            var icon = 'mdi:window-shutter-open';
        }
        return icon ;
    ]]]
  label: >-
    [[[
        var icon = 'mdi:help-circle';
        if (typeof states[entity.entity_id].attributes.current_position === 'undefined'){
          if (states[entity.entity_id].state == 'closed'){
            return variables.ulm_closed;
          } else
            return variables.ulm_open;
        } else {
          if (states[entity.entity_id].attributes.current_position == 0){
            return variables.ulm_closed;
          } else {
            return variables.ulm_open + ' • ' + (states[entity.entity_id].attributes.current_position) + '%' ;
          }
        }
        return icon ;
    ]]]
  state:
    - operator: template
      value: "[[[ return states[entity.entity_id].attributes.current_position != 0; ]]]"
      styles:
        icon:
          - color: "rgba(var(--color-blue),1)"
        img_cell:
          - background-color: "rgba(var(--color-blue),0.2)"

Chips usage of emojis on chip_icon_only

I'm struggling on using icons with the chips_icon_only template.
I was trying to use emojis, turned out it only works with hass: or mdi: icons

image

- type: 'custom:button-card'
  template: chip_icon_only
  variables:
    ulm_chip_icon_only: '❤️'
- type: 'custom:button-card' 
  template: chip_icon_only
  variables:
    ulm_chip_icon_only: 'mdi:car'

Maybe change or add another one that can handle emojis? Or do i miss something?

image

- type: 'custom:button-card'
  template: chip_emoji_only
  variables:
    ulm_chip_icon_only: '❤️'

chip_emoji_only:
  template: chips
  variables:
    icon: '❔'
  show_icon: true
  label: |
    [[[ return variables.ulm_chip_icon_only ? variables.ulm_chip_icon_only : variables.icon ]]]

HA forum thread re-read for new cards

I think it could be a good idea to re-read the HA forum thread and see, what different things could be found to include into the repo.

Eg. tpx01 (I think) made a room_card with a nice background as a navigation card. Should this be implemented? I'd vote for to do so.

Hide Chips at certain state

I was trying to create a conditional chip so that, when a sensor has a certain state (ex. there is 1 light or more on) its show the chip, but when there are no lights on, it should hide it. Also, when the chip is showing, it should also show how many lights there are on.

That works, kinda...

When the chip is showing, it gives as state 0. After a browser refresh, it updates to 1. Same goes for 1 to ex. 2 or from ex. 2 to 1.
When it goes from something to 0, it hide the chip, like it should.

So the only problem is that the state of the chip is not live updating.

I'm using the state-switch card.


          - type: custom:state-switch
            entity: sensor.lights_on
            states:
              lights on:
                type: 'custom:button-card'
                template: chip_icon_state
                variables:
                  ulm_chip_icon_state_icon: '💡'
                  ulm_chip_icon_state_entity: sensor.current_lights_on

typo in button_card_templates.yaml:1100 media_player_with_controls

Hi,
I'm currently on vacation so I couldn't make a pull request. But I wanted to mention, that there is a typo in media_player_with_controls, which results in the card not loading.
entity_id: '[[[ return entity.ulm_card_media_player_with_controls_entity ]]]' should be
entity_id: '[[[ return variables.ulm_card_media_player_with_controls_entity ]]]'

Theme: hide app-toolbar with card-mod issue

I noticed that the app-toolbar on the minimailist-mobile theme is still showing even if it should be hidden with card-mod-root styling:

  card-mod-theme: mobile
  card-mod-root: |
    app-toolbar {
      display: none;
    } 

I fixed this with writing the complete name of the them (first line of yaml file) in card-mod-theme:

  card-mod-theme: minimalist-mobile
  card-mod-root: |
    app-toolbar {
      display: none;
    } 

Dont know if this is a issue that only i have.

Theme: color-background-* cannot be used because it is white

I was using the color-background-* colors as a variable in my custom templates, but in the light mode all colors are set to white:

color-background-yellow : 250, 250, 250
color-background-blue : 250, 250, 250
color-background-green : 250, 250, 250
color-background-red : 250, 250, 250

When changing it to the same as in the dark mode, cards that use icon_info_bg are displayed wrong:
image image

This is because the opacity-bg is set to 1, as soon as you set this to 0.1 (same as in the dark theme) everything is ok.

I dont know if this intended or not, i changed it on my environment and all other buttons are still looking smooth.

This relates to both themes:

  • minimalist-mobile.yaml
  • minimalist-desktop.yaml

Triggers_update on template not work

Describe the bug
Using triggers_update on card template with variables not work.

To Reproduce
Steps to reproduce the behavior:

Using a variable and try to refresh, the card not show the new value using template.
To work, I need to set triggers_update at the top level of configuration like this :

image

Others card on Minimalist not work also.

more-info tap_action on card_person not working

I noticed earlier this day that the more-info tap_action on card_person is not working.
With a tap on the person card nothing happens at all
Maybe I'll manage to take a closer look soon and fix it myself.
But I thought I'll record it here in any case, in case someone should be faster than me ;-)

Media Player idle state blank

When Media Player Card entry has idle state card_media_player_with_control turns completely blank and the cards partly

Schermafbeelding 2021-12-17 om 08 44 40

yaml code:

          - type: horizontal-stack
            cards:
              - type: "custom:button-card"
                template: edge
              - type: "custom:button-card"
                template: card_media_player
                entity: media_player.living_room_speaker_1
                name: Living room Speaker
              - type: "custom:button-card"
                template: edge

          - type: horizontal-stack
            cards:
              - type: "custom:button-card"
                template: edge
              - type: "custom:button-card"
                template: card_media_player_with_control
                entity: media_player.living_room_speaker_1
                name: Living room Speaker
              - type: "custom:button-card"
                template: edge

          - type: horizontal-stack
            cards:
              - type: "custom:button-card"
                template: edge
              - type: "custom:button-card"
                template:
                  - card_media_player_with_controls
                variables:
                  ulm_card_media_player_with_controls_name: "Living room Speaker"
                  ulm_card_media_player_with_controls_entity: media_player.living_room_speaker_1
              - type: "custom:button-card"
                template: edge

Adjust Custom Fan Card for Air Purifiers

Currently the custom_card_saxel_fan by @saxel works only for traditional fans (which is fine), however Air Purifiers like the Xiaomi ones work with the fan integration for the most part as well.

In my opinion the current button which triggers call-service fan.osciallate should switch between fan modes Off and Auto for purifiers. Should I set up a new custom card or integrate something within the existing card?

Battery card not working

Looks like the battery card isn't working. When defined, it gives undefined% as state.

Don't know what exactly is wrong, but I think the template tries to get the battery attribute from the battery sensor, but the state of the sensor is the battery percentage it self.

Through the generic card it works fine.

afbeelding

Empty space/placeholder for uneven rows

Is there a way to put some kind of placeholder into the horizontal stack, so that cards fill 50% of the available space?

Please have a look at the dashboard on the left, and the expected layout on the right. I'd like the "Biuro" slider to occupy only half of the row.

Before After
image CleanShot 2021-12-01 at 20 18 35
button_card_templates: !include_dir_merge_named minimalist-templates/
views:
  - title: Home
    cards:
      - type: vertical-stack
        cards:
          - type: custom:button-card
            template: title
            name: Music
          - type: entities
            entities:
              - type: custom:mini-media-player
                group: true
                name: " "
                hide:
                  icon: true
                  source: true
                  progress: true
                  controls: true
                  volume: true
                speaker_group:
                  platform: media_player
                  show_group_count: false
                  expanded: false
                  entities:
                    - entity_id: media_player.kuchnia
                      name: Kitchen
                    - entity_id: media_player.lazienka
                      name: Bathroom
                    - entity_id: media_player.pokoj_dzienny
                      name: Living room
                artwork: none
                tts: false
                info: scroll
                volume_stateless: false
                entity: media_player.kuchnia
            show_header_toggle: false

      - type: horizontal-stack
        cards:
          - type: custom:button-card
            template: card_slider_generic
            entity: media_player.kuchnia
            variables:
              ulm_card_slider_name: Kuchnia
          - type: custom:button-card
            template: card_slider_generic
            entity: media_player.lazienka
            variables:
              ulm_card_slider_name: Łazienka
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            template: card_slider_generic
            entity: media_player.pokoj_dzienny
            variables:
              ulm_card_slider_name: Biuro

      - type: horizontal-stack
        cards:
          - type: "custom:button-card"
            template: card_script
            variables:
              ulm_card_script_title: Nowy Świat
              ulm_card_script_icon: "mdi:radio"
            tap_action:
              action: call-service
              service: script.play_radio
              service_data:
                selected_preset: 1
          - type: "custom:button-card"
            template: card_script
            variables:
              ulm_card_script_title: Radio 357
              ulm_card_script_icon: "mdi:radio"
            tap_action:
              action: call-service
              service: script.play_radio
              service_data:
                selected_preset: 2
          - type: "custom:button-card"
            template: card_script
            variables:
              ulm_card_script_title: Spotify
              ulm_card_script_icon: "mdi:spotify"
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                entity_id: media_player.kuchnia
                source: spotify

And card_slider_generic is just the modified light slider card:

card_slider_generic:
  template:
    - ulm_language_variables
  variables:
    ulm_card_slider_name: "[[[ return entity.attributes.friendly_name ]]]"
    icon: "[[[ return entity.attributes.icon ]]]"
  show_icon: false
  show_name: false
  show_label: false
  state:
    - operator: template
      value: "[[[ return entity.state == 'on' ]]]"
      styles:
        card:
          - background-color: "rgba(var(--color-background-yellow),var(--opacity-bg))"
  styles:
    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
          - yellow_slider
        entity: "[[[ return entity.entity_id ]]]"
        tap_action:
          action: toggle
        label: >-
          [[[
            if (entity.state !='unavailable'){
              if (entity.state =='off'){
                return variables.ulm_off;
              } else if (entity.state == 'on'){
                if (entity.attributes.brightness != null){
                  var bri = Math.round(entity.attributes.brightness / 2.55);
                  return (bri ? bri : '0') + '%';
                } else {
                  return variables.ulm_on
                }
              }
            } else {
              return variables.ulm_unavailable;
            }
          ]]]
        name: "[[[ return variables.ulm_card_slider_name ]]]"
        styles:
          card:
            - box-shadow: none
            - border-radius: var(--border-radius) var(--border-radius) var(--border-radius) var(--border-radius)
            - padding: 0px
    item2:
      card:
        type: "custom:my-slider"
        entity: "[[[ return entity.entity_id ]]]"
        radius: 14px
        height: 42px
        mainSliderColor: rgba(var(--color-yellow),1)
        secondarySliderColor: rgba(var(--color-yellow),0.2)
        mainSliderColorOff: rgba(var(--color-theme),0.05)
        secondarySliderColorOff: rgba(var(--color-theme),0.05)
        thumbHorizontalPadding: "0px"
        thumbVerticalPadding: "0px"
        thumbWidth: 0px
        card_mod:
        style: |
          ha-card {
            border-radius: 14px;
            box-shadow: none;
          }

Person card custom zones do not work

When using the person card with custom zones defined, the card will crash with the following error if the person is in one of the custom zones:

ButtonCardJSTemplateError: TypeError: states[variables.ulm_card_person_zone1] is undefined in 'if (states[variables.ulm_card_person_entity].state != 'home'){ if (states[variables.ulm_card_p...'

Taking a peek at the code, it looks like this is because the custom zones defined (ulm_card_person_zone1, and ulm_card_person_zone2) need to be the friendly name of the zones to match the persons state, but then the zone entity is tried to look up with just the friendly name. Suggested fix would be to have the ulm_card_person_zone1 variables be defined as the actual zone, i.e. zone.work, then tweak the icon lookup function to something like this: (beware, I'm not a js developer, so it might need some further tweaks)

        if (states[variables.ulm_card_person_entity].state != 'home'){
          if (states[variables.ulm_card_person_entity].state == states[variables.ulm_card_person_zone1].attributes.friendly_name){
            var icon = states[variables.ulm_card_person_zone1].attributes.icon != null ? states[variables.ulm_card_person_zone1].attributes.icon : 'mdi:help-circle'
            return '<ha-icon icon="' + icon + '" style="width: 10px; height: 10px; color: var(--primary-background-color);"></ha-icon>';
          } else if (states[variables.ulm_card_person_entity].state == states[variables.ulm_card_person_zone2].attributes.friendly_name){
            var icon = states[variables.ulm_card_person_zone2].attributes.icon != null ? states[variables.ulm_card_person_zone2].attributes.icon : 'mdi:help-circle'
            return '<ha-icon icon="' + icon + '" style="width: 10px; height: 10px; color: var(--primary-background-color);"></ha-icon>';
          } else {
            return '<ha-icon icon="mdi:home-minus" style="width: 10px; height: 10px; color: var(--primary-background-color);"></ha-icon>';
          }
        } else {
          return '<ha-icon icon="mdi:home-variant" style="width: 10px; height: 10px; color: var(--primary-background-color);"></ha-icon>';
        }

How to hide custom item on a card based on condition?

I have a custom slider card based on the light slider. Is there a way to hide the slider item when the given entity state is off?

CleanShot 2021-12-01 at 21 43 25@2x

CleanShot 2021-12-01 at 21 43 32@2x

card_slider_generic:
  template:
    - ulm_language_variables
  variables:
    ulm_card_slider_name: "[[[ return entity.attributes.friendly_name ]]]"
    icon: "[[[ return entity.attributes.icon ]]]"
  show_icon: false
  show_name: false
  show_label: false
  state:
    - operator: template
      value: "[[[ return entity.state == 'on' ]]]"
      styles:
        card:
          - background-color: "rgba(var(--color-background-yellow),var(--opacity-bg))"
  styles:
    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
          - yellow_slider
        entity: "[[[ return entity.entity_id ]]]"
        tap_action:
          action: toggle
        label: >-
          [[[
            if (entity.state !='unavailable'){
              if (entity.state =='off'){
                return variables.ulm_off;
              } else if (entity.state == 'on'){
                if (entity.attributes.brightness != null){
                  var bri = Math.round(entity.attributes.brightness / 2.55);
                  return (bri ? bri : '0') + '%';
                } else {
                  return variables.ulm_on
                }
              }
            } else {
              return variables.ulm_unavailable;
            }
          ]]]
        name: "[[[ return variables.ulm_card_slider_name ]]]"
        styles:
          card:
            - box-shadow: none
            - border-radius: var(--border-radius) var(--border-radius) var(--border-radius) var(--border-radius)
            - padding: 0px
    item2:
      card:
        type: "custom:my-slider"
        entity: "[[[ return entity.entity_id ]]]"
        radius: 14px
        height: 42px
        mainSliderColor: rgba(var(--color-yellow),1)
        secondarySliderColor: rgba(var(--color-yellow),0.2)
        mainSliderColorOff: rgba(var(--color-theme),0.05)
        secondarySliderColorOff: rgba(var(--color-theme),0.05)
        thumbHorizontalPadding: "0px"
        thumbVerticalPadding: "0px"
        thumbWidth: 0px
        card_mod:
        style: |
          ha-card {
            border-radius: 14px;
            box-shadow: none;
          }

Default icon missing on card_media_player

Hi,

Default icon is missing on card_media_player while it is present on card_media_player_with_control.

card_media_player:
  template:
    - icon_info_bg
    - ulm_language_variables
  icon: |
    [[[
      var icon = 'mdi:speaker';  <==== ADDED
      if(entity.attributes.app_name){
        var app = entity.attributes.app_name.toLowerCase();
        if(app == 'spotify'){
          var icon = 'mdi:spotify';
        } else if(app == 'google podcasts'){
          var icon = 'mdi:google-podcast';
        } else if(app == 'plex'){
          var icon = 'mdi:plex';
        } else if(app == 'soundcloud'){
          var icon = 'mdi:soundcloud';
        } else if(app == 'youtube music'){
          var icon = 'mdi:youtube';
        } else if (app == 'oto music'){
          var icon = 'mdi:music-circle';
        }
      }
      return icon;
    ]]]

incorrect template

on the graph card, you call the template "icon_info" which doesn't exist. I believe it should be "icon_info_bg" but i didn't spend a lot of time figuring out which icon_info_* template it's meant to use

Incorrect background on light slider cards when using dark mode.

Screen Shot 2021-11-02 at 6 06 28 PM

Added the following variables to eliminate the background on item1 for the cards below. Might be a better way to do it but this worked.

card_light_slider:
  variables:
    ulm_card_light_slider_name: "[[[ return entity.attributes.friendly_name ]]]"
  show_icon: false
  show_name: false
  show_label: false
  state:
    - operator: template
      value: "[[[ return entity.state == 'on' ]]]"
      styles:
        card:
          - background-color: 'rgba(var(--color-background-yellow),var(--opacity-bg))'
  styles:
    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'
        variables:    <===== ADDED
          slider_background_color: 'rgba(0,0,0,0)'   <===== ADDED
        template:
          - icon_info
          - light
        entity: "[[[ return entity.entity_id ]]]"
        name: "[[[ return variables.ulm_card_light_slider_name ]]]"
        styles:
          card:
            - box-shadow: none
            - border-radius: var(--border-radius) var(--border-radius) 0px 0px
            - padding: 0px
    item2:
      card:
        type: 'custom:my-slider'
        entity: '[[[ return entity.entity_id ]]]'
        radius: 14px
        height: 42px
        mainSliderColor: rgba(var(--color-yellow),1)
        secondarySliderColor: rgba(var(--color-yellow),0.2)
        mainSliderColorOff: rgba(var(--color-theme),0.05)
        secondarySliderColorOff: rgba(var(--color-theme),0.05)
        thumbHorizontalPadding: '0px'
        thumbVerticalPadding: '0px'   
        thumbWidth: 0px
        card_mod:
        style: |
          ha-card {
            border-radius: 14px;
            box-shadow: none;
          }
card_light_slider_collapse:
  variables:
    ulm_card_light_slider_collapse_name: "[[[ return entity.attributes.friendly_name ]]]"
  show_icon: false
  show_name: false
  show_label: false
  state:
    - operator: template
      value: "[[[ return entity.state == 'on' ]]]"
      styles:
        grid:
          - row-gap: 12px
        card:
          - background-color: 'rgba(var(--color-background-yellow),var(--opacity-bg))'
  styles:
    grid:
      - grid-template-areas: '"item1" "item2"'
      - grid-template-columns: 1fr
      - grid-template-rows: min-content min-content
    card:
      - border-radius: var(--border-radius)
      - box-shadow: var(--box-shadow)
      - padding: 12px
  custom_fields:
    item1:
      card:
        type: 'custom:button-card'
        variables:    <===== ADDED
          slider_background_color: 'rgba(0,0,0,0)'     <===== ADDED
        template:
          - icon_info
          - light
        entity: "[[[ return entity.entity_id ]]]"
        name: "[[[ return variables.ulm_card_light_slider_name ]]]"
        styles:
          card:
            - box-shadow: none
            - border-radius: var(--border-radius) var(--border-radius) 0px 0px
            - padding: 0px
        state:
          - styles:
              card:
                - background: transparent
            value: 'on'
    item2:
      card:
        type: conditional
        conditions:
          - entity: "[[[ return entity.entity_id ]]]"
            state: 'on'
        card:
          type: 'custom:my-slider'
          entity: '[[[ return entity.entity_id ]]]'
          radius: 14px
          height: 42px
          mainSliderColor: rgba(var(--color-yellow),1)
          secondarySliderColor: rgba(var(--color-yellow),0.2)
          mainSliderColorOff: rgba(var(--color-theme),0.05)
          secondarySliderColorOff: rgba(var(--color-theme),0.05)
          thumbHorizontalPadding: '0px'
          thumbVerticalPadding: '0px'   
          thumbWidth: 0px
          card_mod:
          style: |
            ha-card {
              border-radius: 14px;
              box-shadow: none;
            }
card_light_slider_horizontal:
  variables:
    ulm_card_light_slider_horizontal_name: "[[[ return entity.attributes.friendly_name ]]]"
  show_icon: false
  show_name: false
  show_label: false
  state:
    - operator: template
      value: "[[[ return entity.state == 'on' ]]]"
      styles:
        card:
          - background-color: 'rgba(var(--color-background-yellow),var(--opacity-bg))'
  styles:
    grid:
      - grid-template-areas: '"item1 item2"'
      - grid-template-columns: 1fr 1fr
      - grid-template-rows: 1fr
    card:
      - border-radius: var(--border-radius)
      - box-shadow: var(--box-shadow)
      - padding: 12px
  custom_fields:
    item1:
      card:
        type: 'custom:button-card'
        variables:    <===== ADDED
          slider_background_color: 'rgba(0,0,0,0)'   <===== ADDED
        template:
          - icon_info
          - light
        entity: "[[[ return entity.entity_id ]]]"
        name: "[[[ return variables.ulm_card_light_slider_name ]]]"
        styles:
          card:
            - box-shadow: none
            - border-radius: var(--border-radius) var(--border-radius) 0px 0px
            - padding: 0px
    item2:
      card:
        type: 'custom:my-slider'
        entity: '[[[ return entity.entity_id ]]]'
        radius: 14px
        height: 42px
        mainSliderColor: rgba(var(--color-yellow),1)
        secondarySliderColor: rgba(var(--color-yellow),0.2)
        mainSliderColorOff: rgba(var(--color-theme),0.05)
        secondarySliderColorOff: rgba(var(--color-theme),0.05)
        thumbHorizontalPadding: '0px'
        thumbVerticalPadding: '0px'   
        thumbWidth: 0px
        card_mod:
        style: |
          ha-card {
            border-radius: 14px;
            box-shadow: none;
          }
yellow:
  variables:   <===== ADDED
    slider_background_color: 'rgba(var(--color-background-yellow),var(--opacity-bg))'  <===== ADDED
  state:
    - styles:
        icon:
          - color: 'rgba(var(--color-yellow),1)'
        label:
          - color: 'rgba(var(--color-yellow-text),1)'
        name:
          - color: 'rgba(var(--color-yellow-text),1)'
        img_cell:
          - background-color: 'rgba(var(--color-yellow), 0.2)'
        card:
          - background-color: '[[[ return variables.slider_background_color ]]]'    <===== ADDED
      value: 'on'

Icon, label and state on media_player cards not readable

I have the problem that with media player cards neither the icon, nor the label and the status are readable when the media player is on but no cover art is available while on light theme:
7656765nt

Here we should probably change something about the color selection or representation in general?

I would also suggest treating media players that are in idle or pause mode similar to media players that are off. Or at least we should rethink the representation here as well.
For example, Sonos speakers are always in idle mode when nothing is playing. So for most of the day they are treated in the UI like media players that are on but idle. But from the user perspective however, they are turned off.

Theme: opacity on wrong state?

Could it be that the "Set opacity-bg to 0.1 in light themes" chanhe is applied to the wrong state condition?
Now for a card in an off condition it becomes white and in an on condition it becomes transparent.
I would expect it the otherway around?
Thanks!

Enhancement: Conditional Confirmation

Recommend adding the following to every card. No reason not to and adds simple protection for critical devices.

If the variable is included in the card, the confirmation text is displayed. If the variable is not included, the card operates normally.

Card

variables:
  custom_card_mwolter_power_outlet_confirm_text: Toggle the eGPU power?

Template

tap_action:
  action: toggle
  confirmation: '[[[ return variables.custom_card_mwolter_power_outlet_confirm_text == null ? false : {"text": variables.custom_card_mwolter_power_outlet_confirm_text} ]]]'
hold_action:
  action: more-info

card_power_outlet not working

Hi,

card_power_outlet is not working.

I think code should be :

card_power_outlet:
  template:
    - yellow
    - icon_info_bg
    - ulm_language_variables
  label: |-
    [[[ 
      if ((entity.state =='on') && (variables.ulm_card_power_outlet_consumption_sensor != '')) {
        return variables.ulm_on + ' • ' + states[variables.ulm_card_power_outlet_consumption_sensor].state + 'W';
      } else {
        return variables.ulm_off;
      }
    ]]]

Cannot add carts to dashboard.

Hello, I configure minimalist like in instructions and choose minimalist in theme. I see 2 tabs with Welcome to UI-lovelace-minimalist but cannot add any card. I don't see anything in logs.

Regards.

Chip in light theme cut off

In the light theme, the chip (for some reason not the first 2) is cut off because of the box-shadow.

I'm using the icon only chip, but also tried it with the normal generic chip, but that makes no difference.

Dark mode is fine, because there is no box-shadow. Also if I set the box-shadow to none in the light theme, the cut off is also gone, so something is up with that shadow.

afbeelding

PS: This is my 3rd issue, sorry! I really like this theme, so far one of the best out there, so I want to make it even better :)

Chip navigation template

I'm using chips for view navigation too, maybe add a second template for tap action?

- type: 'custom:button-card' 
  template:
    - chip_icon_only
    - chip_navigation
  variables:
    ulm_chip_icon_only: 'mdi:car'
    ulm_chip_navigation_path: car

Template

chip_navigation:
  tap_action:
    action: navigate
    navigation_path: "[[[ return variables.ulm_chip_navigation_path; ]]]"

Option to use MDI icons in chips

The chips don't show the MDI icons when using the variables.
Only when using emoji's

- type: 'custom:button-card'
  template: chip_icon_state
  entity: group.denon
  variables: 
    ulm_chip_icon_state_icon: 'mdi:speaker-wireless'
    ulm_chip_icon_state_entity: sensor.denon_count

Screen Shot 2021-11-09 at 11 32 40

.

Button Template - Faulty state template value

In button_card_templates.yaml, on line 195 and 213, templates "vertical_buttons_blue" and "vertical_buttons_green" are defined.

The state template value contains the following:
value: "[[[ return states['input_select.localisation_thomas'].state == variables.state ]]]"

As using the template doesn't work, it does when modifying this line to:
value: "[[[ return entity.state == variables.state ]]]"

Afterwards, the button card template seems to work as expected.

I think this needs to be adjusted for the next release, as it will be overwritten each time this theme is updated without changing this part.

Add unit on chips chip_icon_state and chip_icon_double_state

Hi,

Could be interesting to add unit_of_measurement (if available) to chip_icon_state and chip_icon_double_state.

chip_icon_state:
  template: chips
  triggers_update:
    - "[[[ variables.ulm_chip_icon_state_entity ]]]"
  label: |
    [[[
      var icon = '❔';
      if (variables.ulm_chip_icon_state_icon){
        var icon = variables.ulm_chip_icon_state_icon;
      } 
      var state = '';
      if (states[variables.ulm_chip_icon_state_entity].state){
        var state = states[variables.ulm_chip_icon_state_entity].state;
        if (states[variables.ulm_chip_icon_state_entity].attributes.unit_of_measurement){   <= ADDED
          state += states[variables.ulm_chip_icon_state_entity].attributes.unit_of_measurement;   <= ADDED
        }   <= ADDED
      } 
      return icon + ' ' + state;
    ]]]
chip_icon_double_state:
  template: chips
  triggers_update:
    - "[[[ variables.ulm_chip_icon_double_state_entity_1 ]]]"
    - "[[[ variables.ulm_chip_icon_double_state_entity_2 ]]]"
  label: |
    [[[
      var icon = '❔';
      if (variables.ulm_chip_icon_double_state_icon){
        var icon = variables.ulm_chip_icon_double_state_icon;
      } 
      var state1 = '';
      if (states[variables.ulm_chip_icon_double_state_entity_1].state){
        var state1 = states[variables.ulm_chip_icon_double_state_entity_1].state;
        if (states[variables.ulm_chip_icon_double_state_entity_1].attributes.unit_of_measurement){   <= ADDED
          state1 += states[variables.ulm_chip_icon_double_state_entity_1].attributes.unit_of_measurement;   <= ADDED
        }   <= ADDED
      } 
      var state2 = '';
      if (states[variables.ulm_chip_icon_double_state_entity_2].state){
        var state2 = states[variables.ulm_chip_icon_double_state_entity_2].state;
        if (states[variables.ulm_chip_icon_double_state_entity_2].attributes.unit_of_measurement){   <= ADDED
          state2 += states[variables.ulm_chip_icon_double_state_entity_2].attributes.unit_of_measurement;   <= ADDED
        }   <= ADDED
      } 
      return icon + ' ' + state1 + ' • ' + state2;
    ]]]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.