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

Just set the head type to whatever you want.

must be missing the obvious, … , but I cant get an auto-entities card to show under the fold-entity-row.

this is what I have now:

  - type: entities
    title: Telefoon Mobile app
    show_header_toggle: false
    entities:
      - device_tracker.telefoon
      - sensor.telefoon_battery_level
      - type: custom:fold-entity-row
        head:
          type: section
          label: Details
        entities:
          - sensor.telefoon_activity
          - sensor.telefoon_average_active_pace
          - sensor.telefoon_battery_level
          - sensor.telefoon_battery_state
          - sensor.telefoon_bssid
          - sensor.telefoon_connection_type
          - sensor.telefoon_distance
          - sensor.telefoon_floors_ascended
          - sensor.telefoon_floors_descended
          - sensor.telefoon_geocoded_location
          - sensor.telefoon_last_update_trigger
          - sensor.telefoon_sim_1
          - sensor.telefoon_ssid
          - sensor.telefoon_steps

showing as:

29


and also this works as standalone card:

  - type: custom:auto-entities
    card:
      type: entities
    filter:
      include:
        - entity_id: "sensor.telefoon_*"

but if I try to put the auto-entities under the fold like this:

  - type: entities
    title: Telefoon Mobile app
    show_header_toggle: false
    entities:
      - device_tracker.telefoon
      - sensor.telefoon_battery_level
      - type: custom:fold-entity-row
        head:
          type: section
          label: Details
        entities:
          - type: custom:auto-entities
            card:
              type: entities
            filter:
              include:
                - entity_id: "sensor.telefoon_*"

I do see the fold, but its not populated.

checking the example on https://github.com/thomasloven/lovelace-fold-entity-row which says:

type: custom:auto-entities
filter:
  include:
    - domain: sensor
card:
  type: custom:fold-entity-row
  head:
    type: section
    label: Automatically populated

makes my head spin… I dont see it, please help?

thanks

unless… this would do it?

  - type: entities
    title: Telefoon Mobile app auto
    show_header_toggle: false
    entities:
      - device_tracker.telefoon
      - sensor.telefoon_battery_level
      - type: custom:auto-entities
        filter:
          include:
            - entity_id: "sensor.telefoon_*"
        card:
          type: custom:fold-entity-row
          head:
            type: section
            label: Details

update
yes it does… sorry for the post, was just very confused by the order of the config which seems upside down.

Auto-entities fills the entities: list of the card contained inside it.

Generally in lovelace any card can affect cards inside it (i.e. further to the right in the indentation), but not the other way around. So you’ll just need to think about what should do what to what?

yes, Thomas, I see now how this works, and does so beautifully! thank you very much indeed!

Let me ask to go 1 step further…

I have many devices with the mobile_app, and they all create sensors and a device_tracker with the entity_id.

Would there be a way to have the config I posted above created automatically for these devices? Would compress the amount of yaml even further :wink:

  - type: entities
    title: {{device_id}} Mobile app
    show_header_toggle: false
    entities:
      - device_tracker.{{device_id}}
      - sensor.{{device_id}}_battery_level
      - type: custom:auto-entities
        filter:
          include:
            - entity_id: "sensor.{{device_id}}_*"
        card:
          type: custom:fold-entity-row
          head:
            type: section
            label: Details
1 Like

I think that could be done with lovelace_gen or maybe the decluttering card.

yes, of course! had only used that for buttons until now…
decluttering template

card:
  type: entities
  title: '[[id]] Mobile app'
  show_header_toggle: false
  entities:
    - 'device_tracker.[[id]]'
    - 'sensor.[[id]]_battery_level'
    - type: custom:auto-entities
      filter:
        include:
          - entity_id: 'sensor.[[id]]_*'
      card:
        type: custom:fold-entity-row
        head:
          type: section
          label: Details

does the trick, (only need to find a way to capitalize the title field)

update

posted the question in the relevant thread for decluttering card: Lovelace: Decluttering Card - #107 by Mariusthvdb

