Skip to content

Binary Card with Alert #3

Swiss Army Knife Functional Card Binary Sensor With Alert3 D06 Light Off Swiss Army Knife Functional Card Binary Sensor With Alert3 D06 Light On
Swiss Army Knife Functional Card Binary Sensor With Alert3 D06 Dark Off Swiss Army Knife Functional Card Binary Sensor With Alert3 D06 Dark On

This card uses the Material 3 theme D06, TealBlue

Description Aspect Ratio Target Size
A card that shows the state of a binary sensor, including an icon as an alert.
Nice for doors, windows and occupancy alerts.
3/1 Grid with 3 columns
SAK Tool Used for
Badge Background of card. Left part is animated, state dependent
Icon Entity Icon. Animated, state dependent. Red if active
Name Name of Entity
State Secondary Info of Entity
Icon Normal battery Icon in the upper left corner of the card. Animated, state dependent. Becomes yellow or blinking red if battery almost dead. Entity can be disabled

Interaction

Part Description
Card All tools connected to an entity do show by default the "more-info" dialog once clicked

Usage

1.0.0-rc.3

Replace example entities with your entities!

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
- type: 'custom:swiss-army-knife-card'
  entities:
    - entity: binary_sensor.livingroom_movement_occupancy
      name: 'Bin Alert #3'
    - entity: binary_sensor.livingroom_movement_occupancy
      secondary_info: last_changed
      format: relative
    - entity: sensor.livingroom_movement_battery
      decimals: 0
  layout:
    template:
      name: sak_layout_fce_binary_alert3
Data Default Required Description
entities The three required entities
sak_layout_binary_alert_battery_entity_disabled false If no battery entity available for this sensor. Disable this tool

YAML Template Definition

1.0.0-rc.3

Full definition of layout template
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
sak_layout_fce_binary_alert3:
  template:
    type: layout
    defaults: 
      - sak_layout_binary_alert_battery_entity_disabled: false
  layout:
    aspectratio: 3/1
    toolsets:
      # ================================================================
      - toolset: badge-background
        position:
          cx: 150                           # Center at middle of card
          cy: 50                            # Center at middle of card
        tools:
          - type: badge
            position:
              cx: 50
              cy: 50
              height: 100                   # Badge covers the full..
              width: 300                    # ...size of the card
              ratio: 25
              radius: 5
              divider: 20
            entity_index: 0                 # Uses entity 0
            animations:
              - state: 'on'                 # Animate for state ON
                styles:
                  left:
                    fill: var(--theme-sys-color-primary)
              - state: 'off'                # Animate for state OFF
                styles:
                  left:
                    fill: var(--theme-sys-elevation-surface-neutral4)
            styles:
              left:
                fill: grey
              right:
                fill: none                 # Show background of card

      # ================================================================
      - toolset: column-icon
        position:
          cx: 37.5
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 50
              cy: 50
              align: center
              icon_size: 45
            entity_index: 0
            animations:
              - state: 'on'
                icon: 'mdi:fire-alert'
                styles:
                  icon:
                    fill: var(--brand-google-red)
                    opacity: 1
              - state: 'off'
                icon: 'mdi:fire'
                styles:
                  icon:
                    fill: var(--theme-sys-color-secondary)
                    opacity: 0.9
            styles:
              icon:
                fill: var(--primary-background-color)
                opacity: 0.9

      # ================================================================
      - toolset: battery-icon
        disabled: '[[sak_layout_binary_alert_battery_entity_disabled]]'
        position:
          cx: 280
          cy: 15
          rotate: 90
        tools:
          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 50
              cy: 50
              align: center
              icon_size: 30
            entity_index: 2
            animations:
              - state: '20'             # Battery almost dead!
                operator: <=
                styles:
                  icon:
                    animation: blinkingText 2s ease-in-out both infinite
                    fill: var(--brand-google-red)
              - state: '30'             # Battery warning!
                operator: <=
                styles:
                  icon:
                    fill: var(--brand-google-yellow)
            styles:
              icon:
                fill: var(--theme-sys-color-tertiary)
                opacity: 0.5

      # ================================================================
      - toolset: column-name
        position:
          cx: 100               # Left part = 75, so 75+(300-75)/2
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: name
            position:
              cx: 50
              cy: 40
            entity_index: 0
            styles:
              name:
                text-anchor: start
                font-size: 30em
                font-weight: 700
                opacity: 1
          # ------------------------------------------------------------
          - type: state
            position:
              cx: 50
              cy: 70
            entity_index: 1
            show:
              uom: none
            styles:
              state:
                text-anchor: start
                font-size: 16em
                font-weight: 500
                opacity: 0.7