platinum_card:
  default:
    - title:
    - icon:
  card:
    type: entities
    style: |
      #states > div:last-child {
        margin: 0 -16px -16px -16px;
      }
    title: "[[title]]"
    icon: "[[icon]]"
    entities:
      - type: custom:dummy-entity-row
        entity: sensor.synology_cpu_load_total
        name: Open admin UI
        icon: mdi:firefox
        tap_action:
          action: url
          url_path: http://platinum.lan:5000
      - type: custom:fold-entity-row
        head:
          type: custom:decluttering-card
          template: percentage_card
          variables:
            - name: CPU
            - entity: sensor.synology_cpu_load_total
            - icon: mdi:chip
            - orange: 40
            - red: 60
        entities:
          - entity: sensor.synology_cpu_load_system
            name: CPU load (System)
          - entity: sensor.synology_cpu_load_user
            name: CPU load (User)
          - entity: sensor.synology_cpu_load_other
            name: CPU load (Other)
          - entity: sensor.synology_cpu_load_1_min
            name: CPU load (1 min)
          - entity: sensor.synology_cpu_load_5_min
            name: CPU load (5 min)
          - entity: sensor.synology_cpu_load_15_min
            name: CPU load (15 min)

      - type: custom:fold-entity-row
        head:
          type: custom:decluttering-card
          template: percentage_card
          variables:
            - name: Memory
            - entity: sensor.synology_memory_usage_real
            - icon: mdi:memory
            - orange: 70
            - red: 85
        entities:
          - entity: sensor.synology_memory_cached
            name: Memory cached
          - entity: sensor.synology_memory_size
            name: Memory size
          - entity: sensor.synology_memory_available_real
            name: Memory available (Real)
          - entity: sensor.synology_memory_total_real
            name: Memory total (Real)
          - entity: sensor.synology_memory_available_swap
            name: Memory available (Swap)
          - entity: sensor.synology_memory_total_swap
            name: Memory total (Swap)

      - type: custom:fold-entity-row
        head:
          type: custom:decluttering-card
          template: percentage_card
          variables:
            - name: Volume 1
            - entity: sensor.synology_volume_used_volume_1
            - icon: mdi:harddisk
            - orange: 85
            - red: 90
        entities:
          - entity: sensor.synology_average_disk_temp_volume_1
            name: Average temperature
          - entity: sensor.synology_maximum_disk_temp_volume_1
            name: Maximum temperature
          - entity: sensor.synology_used_space_volume_1
            name: Used space
          - entity: sensor.synology_total_size_volume_1
            name: Total size

      - type: custom:fold-entity-row
        head:
          type: custom:decluttering-card
          template: percentage_card
          variables:
            - name: Volume 2
            - entity: sensor.synology_volume_used_volume_2
            - icon: mdi:harddisk
            - orange: 85
            - red: 90
        entities:
          - entity: sensor.synology_average_disk_temp_volume_2
            name: Average temperature
          - entity: sensor.synology_maximum_disk_temp_volume_2
            name: Maximum temperature
          - entity: sensor.synology_used_space_volume_2
            name: Used space
          - entity: sensor.synology_total_size_volume_2
            name: Total size

      - type: custom:fold-entity-row
        head:
          entity: sensor.synology_status_sda
          name: /sda
        entities:
          - entity: sensor.synology_temperature_sda
            name: Temperature
          - entity: sensor.synology_below_min_remaining_life_sda
            name: Below minimum remaining life
          - entity: sensor.synology_exceeded_max_bad_sectors_sda
            name: Exceeded max bad sectors
      - type: custom:fold-entity-row
        head:
          entity: sensor.synology_status_sdb
          name: /sdb
        entities:
          - entity: sensor.synology_temperature_sdb
            name: Temperature
          - entity: sensor.synology_below_min_remaining_life_sdb
            name: Below minimum remaining life
          - entity: sensor.synology_exceeded_max_bad_sectors_sdb
            name: Exceeded max bad sectors
      - type: custom:fold-entity-row
        head:
          entity: sensor.synology_status_sdc
          name: /sdc
        entities:
          - entity: sensor.synology_temperature_sdc
            name: Temperature
          - entity: sensor.synology_below_min_remaining_life_sdc
            name: Below minimum remaining life
          - entity: sensor.synology_exceeded_max_bad_sectors_sdc
            name: Exceeded max bad sectors
      - type: custom:fold-entity-row
        head:
          entity: sensor.synology_status_sdd
          name: /sdd
        entities:
          - entity: sensor.synology_temperature_sdd
            name: Temperature
          - entity: sensor.synology_below_min_remaining_life_sdd
            name: Below minimum remaining life
          - entity: sensor.synology_exceeded_max_bad_sectors_sdd
            name: Exceeded max bad sectors

      - type: custom:hui-horizontal-stack-card
        cards:
          - type: entities
            entities:
              - entity: sensor.synology_network_down
                name: Down
                style: |
                  :host {
                    --paper-item-icon-color: green;
                  }
            style: &network-indicator-style
              .: |
                ha-card {
                  box-shadow: none;
                  background: none;
                  margin-top: -1.4em;
                  max-height: 1px;
                  z-index: 2;
                }

              "#states div":
                hui-sensor-entity-row:
                  $:
                    hui-generic-entity-row:
                      $: |
                        .info {
                          margin-left: 0 !important;
                          flex-grow: 0 !important;
                          text-overflow: unset !important;
                          white-space: unset !important;
                        }
          - type: entities
            entities:
              - entity: sensor.synology_network_up
                name: Up
                style: |
                  :host {
                    --paper-item-icon-color: var(--accent-color);
                  }
            style: *network-indicator-style

      - type: custom:mini-graph-card
        align_state: left
        entities:
          - color: var(--accent-color)
            entity: sensor.synology_network_up
          - color: green
            entity: sensor.synology_network_down
        group: false
        points_per_hour: 1
        line_width: 3
        hour24: true
        hours_to_show: 24
        show:
          fill: fade
          icon: false
          name: false
          state: false
          name_adaptive_color: true
          labels: hover
          legend: false
        tap_action:
          action: none
