đŸ”č fold-entity-row - Hide away stuff in entities cards

Hi,

I have an issue since i updated to latest HA version, the label wont show up:
as you can see in picture below, i have three labels : Fan, Computers & Peripherals, TV

Non of them appearing, i can access the entities , just the label missing.

Code:

  plugpop:
    card: 
      type: 'custom:button-card'  
      color: auto
      size: 30%
      icon: '[[icon]]'
      entity: '[[entity]]'
      show_last_changed: true
      aspect_ratio: 1/1
      show_state: true
      name: '[[name]]'
      show_label: true
      custom_fields:
        notification: '[[notification]]'
      tap_action:
        action: call-service
        service: browser_mod.popup
        service_data:
          title: Devices
          style:
            background: var(--background-image)
            color: AliceBlue
            border-radius: 15px
            --ha-card-border-radius: 15px
            --ha-card-background: '#646464'
          card:
            type: entities
            style: |
              ha-card {
                --primary-text-color: AliceBlue;
                --secondary-text-color: AliceBlue;
                --paper-item-icon-color: AliceBlue;
                color: AliceBlue;
              }
            entities:
              - type: custom:fold-entity-row
                head:
                  type: section
                  label: Fan
                open: true
                entities:
                  - entity: fan.ceiling_fan
                  - entity: fan.xiaomi_smart_fan
                  - entity: switch.sonoff_10006ceeab
                    name: Corner Fan
                    icon: mdi:fan
              - type: custom:fold-entity-row
                head:
                  type: section
                  label: Computers & Peripherals
                open: true
                entities:
                  - entity: switch.desktop
                    icon: mdi:desktop-tower
                  - entity: switch.mini_pc
                    icon: mdi:desktop-tower
                  - entity: display.mi_pad_4
                    icon: 'mdi:tablet-dashboard'
                    name: Mi Pad 4
                  - entity: binary_sensor.hp_printer_status
                    name: Printer
                    icon: mdi:printer
              # - type: custom:fold-entity-row
                # head:
                  # type: section
                  # label: Climate
                # open: false
                # entities:
                  # - type: custom:more-info-card
                    # entity: climate.mzgn_slvn
                    # title: Living Room               
                  # - type: custom:more-info-card
                    # entity: climate.mzgn_khdr_shynh
                    # title: Bedroom
              - type: custom:fold-entity-row
                head:
                  type: section
                  label: TV
                open: false
                entities:
                  - type: custom:more-info-card
                    entity: media_player.living_room_tv
                    title: TV Living Room
                  - type: custom:more-info-card
                    entity: media_player.bedroom_tv
                    title: TV Bedroom 

Thanks,

i don know how, but now it’s working so weird.

If you have problems after upgrading to 0.107, update fold-entity-row.
If you still have problems, it’ll be down to your browser cache in 11 cases of 10.

To make sure, open your browser console and look for “FOLD-ENTITY-ROW 1.0.1 IS INSTALLED”.
If you do not see that - clear your caches.
If you do see that, and it still doesn’t work - first try clearing your caches anyway, then ask.

1 Like

@thomasloven as you don’t have “Create Feature Request” on Github, I’ll ask here.
Could you consider allowing a card in head section? It would be really useful and make a lot of new use cases available.

For example, I currently have this (custom:stack-in-card with 6 button-cards inside)
Screen Shot 2020-03-31 at 08.53.03 (2)

that can be opened if I double-tap on the fan icon

but the top row and the extended view are completely independent entities so to achieve my goal I need to hide the bottom bits (2 fold-entity-rows and one input_boolean) individually using card-mod (or even mod-card) - and that’s not the nicest way of doing things.

If I had an ability to use my custom:stack-in-card as head card, it’d be much easier, neater and more intuitive as user could see a chevron next to the row (now only I know about that double-tap action :wink: ).

By the way, thanks a lot for the hui-element, you created it just in time (I use it to add input_numbers as cards to stack-in-card here)! :+1:

“Hey, could you add this feature?
By the way, thanks for creating this thing that does exactly that!”

Huh?
What am I missing here?

Easy! The part up to “By the way” was about feature request for fold-entity-row.
The “By the way” bit was about your new hue-element card - it works like a charm and all input_booleans on the screenshot are added to stack-in-card using that card (without a need of creating an intermediate card for it).

Are you familiar to The Unix Philosophy?
It’s a set of rules-of-thumb for how the programs in unix based computer systems should work.
The two most important parts are:

  • Write programs that do one thing and do it well.
  • Write programs to work together.

I won’t go into detail about all the reasons why this is such a great idea, but the gist of it is that yes, I could add that feature to fold-entity-row, document it, work around it on every future change, fix bugs in it, make sure it keeps up with changes in Home Assistant that would make it break, and make every user download a larger code file every time they reload lovelace. Or I could tell the few people who would want this to use the already existing thing that does exactly this, and you could add one more line of code to your configuration.

I’m in since 2k.

tell me please. I’m new to all this LL stuff and that’s why I’m asking here.




Ok.

You see, there’s this thing I made that exists purely to put cards where a row is expected, such as in fold-entity-row. It’s called hui-element, and was mentioned earlier in this thread. Use that.

