🌻 Lovelace UI • Minimalist

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

Added the following lines to the card
z-index: 9
margin-top: -56px;

card_graph:
    variables:
      ulm_card_graph_color: var(--info-color)
      ulm_card_graph_name: n/a
    triggers_update:
      - '[[[ variables.ulm_card_graph_entity ]]]'
    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: 0px
    custom_fields:
      item1:
        card:
          type: custom:button-card
          template:
            - icon_info
            - card_generic
          styles:
            card:
              - box-shadow: none
              - border-radius: var(--border-radius) var(--border-radius) 0px 0px
              - padding: 12px
              - background: none
              - z-index: 9
          entity: '[[[ return variables.ulm_card_graph_entity ]]]'
          name: ' '
      item2:
        card:
          type: custom:mini-graph-card
          entities:
            - entity: '[[[ return variables.ulm_card_graph_entity ]]]'
          line_color: '[[[ return variables.ulm_card_graph_color ]]]'
          show:
            name: false
            icon: false
            legend: false
            state: false
          style: |
            ha-card {
              box-shadow: none;
              border-radius: var(--border-radius);
              margin-top: -56px;
            }

I don’t know how to fix this. But what could help you debug this is to log the variables to somewhere you can easily see whats going on:

sequence:
  - service: persistent_notification.create
    data:
      message: "Light entity: {{ light_entity }}"
      title: "DEBUG"
  - service: persistent_notification.create
    data:
      message: "Snapshot entities: {{ expand(state_attr('{{ light_entity }}', 'entity_id'))
        |map(attribute='entity_id')|list }}"
      title: "DEBUG"

But know that i look at it, it seems your using {{ inside of other {{. I dont know if this works.
Can you try you template {{ expand(state_attr('{{ light_entity }}', 'entity_id') |map(attribute='entity_id')|list }} inside de Developer Tools > Templates, but with the light_entity filled in as a real entity instead of the variable. There you can try and get it to work.

Thanks good suggestion to debug. {{ light entity }} gives the right entity but the state_attr doesn’t (i.e empty list). The command without the variable works fine:

{{ expand(state_attr('light.dimmer....', 'entity_id'))
        |map(attribute='entity_id')|list }}"

So question is how to get this variable to be executed within the state_attr command.

I’m not sure but can you try this:

{{ expand(state_attr(light_entity, 'entity_id')) | map(attribute='entity_id')|list }}

Instead of

{{ expand(state_attr('{{ light_entity }}', 'entity_id')) | map(attribute='entity_id')|list }}

That’s it! Indeed, big thanks!!

Is it possible to combine scenes together with welcome?

      - type: custom:layout-card
        layout_type: grid

        cards:
          - type: 'custom:button-card'
            template: custom_card_paddy_welcome
            variables:
              ulm_custom_card_paddy_welcome_time: sensor.time

          - type: "custom:button-card"
            template:
              - card_scenes
            variables:
              entity_1: "scene.bad_time"
              entity_2: "scene.lights_off"
              entity_3: "scene.builaer"
              entity_4: "scene.YOUR_SCENE"
              entity_5: "scene.YOUR_SCENE"              
              name_1: "Sleep"
              name_2: "Off"
              name_3: "Builaer"
              name_4: "YOUR_NAME"
              name_5: "YOUR_NAME"              
              icon_1: "mdi:weather-night"
              icon_2: "mdi:lightbulb-group-off"
              icon_3: "mdi:water-boiler"
              icon_4: "mdi:YOUR_ICON"
              icon_5: "mdi:YOUR_ICON"              
              color_icon_1: "yellow"
              color_icon_2: "blue"
              color_icon_3: "purple"
              color_icon_4: "green"
              color_icon_5: "red"
              color_bg_1: "yellow"
              color_bg_2: "blue"
              color_bg_3: "purple"
              color_bg_4: "green"
              color_bg_5: "red"

I seem to recall something about not using “bold” because of a conflict with Chrome. But maybe not.

Don’t know why but for various cards (e.g. graph, vacuum) I am getting this

image

      - type: custom:button-card
        template: card_graph
        entity: sensor.switch_bg_woon_loox_temperature
        variables:
          ulm_card_graph_entity: sensor.switch_bg_woon_loox_temperature
          ulm_card_graph_name: Woonkamer
          ulm_card_graph_color: "var(--google-blue)"

What am I missing? Doing wrong?