A different take on designing a Lovelace UI

Works for me though

if I Putty into my HomeAssistant and running the command, and I still get all the data from the command so it shuld work right??

Just wanted to ping anyone. Any help appreciated.

Getting a lot of flickering sometimes with the latest updates. Wondering if @Mattias_Persson has experienced this or anyone else using this theme. This issue might be related to that mod-card causes flickering if jinjia2 used for styling · Issue #165 · thomasloven/lovelace-card-mod (github.com)

Guys just sharing some templating for sidebar for Xbox integration. used @Mattias_Persson lights and devices on/off templating code so i barely know what i did and im surprised that it works hahaha but if anyone can improve or correct code be welcome. unfortunately could not template to show game picture and nothing like that, as game entity doesn’t show picture url…

        xbox: |
          <b>
          {%- set player1_on = states('binary_sensor.player1') %}
          {%- set player2_on = states('binary_sensor.player2') %}
          {%- set player1_game = states('sensor.player1_status') %}
          {%- set player2_game = states('sensor.player2_status') %}
          {% if not is_state('sensor.player1_status', 'unknown') %}
            {%- if (player1_on | selectattr('state','eq','on')) and (player2_on | selectattr('state','eq','off')) -%}
              Player1 is playing {{ player1_game | regex_replace(',([^,]*)$') }}.
            {%- elif (player1_on | selectattr('state','eq','off')) and (player2_on | selectattr('state','eq','on')) -%}
              Player2 is playing {{ player2_game | regex_replace(',([^,]*)$') }}.
            {%- elif (player1_on | selectattr('state','eq','on')) and (player2_on | selectattr('state','eq','on')) -%}
              Player1 and PLayer2 are playing {{ player1_game | regex_replace(',([^,]*)$') }}.
            {%- endif %}
          {%- else %}
            <font color='#6a7377'>Nobody is playing...</font>
          {%- endif -%}
          </b>
2 Likes


79 / 5 000

how can i make the sidebar do it? i want to have hours, weather, etc …

how can i make the sidebar do it? i want to have hours, weather, etc …

That is usually caused by the theme not being set to ‘tablet’ under user profile (bottom left).

image

1 Like

I suppose there is no sandbox to develop this UI in? I would like to implement this but do not want to destroy my working dashboard while I get it set up. Any ideas?

You can set up another container with a different port

No issues here, not using jinja styling very much though

i’m having a hard time understanding what this does in the conditional automation for your media players

{% set media_players = 
            [states.media_player.livingroom_sonos, states.media_player.livingroom, 
            states.media_player.spotify_xxx] %}
          {% if media_players | selectattr('state','eq','playing') | list | count == 0 %}
            {% if media_players | selectattr('state','eq','paused') | list | count == 0 %}
            gallery
            {% else %}
            {{ media_players | selectattr('state','eq','paused') | map(attribute='name') | max }}
            {% endif %}
          {% else %}
          {{ media_players | selectattr('state','eq','playing') | map(attribute='name') | max }}
          {% endif %}

What’s does the (‘state’, ‘eq’, ‘paused’) part represent?

The “max” filter can’t be used on an empty list. If media playing equals 0, check if anything is paused, else select “recently downloaded”

Hey,

can you share please your switch settings for switch.kids_iphone

thanks

The method I am using only works if you are using the UniFi controller using the UniFi Network integration.

On the Integrations screen, click configure for the UniFi network the device it is on. On the first setting screen, make sure the AP the device is connected to is checked. All wired connections will show up. On the next screen, you can select all of the devices you would like to control. This is what creates the switches. You can hit submit on the 3rd settings screen.

1 Like

I’m using a Gallery Card instead of the Plex entity in the conditional media, but I can’t figure out how to get the corners round. I messed something up while editing the base_media (which I renamed gallery_media)

- type: conditional
                    conditions:
                      - entity: input_select.conditional_media
                        state: gallery
                    card:
                      type: custom:button-card
                      entity: sensor.gallery_images
                      name: Gallery
                      show_entity_picture: false
                      show_state: false
                      custom_fields:
                        picture-elements:
                          card:
                            type: 'custom:gallery-card'
                            entities:
                              - sensor.gallery_images
                            menu_alignment: hidden
                            slideshow_timer: 120
                            maximum_files: 30
                            file_name_format: '%YYY_%m_%d_%H_%M_%S'
                            caption_format: ' '
                      template:
                        - gallery_media

I created a new gallery_media:

#################################################
#                                               #
#                 GALLERY MEDIA                 #
#                                               #
#################################################

gallery_media:
  aspect_ratio: 1/1
  show_state: false
  show_icon: false
  show_entity_picture: false
  show_label: false
  show_last_changed: false
  show_name: false
  tap_action:
      action: none
  style:
    height: 100%
    width: 100%
    top: 50%
    left: 50%
  state:
    - styles:
        entity_picture:
          - filter: grayscale(100%) blur(4px)
          - transition: all 0.5s ease
      value: paused
  styles:
    card:
      - padding: 0px
      - background-color: var(--card-background-off)
      - border-radius: calc(var(--custom-button-card-border-radius) / 2)
      - backdrop-filter: blur(0) #fix chrome bug
      - -webkit-clip-path: inset(0) #fix safari bug
    entity_picture:
      - border-radius: 20px
      - height: 100%
      - width: 100%
      - position: absolute
      - transition: all 0.5s ease
    custom_fields:
      blur:
        - z-index: 2
        - top: 75%
        - left: 0%
        - width: 100%
        - height: 25.5%
        - position: absolute
        - background-color: rgba(0, 0, 0, 0.2)
        - backdrop-filter: blur(0.4em)
        - -webkit-backdrop-filter: blur(0.4em)

Could anyone help out?

Where do you find sensor.player2_status?
I’m using the xbox integration but it only gives me binary_sensor.player

1 Like

Hi all.
Could someone explain to me what I’m doing wrong?
If I put together the grid so everything is on top of everything

  - 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  clima       comedor          cuartos ."
        "sidebar  media       entretenimiento  encasa ."
        ". . . ."

Figured it out.
player has to be added as a favorite on the xbox.
https://www.home-assistant.io/integrations/xbox/

1 Like

Hey all,

first of all @Mattias_Persson thank you very much for that awesome dashboard design. You did a great job on this!

I’m currently trying to setup the dashboard within my local home assistant instance and while it is working on a Windows machine (Firefox) it does not seem to work on iOS tablets/ Android smartphones. The design seems to be a bit off there.

It looks like this for the following devices/ browsers:
Windows (Chrome), iOS (Safari + App), Windows (Home Assistant Desktop), Android Phone (Firefox + App).

However, when I run it in Firefox on my Windows machine it looks just fine.
Am I missing something here? Why are these other devices not picking up that design?

Thanks in advance!

This is cool expect it still says I’m playing the xbox 9 hours after I turned it off. Wouldn’t you want to only see when you are playing?