Skip to content

Card structure

The Swiss Army Knife YAML structure

The main aspects of a SAK Card are shown below using yellow lines.

 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
  # Define the type of the card to use.
  #
  # This is normally part of a "cards" section from a horizontal or vertical Lovelace stack
  # -----
- type: 'custom:swiss-army-knife-card'
  # Define the entities
  entities:
    - <list of entities>

  #
  # Define aspect ratio and size of card.
  # - In this case the card is square and has a size of 100x100
  # - A 2/1 ratio would have a size of 200x100
  # - etc.
  #
  # Odd values like 1/0.05 are also possible. Size is 100x5
  # This is used for instance to just draw a line/separator
  #
  # Specification:
  # - aspectratio (string)
  # -----
  aspectratio: 1/1

  #
  # Display the card or not.
  # - default false. Card is displayed.
  # - use true to just draw header text or a separator.
  # -----
  disable_card: false

  #
  # ***** card/layout section *****
  #
  # Specification:
  # - layout (map)
  # -----
  layout:

    # ***** card/layout/styles section *****
    #
    # Overall styles for the card and toolsets. Mainly used for defining filters!
    #
    # Specification:
    # - styles (map)
    # -----
    styles:
      card:
      toolsets:
        # Define Neumorphic filter over the full toolset.
        filter: url(#sak-nm-default)

        # Define material shadow filter over the full toolset
        # filter: url(#ds-1)

    #
    # ***** card/layout/toolsets section *****
    #
    # Define the list of toolsets from here
    #
    # Specification:
    # - toolsets (list of toolset configs)
    # -----
    toolsets:
      # define list of toolsets with its tools
      - toolset: background
        #
        # define list of tools within toolset
        #
        # Specification:
        # - tools (list of tool configs)
        #
        tools:
          #
          # define the tools
          #
          - type: 'usersvg'
          <...etc...>
Back to top