šŸ”¹ fold-entity-row - Hide away stuff in entities cards

THANK YOU! Worked perfect.

It also fixed some oddity in one of my Lovelace dashboards where the fold would not work unless you waited like 5-10 seconds after opening that dashboard. Whatā€™s weird is that the same ā€˜badā€™ code (but many other different cards) opened fine in another dashboard. Anyhow, allā€™s wellā€¦

1 Like

what was your solution?

you can use the fold-entity-row in a stack, by wrapping it in an entities card in the stack.

yep, and this works too:

type: custom:hui-element
card_type: entities

which might be the same from a certain pov, but give one just that bit more flexibility if and when an entities card cant be used directly.

My solution:

type: vertical-stack
cards:
  - type: vertical-stack
    cards:
      - type: entities
        entities:
          - type: custom:fold-entity-row
            head:
              entity: light.all_lights
              name: ALL LIGHTS
              state_color: true
  - type: entities
    entities:
      - entity: [more entity stuff]

why the double vertical-stack? thereā€™s only 1 card in that second vertical stack? if thats all you have, you could even have it in a top entities: cardā€¦

type: entities
entities:
  - type: custom:fold-entity-row
    head:
      entity: light.all_lights
      name: ALL LIGHTS
    state_color: true # not sure about this indent (never use the state_color, but I think it should be set at the type card level
  - entity: [more entity stuff]

Hmmm, you raise a good question. Having 2 vertical-stackā€™s doesnā€™t seem right (though itā€™s working). Just made a code adjustment and this works also, and makes more sense:

type: vertical-stack
cards:
  - type: entities
    entities:
      - type: custom:fold-entity-row
        head:
          entity: light.all_lights
          name: ALL LIGHTS
          state_color: true
  - type: entities
    entities:
      - entity: [more entity stuff]

It does not make any sense.
The classic use is:

  - type: entities
    title: bla-bla
    entities:
      - entity: sun.sun
        ...
      - type: custom:fold-entity-row
        head:
          entity: sun.sun
          ...
        padding: 5
        open: true
        entities:
          - entity: sun.sun
            ...
          - entity: sun.sun
            ...
      - entity: sun.sun
        ...

vertical-stack has nothing directly to do with custom:fold-entity-row, itā€™s just that I need a vertical stack card. You can certainly use the fold-entity as you state.

what weā€™re saying is you can use an entities: card instead of the vertical stack (most of the time, and where not, you can use the custom:hui-element to fix it)

You did not get the point:
Here is an error - you specified ā€œheadā€ but forgot ā€œentitiesā€:

      - type: custom:fold-entity-row
        head:
          entity: light.all_lights
          name: ALL LIGHTS
          state_color: true

I think we might be getting into the minutia here, but I also wanted vertically-stacked, visibly separate cards, so thatā€™s why I used vertical-stack rather than just a list of entities. I suppose I also could list entities and put dividers between themā€¦

No, what theyā€™re saying is the lovelace yaml snippet you posted:

type: vertical-stack
cards:
  - type: entities
    entities:
      - type: custom:fold-entity-row
        head:
          entity: light.all_lights
          name: ALL LIGHTS
          state_color: true
  - type: entities
    entities:
      - entity: [more entity stuff]

isnā€™t a correct use of a fold-entity-row. This would be acceptable:

type: vertical-stack
cards:
  - type: entities
    entities:
      - type: custom:fold-entity-row
        entities:
          - entity: light.light1
          - entity: light.light2
          ...
        head:
          entity: light.all_lights
          name: ALL LIGHTS
          state_color: true
  - type: entities
    entities:
      - entity: [more entity stuff]

Complete working example using entities from my HA:

Iā€™ve just started to play around with this card, and I like it. One issue Iā€™m seeing is that my state color is not reflected for some entities, where it was before I put them into the fold-entity-row:

State

type: custom:fold-entity-row
title: Basement Lights
open: true
show_header_toggle: false
toggle: true
head:
  entity: group.basement_lights
  icon: mdi:lightbulb-group-outline
  toggle: true
group_config:
  secondary_info: last-changed