There might a way, since lovelace_gen allows for Jinja 2 templating.
According to this, using :

{{ 'my First cAR'|capitalize }}

will output

My first car

I haven’t tested it yet, but I’m looking for something similar. i’ll have a look at it in the next few days.

Edit: It works

    - !include
      - ../../templates/button_chore.yaml
      - chore: chores_livingroom_clean_floor
        name: {{ 'Nettoyer Le Sol'|capitalize }}

Gives me
image

you’re suggesting this would work for my decluttering template also? All I can see is the actual code with the {{ }} braces…

Not sure about decluttering template … However you can achieve a similar result with lovelace_gen only, this I’m pretty sure of. Use an include statement with id as parameter and it should work as intended.

ok thanks.
Don’t use lovelace_gen though, thought that to be the auto ui-lovelace.yaml generator? I use yaml mode for lovelace so need to write it myself :wink:

not to clutter this thread any further, I’ll take this to the decluttering card thread

another quest: can we template the head field somehow? I think Ive read all doc and examples, but can’t find it, yet it seems so very useful:

      - type: custom:fold-entity-row
        head:
          type: section
          label: >
            {% set unknown = states|selectattr('state','eq','unknown')|map(attribute='entity_id')|list %}
            Unknown entities: ({{ unknown|count }})
        entities:
          - type: custom:hui-markdown-card
            content: |
              {{ state_attr('sensor.entities_uun','Unknown')}}

which now renders:

40

47

so have to fall back to:

09

17

1 Like

Hey @thomasloven, is it possible to do a Horizontal stack for button cards within a folding row? Tried a couple of things but if Lovelace doesn’t start up error out, the whole row disappears.

Thank you :slight_smile:

Linton

Can I use fold-entity-row with upcoming-media-card?

How?

I try like this, but not working:

cards:
  - entities:
      - entity: sensor.kodi_recently_added_movies
        image_style: fanart
        date: ddmm
        clock: 24
        type: 'custom:upcoming-media-card'
      - entity: sensor.kodi_recently_added_movies
        image_style: fanart
        date: ddmm
        clock: 24
        type: 'custom:upcoming-media-card'
head:
  label: test
  type: section
type: 'custom:fold-entity-row'

or

cards:
  - entity: sensor.kodi_recently_added_movies
    image_style: fanart
    date: ddmm
    clock: 24
    type: 'custom:upcoming-media-card'
  - entity: sensor.kodi_recently_added_movies
    image_style: fanart
    date: ddmm
    clock: 24
    type: 'custom:upcoming-media-card'
head:
  label: test
  type: section
type: 'custom:fold-entity-row'

Yes. But it’s tricky: https://github.com/thomasloven/hass-config/wiki/Misc-tricks#cardelemententity-row-triality

What even is this?
cards:
- entities:
What?

1 Like

Sorry still learning correct card configuration:)

It’s all little blocks. Make each block work by itself, with something really simple inside, and then put the blocks together.

Start with an entities card with an upcoming-media-card in the entities.
Then try making a fold-entity-row with just a normal entity inside.
Then look at what’s simmilar between the entity card and fold-entity-row configurations…

Now I understan, thanks.

entities:
  - entity: sensor.kodi_recently_added_movies
    image_style: fanart
    type: 'custom:upcoming-media-card'
head:
  label: MOVIES
  type: section
padding: 0
type: 'custom:fold-entity-row'
cards:
  - entities:
      - entity: sensor.kodi_recently_added_movies
        image_style: fanart
        type: 'custom:upcoming-media-card'
    head:
      label: MOVIES
      type: section
    padding: 0
    type: 'custom:fold-entity-row'
  - entities:
      - entity: sensor.kodi_recently_added_tv
        image_style: fanart
        type: 'custom:upcoming-media-card'
    head:
      label: EPISODES
      type: section
    padding: 0
    type: 'custom:fold-entity-row'
type: horizontal-stack
1 Like

I have problem putting together fold-entity-row and tiles-card

