Lovelace: Versatile Swiss Army Knife Custom Card

I’m happy to help you debug these excellent cards. If i put the ‘off’ state in front of the other states, it doesn’t change anything. I still see the climate entity icon. I tried with the “reuse” parameter to yes, which is the default, and everything works fine for animation control. With the “reuse” parameter set to false, animation control no longer works.

Thanx for checking. I will debug the function that handles the animations. With your config as an example I should be able to replicate the problem.

Update
I was able to replicate the problem and fix it. This will be part of the next update, v2.4.4

OK, everything works fine with the update. :grinning:. THANKS

3 Likes

Hi. This looks so good but im struggling to install it.

Im on hassio.

  1. cant find the lovelace folder to copy the content to

  2. adding the resources to lovelace yaml, where? Adding it as raw config for a lovelace dashboard yields a parsing error

  3. adding an example yields a r.setconfig error. Probably related to the above problems?

Thx

I’m no expert, but here’s what I did.

You need to create the lovelace directory under the /config/ directory and copy the content swiss-army-knife-card/ha-config/lovelace at master · AmoebeLabs/swiss-army-knife-card · GitHub into this directory.

For resources, it depends on the type of dashboard you have. If you are in yaml mode you must include the resource file in configuration.yaml. If you use storage mode, I include the templates at the beginning of the dashboard configuration file. The resource file is not used in this mode. Restart HA after install

/config/lovelace

yaml mode

Storage mode

Ok ill try! But what storage mode and yaml mode? Ive heard other terms but storage isnt one.

Like I said, I’m not an expert. As far as I know, here is the difference between yaml and storage mode.

yaml mode: everything is manual. when you add a card from HACS, you must add it manually in the resource file for the new card to be recognized.

In storage mode, resources are managed by HA and added automatically when adding a new card.

1 Like

thanks again! youre an expert in my eyes.

problem is that installing it through HACS doesnt seem to download all the files. there is only a www/community one with these files. thats it. ill have to manually download it, or perhaps its included in another way

Installing via hacs installs the base files, you need to complete step 2 on this page to get the templates needed for SAK to work.

Got the files in place but still getting the errors. I fold, and hope that the future will bring a more streamlined install because this really looks awesome.

Thx for your efforts to help, Sorry i failed.

As @AmoebeLabs says ‘Progress in small steps’ :grinning:

1 Like

Yee, sometimes just silly walk steps :grinning_face_with_smiling_eyes:

3 Likes

I’m trying to add DATE sensor o my swiss card. I have a template sensor like this:

    bugunun_tarihi:
      friendly_name: "Bugünün Tarihi"
      value_template: "{{ as_timestamp(states('sensor.date')) | timestamp_custom('%-d %B %Y') }}"

template sensor output is:

1 June 2023

But when I try to add this sensor to my card as “type: state” , card is crashing. If I change to “type:name” It’s displayed name.

How can I put current date in the card?

thank you.

I don’t know what “sensor.date” contains, but with the following definition it works fine.

- platform: template
  sensors:
    bugunun_tarihi:
      friendly_name: "Bugünün Tarihi"
      value_template: "{{ as_timestamp(now()) | timestamp_custom('%-d %B %Y') }}"`


 - type: "custom:swiss-army-knife-card"
   entities:
      - entity: sensor.bugunun_tarihi
        name: "Date : "
        icon: mdi:calendar-month

   layout:
  
     aspectratio: 6/1
     toolsets:
   

      # ================================================================
      - toolset: column-icon
        position:
          cx: 25
          cy: 50
        tools:
          - type: icon
            position:
              cx: 50
              cy: 50
              align: center
              icon_size: 35
            entity_index: 0

      # ================================================================
      - toolset: column-name
        position:
          cx: 70
          cy: 50
        tools:
          - type: name
            position:
              cx: 50
              cy: 50
            entity_index: 0
            styles:
              name:
                text-anchor: middle
                font-size: 15em
                font-weight: 700
                opacity: 1
                
     # ================================================================
      - toolset: column-state
        position:
          cx: 150
          cy: 50
        tools:
          - type: state
            position:
              cx: 50
              cy: 50
            entity_index: 0
            show:
              uom: none
            styles:
              state:
                text-anchor: middle
                font-size: 15em
                font-weight: 700
                opacity: 1
1 Like

my fault. I forgot to change the “state:” in style. It was “name:” :smirk:

Great that it got solved.

Is the fact that you want to display that custom date the only reason to create a template sensor?

In that case, that won’t be necessary anymore in the upcoming version of SAK. That version has extended support for locales and includes formatting options per entity.

The settings from your profile page are used for language, number and time format.

image

In your view, you can set the format on the entity level.

  - type: 'custom:swiss-army-knife-card'
    entities:
      # - entity: sensor.next_sunrise
      - entity: sun.sun
        attribute: next_rising
        unit: 'uur'
        icon: mdi:weather-sunset-up
        format: time-24h

The list of (probably) supported formatters with examples:

image

image

2 Likes

Github weather map:

1 Like

template: weather_today_detail
readme_1

  • template: main-box-sensor

  • template: main-circle-sensor

  • template: main-box-termometr

  • template: main-circle-termometr

  • template: main-circle-percent

  • template: main-circle-percent-battery

  • template: main-min-temperature-room

  • template: main-min-humidity
    readme_5

3 Likes

With one of your card, I created a new card that displays temperature, humidity, wind speed and the number of millimeters of rain.

4 Likes