• Stars
    star
    595
  • Rank 75,217 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ”Ή A foldable row for entities card, containing other rows

fold-entity-row

Fold away and hide rows in lovelace entities cards.

Installing

hacs_badge

Install using HACS or see this guide.

Quick Start

Add this to an entities card:

type: entities
entities:
  - light.bed_light
  - type: custom:fold-entity-row
    head: light.bed_light
    entities:
      - light.bed_light
      - light.ceiling_lights
      - light.kitchen_lights

This will show the row specified in head: with an arrow next to it. When clicked, the rows specified in entities: will be revealed.

fold-entity-row

NOTE: You wouldn't believe how many people miss the first line in this section.

Add this TO AN ENTITIES CARD.

This is NOT meant to be used except in an entities card. Any usage outside an entities card is entirely unsupported, and I won't help you fix it.

Usage

  • head: and any row in entities: can be customized in exactly the same ways as ordinary entities card rows.
type: entities
entities:
  - type: custom:fold-entity-row
    head:
      type: section
      label: Customizations
    entities:
      - light.bed_light
      - entity: light.ceiling_lights
        name: A light
      - light.kitchen_lights

NOTE: I'm sorry, dear reader, for insulting your intelligence and including the two lines:

type: entities
entities:

in every example, even though it is implied and the fact that fold-entity-row shall only ever be used in an entities card has been thoroughly beaten to death at this point.

I really, really wish I didn't have to...

Another example of customizing the head entity:

type: entities
entities:
  - light.bed_light
  - entity: light.bed_light
    icon: mdi:lamp
  - type: custom:fold-entity-row
    head:
      entity: light.bed_light
      icon: mdi:lamp
    entities:
      - light.ceiling_lights
      - light.kitchen_lights

NOTE: On a regretably similar note as above; if it's not entirely obvious to you why the configuration of head: looks this way, please do both of us a favor and go back to read the documentation of the entities card again.
Then play around with just the entities card for a while, get to know it, try things out, experiment. Then come back to fold-entity-rows in a week or two.

That also applies if you've never seen type: section before and think that's something I just made up.
I will not answer any more questions about its use. It's a Home Assistant feature, not a fold-entity-row one.

  • Options specified in group_config: will be applied to all rows in the fold.
type: entities
entities:
  - type: custom:fold-entity-row
    head:
      type: section
      label: group_config
    group_config:
      secondary_info: last-changed
      icon: mdi:desk-lamp
    entities:
      - light.bed_light
      - light.ceiling_lights
      - light.kitchen_lights
  • The left side padding can be adjusted by the padding: parameter (value in pixels).
type: entities
entities:
  - type: entities
    entities:
      - type: custom:fold-entity-row
        head:
          type: section
          label: padding
        padding: 5
        entities:
          - light.bed_light
          - light.ceiling_lights
          - light.kitchen_lights
type: entities
entities:
  - type: custom:fold-entity-row
    head: group.all_lights
  • Setting open: to true will make the fold open by default.
type: entities
entities:
  - type: custom:fold-entity-row
    head:
      type: section
      label: open
    open: true
    entities:
      - light.bed_light
      - light.ceiling_lights
      - light.kitchen_lights

options

  • If the header or any row in the group has the following tap-, hold- or double-tap-action defined, it will toggle the fold open or closed:
tap_action:
  action: fire-dom-event
  fold_row: true
  • Fold entity row will try to figure out if the header should be clickable to show and hide the fold or not. If it guesses wrong, you can help it with clickable: true or clickable: false.
    This should only be used in exceptions, though. If your row supports tap_action use fire-dom-event instead.

Advanced

  • Folds can be nested
type: entities
entities:
  - type: custom:fold-entity-row
    head:
      type: section
      label: Nested
    entities:
      - type: custom:fold-entity-row
        head: light.bed_light
        entities:
          - type: custom:fold-entity-row
            head: light.bed_light
            entities:
              - light.bed_light
type: entities
entities:
  - type: custom:auto-entities
    filter:
      include:
        - domain: sensor
    card:
      type: custom:fold-entity-row
      head:
        type: section
        label: Automatically populated

advanced

  • If entity (not entities) is set and is a group, it will be expanded
type: custom:auto-entities
card:
  type: entities
  title: All groups
filter:
  include:
    - domain: group
      options:
        type: custom:fold-entity-row

image

More examples

All my test cases are available in the test/views directory.

You can a demo in docker by going to the test directory and running:

docker-compose up

Then going to http://localhost:8125 and logging in with username dev and password dev.

Or you could use the vscode devcontainer and run the task "Run hass".

FAQ

Why isn't the card header toggle working with all the entities in my fold?

This is a limitation in Home Assistant. The header toggle will look at each entry in the entities card, and if it has an entity option, it will toggle that. Nothing more.

Why is there a line above the section row?

Because that's how the Home Assistant Section Entities Row looks.

Why all the passive aggressivenes?

I'm just So Bloody Tired of this - that's why.

NOT EVERYTHING IN LOVELACE IS A CARD!