1 Like

Ah
 Do you know what? After reading the docs (and they don’t say a lot on head tbh) and seeing this

head:
  type: section
  label: Nested

or this

head: light.bed_light

I had an impression that it can be only entity_id or special things like section.
My brain is still confused sometimes about all these rows, cards etc.
Now I realise that if we can use section, it’s a row element (not just a name) and yes, it’s possible to put hui-element there.

Thanks for the hint, I’ll give it a go.
Maybe the docs will do with some extra words/example to help people like me understand what head can accept? :wink:

UPDATE: yes, it works like a charm. thanks Thomas!

1 Like

@thomasloven could you give me a hint how to achieve the following:
I use hui-element to add a complex card (custom:stack-in-card with several custom:button-cards inside) as head of fold-entity-row.
Currently if I click on one of the button-card, two things happen:

  1. fold-entity-row folds/unfolds.
  2. More-info dialog of the entity I clicked on appears.

I’d love to change it so only (2) happens and the fold-entity-row folds/unfolds only if I click on a chevron.
Could you advise me on what can be done here?

Using a card in head is not really supported, but you could try to add tap_action: true to the card configuration. That might work.

Thanks Thomas, I added tap_action: true to configuration of the card that is in head (stack-in-card) but it didn’t change anything :frowning:

sorry, I know this is a real noob question but I am a real beginner at all this and trying to read/learn/play but struggling.

I have this:

type: entities
title: Lawn Back Left
icon: 'mdi:sprinkler'
state_color: true
show_header_toggle: false
entities:
  - switch.lawn_on_left_zone
  - type: 'custom:fold-entity-row'
    head:
      type: section
      label: Zone Timer
    entities:
      - input_number.plant_back_mins_on

all works (althoguh get error Expected a value of type undefined for icon but received "mdi:sprinkler". but the icon is there.

but, how do i add name and icon to my entities? I have tried the normal icon: mdi:xxxx but it doesnt work.

i want something like this:

type: entities
title: Lawn Back Left
icon: 'mdi:sprinkler'
state_color: true
show_header_toggle: false
entities:
  - switch.lawn_on_left_zone
  icon: mdi: sprinkler
  name: Zone status
  - type: 'custom:fold-entity-row'
    head:
      type: section
      label: Zone Timer
    entities:
      - input_number.plant_back_mins_on
      name: Timer set for 

hope someoe can help, spent hours on it lol moving things around and reading but no joy. thanks in advance
Darren

When you want more control over the entity you need to define things slightly differently. The entity id itself needs to be preceded by the ‘entity’ key, your indentation is also a bit off.

Try this 


type: entities
title: Lawn Back Left
icon: 'mdi:sprinkler'
state_color: true
show_header_toggle: false
entities:
  - entity: switch.lawn_on_left_zone
    icon: mdi:sprinkler
    name: Zone status
  - type: 'custom:fold-entity-row'
    head:
      type: section
      label: Zone Timer
    entities:
      - entity: input_number.plant_back_mins_on
        name: Timer set for 

perfect, thank you so much, you I realised the alignment was a little out as i just typed it in here as an example, i was missing the entity at the front, works perfectly, thank you so much for taking the time to help.

EDIT: solved, see bottom

Maybe I am missing something really obvious, but it is frustrating me.

Using this code, I get a nice folding card with light entities and cover controls, but when I would like to create a list of sensors with one specific sensor “above the fold”, it gets me an error (Cannot read property 'map' of undefined / type: 'custom:fold-entity-row' / head: sensor.diesel_u with / being a new line).

What am i missing here?

# This works fine
      - type: entities
        style: |
         ha-card {
          margin: 0px 14px -5px 14px;
          }
        entities:
          - type: custom:fold-entity-row
            head: group.lampen_woonkamer
          - light.eetkamer_level
          - binary_sensor.door_contact_2
          - binary_sensor.door_contact_1
          - cover.zolder

# This doesn't work - the header errors out but the 4 rows are shown (not folded)
      - type: entities
        style: |
         ha-card {
          margin: 0px 14px -5px 14px;
          }
        entities:
          - type: custom:fold-entity-row
            head: sensor.diesel_u
          - sensor.diesel_u
          - sensor.diesel_z
          - sensor.benzine_u
          - sensor.benzine_z

EDIT: And by typing this and looking at it again, I suddenly appears to me that I forgot to specify the entities key:

# This works fine
      - type: entities
        style: |
         ha-card {
          margin: 0px 14px -5px 14px;
          }
        entities:
          - type: custom:fold-entity-row
            head: sensor.diesel_u
            entities:
            - sensor.diesel_u
            - sensor.diesel_z
            - sensor.benzine_u
            - sensor.benzine_z
1 Like

Is there a way to add mdi icons to section labels?

    head:
      label: Doors
      type: section

I’ve tried this

    head:
      label: 
        type: markdown
        content: |
          <ha-icon icon="mdi:door"></ha-icon> Doors
      type: section

but [object Object] is displayed instead of the icon+text.

You’d have to check the section row documentation for that.

It does not appear possible at this time. Guess I’m waiting for the icon configuration variable to be added section, but I was hoping there’d be a way to fudge it for now. Thanks for the link.