Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.3 kB
22
Indexable
Never
cards:
  - type: custom:button-card
    color: var(--disabled-text-color)
    color_type: label-card
    name: Batteriezustand
  - type: custom:layout-card
    layout: horizontal
    min_columns: 4
    justify_content: left
    card:
      type: custom:auto-entities
      filter:
        include:
          - attributes:
              battery_level: '< 90'
            options:
              color: var(--disabled-text-color)
              color_type: label-card
              icon: >
                [[[ return entity.attributes.battery_level >= 100 ? 'mdi:battery' : (entity.attributes.battery_level > 0 ? 'mdi:battery-' + (parseInt(entity.attributes.battery_level / 10) * 10) : 'mdi:battery-alert'); ]]]
              label: >
                [[[ return entity.attributes.friendly_name; ]]]
              layout: vertical
              name: >
                [[[ return entity.attributes.battery_level + '%'; ]]]
              show_icon: true
              show_label: true
              styles:
                card:
                  - background-color: var(--disabled-text-color)
                icon:
                  - color: maroon
                label:
                  - font-size: 10px
                name:
                  - font-size: 12px