#Auto Entities with individual cards

1 messages · Page 1 of 1 (latest)

civic totem
#

I got a moment while at work to try to get this posted for you. In this example, an Auto Entities card will show all light entities whose name ends with _lights and are currently turned on. A custom:layout-card handles the layout of three cards wide. Each entity will get its own custom:button-card stylized exactly how I want it.

#
type: custom:auto-entities
card:
  type: custom:layout-card
  layout_type: custom:grid-layout
  layout_options:
    width: 100
  layout:
    grid-template-columns: auto auto auto
    grid-template-rows: auto
filter:
  include:
    - entity_id: light.*_lights
      options:
        type: custom:button-card
        entity_id: this.entity_id
        layout: vertical
        show_last_changed: true
        aspect_ratio: 1/1
        styles:
          card:
            - box-shadow: none
            - background-color: transparent
            - border: 1
            - padding: 15%
            - color: yellow
            - opacity: 1
            - font-size: 10px
            - text-shadow: 0px 0px 5px black
            - text-transform: capitalize
          icon:
            - width: 40%
            - padding-top: 10px
          label:
            - color: gray
            - font-size: 10px
            - padding-top: 0px
            - opacity: 0.7
          name:
            - white-space: normal
            - font-weight: 300
            - font-size: 10px
            - color: white
        tap_action:
          action: toggle
        hold_action:
          action: more-info
  exclude:
    - state: 'off'
    - entity_id: '*screen*'
    - entity_id: light.all_lights
    - state: '0'
    - state: unavailable
sort:
  method: name
  reverse: false
  numeric: false
show_empty: true
#

As lights are tapped (toggled to off), they will disappear from this card because they no longer meet the criteria (being on.)

hallow snow