Synology System Health widget in a dashboard

Hi, I hope this is the right place.

I wondered if anyone had tried to emulate/copy the widgets you get on Synology (I have system health and storage always showing when I open my Synology, but know there are 5 or so others too). Having the official Synology look on my HA dashboard would be comforting/give positive association.

However, as far as I can tell, there doesn’t seem to be an entity that shows the ‘healthy’ status that you see when you open DS (from this documentation, it looks like it comes from a few bits of data: Overview | DSM - Synology Knowledge Center). I can see that my volume is ‘normal’ (which I believe is slightly different to the system being healthy), but nothing for overall system health in the way Synology reports it (with the reassurance that my ‘Synology NAS is working well’).

I’m running HA in VM on a Synology DS220+.

What sensors does the integration give you? I have a QNAP which exposes a lot of sensors, I would assume the Synology gives you something similar. Build a dashboard or a card with those and you should be good.

There is no such entity provided by the integration.
I guess you will have to define yourself what is “Healthy” based on all the sensor data you get from the Diskstation, the volumes and drives and put that into a template sensor.
You can also get additional data from your Diskstation beyond what is provided by the integration:

However this is based on events and not states.

P.s.: Got the exact same setup as you do :slight_smile:

Quite a lot can be pulled from DSm integration. Here is mine:


However there is no single sensor for overal Health status, it would need to be template sensor calculating overal state from individual components health.

