Skip to content

Binary Card with Alert #1

Swiss Army Knife Functional Card Binary Sensor With Alert1 D06 Light Off Swiss Army Knife Functional Card Binary Sensor With Alert1 D06 Light On
Swiss Army Knife Functional Card Binary Sensor With Alert1 D06 Dark Off Swiss Army Knife Functional Card Binary Sensor With Alert1 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 2 columns
SAK Tool Used for
Circle The half circle, as the left part of the circle is cutoff by the card. Animated, state dependent
Icon Entity Icon. Animated, state dependent
Icon Alert Icon. Animated, state dependent. Only visible if state is on
Name Name of Entity
State Secondary Info
Line Vertical line separator
Icon Battery state as icon. Animated, state dependent
SegArc Simple circle as segmented arc to show the battery level
State Value of battery level
Icon Linkquality icon
SegArc Simple circle as segmented arc to show the linkquality value
State Value of linkquality

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
13
14
15
- type: 'custom:swiss-army-knife-card'
  entities:
    - entity: binary_sensor.livingroom_movement_occupancy
      name: 'Bin Alert #1'
      # name: 'Movement'
    - entity: binary_sensor.livingroom_movement_occupancy
      secondary_info: last_changed
      format: relative
    - entity: sensor.livingroom_movement_battery
      decimals: 0
    - entity: sensor.livingroom_movement_linkquality
      decimals: 0
  layout:
    template:
      name: sak_layout_fce_binary_alert1
Data Default Required Description
entities The four required entities

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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
sak_layout_fce_binary_alert1:
  template:
    type: layout
    defaults: 
      - dummy: 0
  layout:
    aspectratio: 3/1
    toolsets:
      # ================================================================
      - toolset: half-circle
        position:
          cx: 0                             # Center on cards border 
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: circle
            position:
              cx: 50
              cy: 50
              radius: 50
            entity_index: 0
            animations:
              - state: 'on'
                styles:
                  circle:
                    fill: var(--theme-sys-color-primary)
                    # animation: flash 2s ease-in-out 5
              - state: 'off'
                styles:
                  circle:
                    fill: var(--theme-sys-elevation-surface-neutral4)
            styles:
              circle:
                stroke: none
                # transition: fill 1s ease

      # ================================================================
      - toolset: column-icon
        position:
          cx: 25
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 50
              cy: 50
              align: center
              icon_size: 35
            entity_index: 0
            animations:
              - state: 'on'
                styles:
                  icon:
                    # animation: spin 3s linear infinite
                    fill: var(--primary-background-color)
              - state: 'off'
                styles:
                  icon:
                    fill: var(--theme-sys-color-secondary)
                    opacity: 0.9
            styles:
              icon:
                fill: var(--primary-background-color)
                opacity: 0.9
                # transition: fill 1s ease

      # ================================================================
      - toolset: alert-icon
        position:
          cx: 40
          cy: 18
        tools:
          # ------------------------------------------------------------
          - type: circle
            position:
              cx: 50
              cy: 50
              radius: 13
            entity_index: 0                 # Use state from 0
            animations:
              - state: 'on'                 # If ON
                styles:
                  circle:
                    fill: var(--primary-background-color)
              - state: 'off'                # If OFF
                styles:
                  circle:
                    display: none           # Hide icon

          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 50
              cy: 50
              align: center
              icon_size: 25
            entity_index: 0                 # Use state from 0
            icon: mdi:alert-circle          # Use alert circle icon
            animations:
              - state: 'on'                 # If ON
                styles:
                  icon:
                    fill: var(--brand-google-red, red) # Set icon to red color
              - state: 'off'                # If OFF
                styles:
                  icon:
                    display: none           # Hide icon
            styles:
              icon:
                fill: grey                  # Default grey color

      # ================================================================
      - toolset: column-name
        position:
          cx: 120
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: name
            position:
              cx: 50
              cy: 50
            entity_index: 0
            styles:
              name:
                text-anchor: middle
                font-size: 25em
                font-weight: 700
                opacity: 1
          # ------------------------------------------------------------
          - type: state
            position:
              cx: 50
              cy: 80
            entity_index: 1
            show:
              uom: none
            styles:
              state:
                text-anchor: middle
                font-size: 14em
                font-weight: 500
                opacity: 0.7

      # ================================================================
      - toolset: line1
        position:
          cx: 200                           # On 1/3 of card width
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: line
            position:
              cx: 50
              cy: 50
              orientation: vertical
              length: 50
            styles:
              line:
                fill: var(--primary-text-color)
                opacity: 0.5

      # ================================================================
      - toolset: column-battery
        position:
          cx: 250
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 30
              cy: 30
              align: right
              icon_size: 25
            entity_index: 2
            styles:
              icon:
                fill: var(--theme-sys-color-tertiary)
                opacity: 0.8
          # ------------------------------------------------------------
          - type: state
            position:
              cx: 70
              cy: 30
            entity_index: 2
            show:
              uom: none
            styles:
              state:
                text-anchor: middle
                font-size: 15em
                font-weight: 700
                fill: var(--primary-text-color)
              uom:
                fill: var(--primary-text-color)
                font-weight: 700

          # ------------------------------------------------------------ 
          - type: 'segarc'
            id: 0
            position:
              cx: 70
              cy: 30
              start_angle: 0
              end_angle: 360
              width: 3
              radius: 18
            entity_index: 2
            scale:
              min: 0
              max: 100
              width: 6
              offset: 12
            show:
              scale: false
              style: 'colorlist'
            segments:
              colorlist:
                gap: 1
                colors:
                  - var(--theme-sys-palette-tertiary45)
            styles:
              foreground:
                fill: darkgrey
              background:
                fill: var(--theme-sys-elevation-surface-neutral4)
                opacity: 1

      # ================================================================
      - toolset: column-linkquality
        position:
          cx: 250
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 30
              cy: 70
              align: right
              icon_size: 25
            entity_index: 3
            styles:
              icon:
                fill: var(--theme-sys-color-tertiary)
                opacity: 0.8

          # ------------------------------------------------------------
          - type: state
            position:
              cx: 70
              cy: 70
            entity_index: 3
            show:
              uom: none
            styles:
              state:
                text-anchor: middle
                font-size: 15em
                font-weight: 700
                fill: var(--primary-text-color)
              uom:
                fill: var(--primary-text-color)
                font-weight: 700

          # ------------------------------------------------------------ 
          - type: 'segarc'
            id: 0
            position:
              cx: 70
              cy: 70
              start_angle: 0
              end_angle: 360
              width: 3
              radius: 18
            entity_index: 3
            scale:
              min: 0
              max: 100
              width: 6
              offset: 12
            show:
              scale: false
              style: 'colorlist'
            segments:
              colorlist:
                gap: 1
                colors:
                  - var(--theme-sys-palette-tertiary45)
            styles:
              foreground:
                fill: darkgrey
              background:
                fill: var(--theme-sys-elevation-surface-neutral4)
                opacity: 1