🔹 fold-entity-row - Hide away stuff in entities cards

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?

Yes, it is.

Hi there,
Is it possible to simply use a text / label as the head, without having the section line displayed on the interface ? alternatively, how can I hide the section line ?
Thanks !

1 Like