Hi, thanks all. That is what I thought. I have made a dashboard based on one I saw on Reddit (here: https://www.reddit.com/r/synology/comments/1gwpq15/home_assistant_synology_integration_dashboard/?sort=new), which has various components coming from the DSM integration, but had hoped I might rely on Synology doing the calculation for me.

PS Mirek, would you be up for sharing your YAML for your integration? It looks really clean and I’m learning to get the hang of dashboards having started again with HA a week or so ago (I gave up with it all about a year ago and sold my HA Green and SkyConnect, but decided to take a second bite of the cherry and bought myself an SLZB06 which is connected directly into my Synology).

Here is the full code for Synology NAS dashboard:

type: custom:vertical-stack-in-card
cards:
  - type: custom:layout-card
    layout_type: grid
    layout_options:
      grid-template-columns: 0.166fr 0.166fr 0.166fr 0.166fr 0.166fr 0.166fr
      grid-template-rows: auto
      grid-template-areas: >
        "controls controls controls controls controls controls" "ctrl1 ctrl1
        ctrl1 ctrl2 ctrl2 ctrl2" "drives drives drives drives drives drives"
        "hdd1 hdd1 hdd2 hdd2 hdd3 hdd3" "sysstats sysstats sysstats sysstats
        sysstats sysstats" "status status status status status status" "volumes
        volumes volumes volumes volumes volumes" "vol1 vol1 vol1 vol1 vol1 vol1"
        "graphs graphs graphs graphs graphs graphs" "charts1 charts1 charts1
        charts2 charts2 charts2"
      mediaquery:
        "(max-width: 1200px)":
          grid-template-columns: 100%
          grid-template-rows: auto
          grid-template-areas: |
            "controls"
            "ctrl1"
            "ctrl2"
            "drives"
            "hdd1"
            "hdd2"
            "hdd3"
            "sysstats"
            "status"
            "volumes"
            "vol1"

            "graphs"
            "charts1"
            "charts2"
    cards:
      - type: custom:config-template-card
        view_layout:
          grid-area: ctrl1
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:vertical-stack-in-card
          horizontal: true
          cards:
            - size: 35px
              type: custom:button-card
              icon: mdi:shield-bug
              color: >-
                ${states['binary_sensor.synologynas_security_status'].attributes.malware
                === 'safe' ? 'var(--green1)' : 'var(--red2)'}
              name: Malware
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - size: 35px
              type: custom:button-card
              icon: mdi:shield-link-variant
              color: >-
                ${states['binary_sensor.synologynas_security_status'].attributes.network
                === 'safe' ? 'var(--green1)' : 'var(--red2)'}
              name: Network
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - size: 35px
              type: custom:button-card
              icon: mdi:shield-edit
              color: >-
                ${states['binary_sensor.synologynas_security_status'].attributes.securitySetting
                === 'safe' ? 'var(--green1)' : 'var(--red2)'}
              name: Security
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - size: 35px
              type: custom:button-card
              icon: mdi:shield-check
              color: >-
                ${states['binary_sensor.synologynas_security_status'].attributes.systemCheck
                === 'safe' ? 'var(--green1)' : 'var(--red2)'}
              name: System Check
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:config-template-card
        view_layout:
          grid-area: ctrl2
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:vertical-stack-in-card
          horizontal: true
          cards:
            - size: 35px
              type: custom:button-card
              icon: mdi:shield-sync
              color: >-
                ${states['binary_sensor.synologynas_security_status'].attributes.update
                === 'safe' ? 'var(--green1)' : 'var(--red2)'}
              name: Updates
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - size: 35px
              type: custom:button-card
              icon: mdi:shield-account
              color: >-
                ${states['binary_sensor.synologynas_security_status'].attributes.userInfo
                === 'safe' ? 'var(--green1)' : 'var(--red2)'}
              name: User Info
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - size: 35px
              type: custom:button-card
              icon: mdi:restart
              entity: button.synologyvm_reboot
              name: Reboot
              color: var(--orange1)
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - size: 35px
              type: custom:button-card
              icon: mdi:power
              entity: button.synologyvm_shutdown
              name: Power Off
              color: var(--red2)
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:config-template-card
        view_layout:
          grid-area: hdd1
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:vertical-stack-in-card
          horizontal: true
          cards:
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_1_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: SSD 1
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_1_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_1_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_2_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: SSD 1
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_2_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_2_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_3_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 3
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_3_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_3_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_4_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 4
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_4_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_4_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:config-template-card
        view_layout:
          grid-area: hdd2
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:vertical-stack-in-card
          horizontal: true
          cards:
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_5_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 5
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_5_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_5_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_6_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 6
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_6_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_6_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_7_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 7
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_7_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_7_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_8_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 8
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_8_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_8_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:config-template-card
        view_layout:
          grid-area: hdd3
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:vertical-stack-in-card
          horizontal: true
          cards:
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_9_status'].state === 'normal'
                ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 9
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_9_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_9_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_10_status'].state ===
                'normal' ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 10
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_10_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_10_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_11_status'].state ===
                'normal' ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 11
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_11_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_11_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: custom:button-card
              size: 35px
              icon: mdi:harddisk
              color: >-
                ${states['sensor.synologynas_drive_12_status'].state ===
                'normal' ? 'var(--green1)' : 'var(--red2)'}
              styles:
                grid:
                  - grid-template-areas: "\"i\" \"n\" \"temp\" \"stat\""
                  - grid-template-columns: 1fr
                  - grid-template-rows: min-content min-content min-content
              name: HDD 12
              custom_fields:
                temp: |-
                  [[[
                    return states['sensor.synologynas_drive_12_temperature'].state + '°C';
                  ]]]
                stat: |-
                  [[[
                    if (states['sensor.synologynas_drive_12_status'].state == 'normal')
                      return 'Normal';
                    else  
                      return 'Unsafe';
                  ]]]
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:config-template-card
        view_layout:
          grid-area: status
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:vertical-stack-in-card
          horizontal: true
          cards:
            - type: markdown
              content: |
                CPU Temp:
                # {{states('sensor.synologynas_temperature')}} °C
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: markdown
              content: |
                Uptime: {{states('sensor.synologynas_uptime')}}
                Last Boot: {{states('sensor.synologynas_last_boot')}}
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
            - type: markdown
              content: >
                Installed Version:
                {{state_attr('update.synologynas_dsm_update','installed_version')}}

                Latest Version:
                {{state_attr('update.synologynas_dsm_update','latest_version')}}
              card_mod:
                style: |
                  ha-card {
                    background: none;
                    box-shadow: none;
                  }  
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:vertical-stack-in-card
        view_layout:
          grid-area: vol1
        cards:
          - horizontal: true
            type: custom:vertical-stack-in-card
            cards:
              - type: markdown
                content: >
                  Volume 1  ({{
                  ((states('sensor.synologynas_volume_1_total_size') | float() -
                  states('sensor.synologynas_volume_1_used_space') | float()) *
                  1024) | round(2)}}GB free)
              - type: markdown
                content: >
                  Volume 2 ({{
                  ((states('sensor.synologynas_volume_2_total_size') | float() -
                  states('sensor.synologynas_volume_2_used_space') | float()) *
                  1024) | round(2)}}GB free)
          - horizontal: true
            type: custom:vertical-stack-in-card
            cards:
              - type: custom:custom-features-card
                features:
                  - type: custom:service-call
                    entries:
                      - type: slider
                        entity_id: sensor.synologynas_volume_1_volume_used
                        tap_action:
                          action: perform-action
                          target:
                            entity_id: sensor.synologynas_volume_1_volume_used
                          data: {}
                        range:
                          - 0
                          - 100
                        autofill_entity_id: true
                        unit_of_measurement: GB
                        ticks: false
                        thumb: flat
                        styles: |-
                          :host {
                            --color: var(--orange1);
                            height: 15px;
                          }
              - type: custom:custom-features-card
                features:
                  - type: custom:service-call
                    entries:
                      - type: slider
                        entity_id: sensor.synologynas_volume_1_volume_used
                        tap_action:
                          action: perform-action
                          target:
                            entity_id: sensor.synologynas_volume_1_volume_used
                          data: {}
                        range:
                          - 0
                          - 100
                        autofill_entity_id: true
                        unit_of_measurement: GB
                        ticks: false
                        thumb: flat
                        styles: |-
                          :host {
                            --color: var(--magenta1);
                            height: 15px;
                          }
      - type: custom:config-template-card
        view_layout:
          grid-area: charts1
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:history-explorer-card
          refresh:
            interval: 5
          defaultTimeRange: 4h
          showUnavailable: false
          uimode: dark
          uiColors:
            gridlines: "#444856"
            labels: "#A4A7B4"
            buttons: "#2C2E3C"
            selector: "#2C2E3C"
            closeButton: "#0000001f"
          labelAreaWidth: 50
          labelsVisible: false
          uiLayout:
            selector: hide
            toolbar: hide
          header: hide
          graphs:
            - type: line
              entities:
                - entity: sensor.synologynas_cpu_load_total
                  color: "#aaaaaa"
                  fill: "#aaaaaa22"
                  name: TOTAL
                - entity: sensor.synologynas_cpu_load_system
                  color: "#E61116"
                  fill: "#E6111622"
                  name: SYSTEM
                - entity: sensor.synologynas_cpu_load_user
                  color: "#003C9E"
                  fill: "#003C9E22"
                  name: USER
            - type: line
              entities:
                - entity: sensor.synologynas_network_down
                  color: "#F5A624"
                  fill: "#F5A62422"
                  name: DOWNLOAD
                  scale: 0.001
                - entity: sensor.synologynas_network_up
                  color: "#6A34E0"
                  fill: "#6A34E022"
                  name: UPLOAD
                  scale: -0.001
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:config-template-card
        view_layout:
          grid-area: charts2
        entities:
          - sensor.esxi_vm_hassio
        card:
          type: custom:apexcharts-card
          header:
            show: false
          chart_type: donut
          series:
            - entity: sensor.share_size_0
              color: var(--green1)
              name: Active Backup
            - entity: sensor.share_size_1
              color: var(--lemon1)
              name: Videos
            - entity: sensor.share_size_2
              color: var(--yellow1)
              name: Recorded TV
            - entity: sensor.share_size_3
              color: var(--orange1)
              name: XTime Machine
            - entity: sensor.share_size_4
              color: var(--red1)
              name: Pictures
            - entity: sensor.share_size_5
              color: var(--pink1)
              name: Krzysiek
            - entity: sensor.share_size_6
              color: var(--magenta1)
              name: Downloads
            - entity: sensor.share_size_7
              color: var(--darkblue1)
              name: Mirek
            - entity: sensor.share_size_8
              color: var(--lightblue1)
              name: Software
            - entity: sensor.share_size_9
              color: var(--cyan1)
              name: Public
            - entity: sensor.share_size_10
              color: var(--green3)
              name: Music
            - entity: sensor.share_size_11
              color: var(--lemon3)
              name: Documents
            - entity: sensor.share_size_12
              color: var(--yellow3)
              name: Dorota
            - entity: sensor.share_free_space
              color: var(--dark-text)
              name: Free Space
          apex_config:
            legend:
              position: bottom
            chart:
              height: 400
          card_mod:
            style: |
              ha-card {
                background: none;
                box-shadow: none;
              }  
      - type: custom:text-divider-row
        view_layout:
          grid-area: controls
        text: Synology NAS
      - type: custom:text-divider-row
        view_layout:
          grid-area: drives
        text: Hard Drives
      - type: custom:text-divider-row
        view_layout:
          grid-area: sysstats
        text: System Status
      - type: custom:text-divider-row
        view_layout:
          grid-area: volumes
        text: Volumes
      - type: custom:text-divider-row
        view_layout:
          grid-area: graphs
        text: System Usage

Please note that it also include some statistics about storage consumption, that are a bit tricky to obtain (I use python script run periodically on NAS, that creates JSON file based on which sensors used by apex chart are created). Also some code for dashboard is duplicated - I use media query to display various versions depending on screen size (desktop vs. mobile).
So full dashboard looks following:

Amazing, thank you!!