Does anyone ever actually ask the questions in your Frequently Asked Questions?

No

Why doesn't this card have a background?

Please leave


Buy Me A Coffee

More Repositories

1

hass-browser_mod

πŸ”Ή A Home Assistant integration to turn your browser into a controllable entity and media player
TypeScript
1,314
star
2

lovelace-auto-entities

πŸ”ΉAutomatically populate the entities-list of lovelace cards
TypeScript
1,271
star
3

lovelace-card-mod

πŸ”Ή Add CSS styles to (almost) any lovelace card
TypeScript
1,143
star
4

lovelace-layout-card

πŸ”Ή Get more control over the placement of lovelace cards.
TypeScript
1,064
star
5

lovelace-slider-entity-row

πŸ”Ή Add sliders to entity cards
TypeScript
818
star
6

lovelace-state-switch

πŸ”ΉDynamically replace lovelace cards depending on occasion
TypeScript
400
star
7

hass-fontawesome

πŸ”Ή Use icons from fontawesome in home-assistant
Python
284
star
8

lovelace-card-tools

πŸ”ΉA collection of tools for other lovelace plugins to use
JavaScript
247
star
9

lovelace-template-entity-row

πŸ”Ή Display whatever you want in an entities card row.
TypeScript
221
star
10

hass-lovelace_gen

πŸ”Ή Improve the lovelace yaml parser for Home Assistant
Python
218
star
11

hass-config

My Home Assistant configuration
Python
213
star
12

lovelace-more-info-card

πŸ”Ή Display the more-info dialog of any entity as a lovelace card
TypeScript
150
star
13

lovelace-hui-element

πŸ”Ή Use built-in elements in the wrong place
TypeScript
109
star
14

hass-favicon

πŸ”Ή Change the favicon of your Home Assistant instance
Python
104
star
15

lovelace-flower-card

JavaScript
102
star
16

lovelace-card-modder

JavaScript
101
star
17

lovelace-popup-card

JavaScript
94
star
18

hass-plejd

πŸ”Ή Plejd BLE integration for Home Assistant
Python
90
star
19

round-slider

JavaScript
85
star
20

lovelace-badge-card

πŸ”Ή Place badges anywhere in the lovelace layout
JavaScript
81
star
21

lovelace-toggle-lock-entity-row

JavaScript
62
star
22

lovelace-fullykiosk

Lovelace plugin for using Fully Kiosk Browser features in home-assistant
JavaScript
61
star
23

homeassistant-lovelace-gen

A lovelace configuration file generator for home assistant
Python
57
star
24

lovelace-player

Lets any browser currently viewing your lovelace interface act as an audio receiver with a media_player interface
JavaScript
50
star
25

mittos64

C
47
star
26

lovelace-theme-maker

JavaScript
42
star
27

lovelace-browser-commander

JavaScript
33
star
28

lovelace-gap-card

πŸ”Ή A lovelace card that does nothing and looks like nothing. Incredibly useful! No, really.
JavaScript
31
star
29

lovelace-useful-markdown-card

JavaScript
30
star
30

hass-custom-devcontainer

A devcontainer for developing and testing custom Home Assistant stuff
Shell
29
star
31

homeassistant-2020-presentation

18
star
32

lovelace-gui-sandbox

πŸ”Ή Lets you play around with the GUI editors even if you're using YAML mode
JavaScript
17
star
33

lovelace-markdown-mod

JavaScript
16
star
34

lovelace-color-picker

JavaScript
14
star
35

lovelace-card-loader

JavaScript
13
star
36

plejd2mqtt

JavaScript
12
star
37

lovelace-column-card

A columnizing card for lovelace ui for home-assistant.
JavaScript
12
star
38

card-tools

A collection of tools to help develop lovelace cards
JavaScript
11
star
39

os5

My attempts at developing an operating system kernel.
C
11
star
40

lovelace-dummy-entity-row

πŸ”Ή An entity row with only icon and name
JavaScript
10
star
41

lovelace-q-card

JavaScript
9
star
42

lovelace-long-press

JavaScript
9
star
43

lovelace-time-input-row

JavaScript
9
star
44

nextrevo-mod

How I use the E3D Revo system with Prusa Nextruder
8
star
45

dito

A library and some tools for handling disk image files.
C
8
star
46

mittsnap

rsnapshot-like tool that leverages btrfs snapshots
Shell
5
star
47

dotfiles

MATLAB
5
star
48

lovelace-color-glance-card

A glance card with a colorized background
JavaScript
3
star
49

lovelace-icon-headers

WIP
JavaScript
2
star
50

lovelace-wbah

Lovelace with bluejays and herons
TypeScript
2
star
51

pyplejd

Python
2
star
52

os4

C
1
star
53

new-hass-config

Python
1
star
54

z80Monitor

Assembly
1
star
55

vim-tstatus

My status line for vim
Vim Script
1
star
56

mittos64-old

C
1
star
57

hass-plant_helper

πŸ”Ή Home Assistant Helper for monitoring plant health using MiFlora devices
Python
1
star