tiles-card is working:

here is config:

card_settings:
  background: var(--paper-card-background-color)
  column_width: calc(97%/4)
  columns: 4
  row_height: 75px
  title_align: left
global_settings:
  border:
    color:
      value: black
    radius: 5px
    size: 3px
  icon:
    color:
      value: white
  label_sec:
    color:
      value: white
  shadow: 'elevation: 6dp'
entities:
  - column: 1
    entity: script.bedroom_rpi3_kodi_input_home
    icon:
      value: 'mdi:home'
    row: 1
  - column: 2
    entity: script.bedroom_rpi3_kodi_input_contectx_menu
    icon:
      value: 'mdi:menu'
    label_sec:
      value: Menu
    row: 1
  - background:
      value: '#2576da'
    column: 3
    entity: script.bedroom_rpi3_kodi_input_up
    icon:
      value: 'mdi:arrow-up-bold-circle'
    row: 1
  - column: 4
    entity: script.bedroom_rpi3_kodi_input_info
    icon:
      value: 'mdi:information-outline'
    label_sec:
      value: Info
    row: 1
  - column: 1
    entity: script.bedroom_rpi3_kodi_player_play_pause
    icon:
      value: 'mdi:play-pause'
    row: 2
  - background:
      value: '#2576da'
    column: 2
    entity: script.bedroom_rpi3_kodi_input_left
    icon:
      value: 'mdi:arrow-left-bold-circle'
    row: 2
  - column: 3
    entity: script.bedroom_rpi3_kodi_input_select
    icon:
      value: 'mdi:check-circle-outline'
    row: 2
  - background:
      value: '#2576da'
    column: 4
    entity: script.bedroom_rpi3_kodi_input_right
    icon:
      value: 'mdi:arrow-right-bold-circle'
    row: 2
  - column: 1
    entity: script.bedroom_rpi3_kodi_player_stop
    icon:
      value: 'mdi:stop'
    row: 3
  - column: 2
    entity: script.bedroom_rpi3_kodi_input_back
    icon:
      value: 'mdi:backburger'
    label_sec:
      value: Return
    row: 3
  - background:
      value: '#2576da'
    column: 3
    entity: script.bedroom_rpi3_kodi_input_down
    icon:
      value: 'mdi:arrow-down-bold-circle'
    row: 3
  - column: 4
    entity: script.bedroom_rpi3_kodi_input_next_subtitle
    icon:
      value: 'mdi:subtitles-outline'
    label_sec:
      value: Subtitle
    row: 3
  - column: 1
    entity: script.bedroom_rpi3_kodi_player_rewind
    icon:
      value: 'mdi:rewind'
    row: 4
  - column: 2
    entity: script.bedroom_rpi3_kodi_player_fast_fwd
    icon:
      value: 'mdi:fast-forward'
    row: 4
  - column: 3
    entity: script.bedroom_rpi3_kodi_player_skip_back
    icon:
      value: 'mdi:skip-previous'
    row: 4
  - column: 4
    entity: script.bedroom_rpi3_kodi_player_skip_next
    icon:
      value: 'mdi:skip-next'
    row: 4
  - column: 1
    entity: script.bedroom_rpi3_kodi_player_skip_back_30
    icon:
      value: 'mdi:rewind-30'
    row: 5
  - column: 2
    entity: script.bedroom_rpi3_kodi_player_skip_back_10
    icon:
      value: 'mdi:rewind-10'
    row: 5
  - column: 3
    entity: script.bedroom_rpi3_kodi_player_skip_forward_10
    icon:
      value: 'mdi:fast-forward-10'
    row: 5
  - column: 4
    entity: script.bedroom_rpi3_kodi_player_skip_forward_30
    icon:
      value: 'mdi:fast-forward-30'
    row: 5
type: 'custom:tiles-card'

This is closest I can get :slight_smile: If I remove card_settings: and global_settings: from tiles-card

Is tiles-card compatible with fold-entity-row?