Skip to content

Binary Card with Alert #4

Swiss Army Knife Functional Card Binary Sensor With Alert4 D06 Light Off Swiss Army Knife Functional Card Binary Sensor With Alert4 D06 Light On
Swiss Army Knife Functional Card Binary Sensor With Alert4 D06 Dark Off Swiss Army Knife Functional Card Binary Sensor With Alert4 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
Icon Alert Icon. Animated, state dependent. Only visible if state is on
Name Name of Entity
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
- type: 'custom:swiss-army-knife-card'
  entities:
    - entity: binary_sensor.livingroom_movement_occupancy
      name: 'Bin Alert #4'
    - 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_alert4
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
sak_layout_fce_binary_alert4:
  template:
    type: layout
    defaults: 
      - sak_layout_binary_alert_battery_entity_disabled: false
  layout:
    aspectratio: 3/1
    toolsets:
      # ================================================================
      - toolset: badge-background
        position:
          cx: 150
          cy: 50
        tools:
          - type: badge
            position:
              cx: 50
              cy: 50
              height: 100
              width: 300
              ratio: 25
              radius: 5
              divider: 20
            entity_index: 0
            animations:
              - state: 'on'
                styles:
                  left:
                    fill: var(--theme-sys-color-primary)
              - state: 'off'
                styles:
                  left:
                    fill: var(--theme-sys-elevation-surface-neutral4)
            styles:
              left:
                fill: grey
              right:
                fill: none
      # ================================================================
      - 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'
                styles:
                  icon:
                    fill: var(--primary-background-color)
              - state: 'off'
                styles:
                  icon:
                    fill: var(--theme-sys-color-secondary)
            styles:
              icon:
                fill: var(--primary-background-color)
                opacity: 0.9

      # ================================================================
      - toolset: alert-icon
        position:
          cx: 75
          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: 100
          cy: 50
        tools:
          # ------------------------------------------------------------
          - type: name
            position:
              cx: 50
              cy: 50
            entity_index: 0
            styles:
              name:
                text-anchor: start
                font-size: 30em
                font-weight: 700
                opacity: 1

      # ================================================================
      - toolset: battery-icon
        disabled: '[[sak_layout_binary_alert_battery_entity_disabled]]'
        position:
          cx: 270
          cy: 15
          scale_y: 1.5                      # Make battery taller
          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