entities:
  - entity: switch.basement_lights
    name: Basement Lights
    secondary_info: last-changed
  - type: custom:slider-entity-row
    toggle: true
    entity: light.basement_alcove_lights
    name: Basement Alcove Lights
    secondary_info: last-changed
  - type: custom:slider-entity-row
    toggle: true
    entity: light.basement_floor_lamp
    name: Basement Floor Lamp
    secondary_info: last-changed
state_color: true

Any thoughts on why that might be?

EDIT: Actually, Iā€™ve noticed itā€™s not working on any entity thatā€™s not of type slider-entity-row. But the state color was definitely working before.

How can I make it so that it is like this?

So that you understand that in the upper photo, this is not a ready-made option, but just two cards have successfully formed and it turned out that the button is expanded, but in fact it does not unfold and does not hide.
image

I would like to use the Picture Entity, but I canā€™t figure out how to do it.

If I do as below, then I get it as in the screenshot
image

type: vertical-stack
cards:
  - type: custom:fold-entity-row
    head:
      type: section
      label: Manual operation
    open: true
    entities:
      - image: \local\photo\person_01.jpg
        entity: input_boolean.virtual_tracing_person
        name: Person
        show_state: false
        show_name: false
        tap_action:
          action: call-service
          service: input_boolean.toggle
        service_data: null
        target:
          entity_id: input_boolean.virtual_tracing_person
        hold_action:
          action: more-info
        aspect_ratio: '0'

Hi,

I am using fold-entity-row on a lovelace card that shows lights in a room.

        cards:
          - type: entities
            entities:
              - entity: light.sofa
              - type: custom:fold-entity-row
                head:
                  entity: light.table_group
                  name: table
              - type: custom:fold-entity-row
                head:
                  entity: light.bookshelf_group
                  name: bookshelf
            title: livingroom

Problem:

Usually, a header toggle appears on cards with multiple light entities to toggle all light entities on the card. In this case, though, the custom fold-entity-row entities are not recognised as lights on the room level and the room is considered to only have one light (sofa). Accordingly, the expected header toggle next to ā€œlivingroomā€ is not shown and, if forced to show (ā€œshow_header_toggle: trueā€), only switches the sofa light.

I can do this to fix this:

        cards:
          - type: entities
            entities:
              - entity: light.sofa
              - entity: light.table_group
                name: table
                type: custom:fold-entity-row
                head:
                  entity: light.table_group
                  name: table
              - entity: light.bookshelf_group
                name: bookshelf
                type: custom:fold-entity-row
                head:
                  entity: light.bookshelf_group
                  name: bookshelf
            title: livingroom

However, now the friendly names of the light groups are no longer overwritten (tried in two locations in the above code, fails in both). Any ideas?

You could create a light group for all the lights in the card and add it to the card as an entity:

        cards:
          - type: entities
            entities:
              - entity: light.group_all_lights
              - entity: light.sofa
              - type: custom:fold-entity-row
                head:
                  entity: light.table_group
                  name: table
              - type: custom:fold-entity-row
                head:
                  entity: light.bookshelf_group
                  name: bookshelf
            title: livingroom

The toggle for all lights wonā€™t be in the card header though, it will just be another row.

Id does sound like an issue. You could open a new issue here: Issues Ā· thomasloven/lovelace-fold-entity-row Ā· GitHub

I will rather accept the non-overwritten light group names than add an extra entity for the room. But the added entity may be a viable option for others, of course

I have opened an issue on GitHub.

For me, this code is strange since it does not have "entities" list.
That is why only the 1st entity row is shown:

I suspect that you are using yaml-modeā€¦ In storage mode the Editor will show you an error.

And this code seems meaningless for me:

This is pointed out in the quick start guide:

ā€œSetting head: to a group (including light group or cover group ) will populate the entities list with the entities of that group.ā€

You could also write it like this with some redundancy:

          - type: custom:fold-entity-row
            head:
              entity: light.bookshelf_group
              name: bookshelf
            entities:
              - light.bookshelf_1
              - light.bookshelf_2
              - light.bookshelf_3

It fixes the problem. However, the friendly names are not overwritten.

Is it a group?