Skip to content

Binary Card with Alert #2

Swiss Army Knife Functional Card Binary Sensor With Alert2 D06 Light Off Swiss Army Knife Functional Card Binary Sensor With Alert2 D06 Light On
Swiss Army Knife Functional Card Binary Sensor With Alert2 D06 Dark Off Swiss Army Knife Functional Card Binary Sensor With Alert2 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.
4/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
Icon Stretched 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
13
- type: 'custom:swiss-army-knife-card'
  entities:
    - entity: binary_sensor.livingroom_movement_occupancy
      name: 'Bin Alert #2'
      # name: 'Livingroom #2'
    - 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_alert2
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
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
sak_layout_fce_binary_alert2:
  template:
    type: layout
    defaults: 
      - sak_layout_binary_alert_battery_entity_disabled: false
  layout:
    aspectratio: 4/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-secondary-container)
              - state: 'off'
                styles:
                  circle:
                    fill: var(--theme-sys-elevation-surface-neutral2)
            styles:
              circle:
                stroke: none
      # ================================================================
      - toolset: column-icon
        position:
          cx: 25
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 50
              cy: 50
              align: center
              icon_size: 45
            entity_index: 0
            animations:
              - state: 'on'
                styles:
                  icon:
                    fill: var(--theme-sys-color-secondary)
              - state: 'off'
                styles:
                  icon:
                    fill: var(--theme-sys-elevation-surface-neutral10)
            styles:
              icon:
                opacity: 0.9

      # ================================================================
      - toolset: alert-icon
        position:
          cx: 40
          cy: 18
        tools:
          # ------------------------------------------------------------
          - type: circle
            position:
              cx: 50
              cy: 50
              radius: 15
            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: 28
            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: 70                # Left part = 75, so 75+(300-75)/2
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: name
            position:
              cx: 50
              cy: 37
            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: 26em
                font-weight: 500
                opacity: 0.7

      # ================================================================
      - toolset: battery-icon
        disabled: '[[sak_layout_binary_alert_battery_entity_disabled]]'
        position:
          cx: 370
          cy: 15
          scale_y: 1.5                      # Make battery taller
          rotate: 90
        tools:
          # ------------------------------------------------------------
          - type: icon
            position:
              cx: 50
              cy: 50
              align: end
              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