Home assistant addon : Scrutiny (SMART dashboard)

Thanks but this doesn’t work still. I think you’re referencing the wrong part of the api? It’s not under smart_results it’s in the first part of device.device_status

{
  "data": {
    "device": {
      "CreatedAt": "2024-07-11T21:54:54.025602638+01:00",
      "UpdatedAt": "2024-07-13T09:05:59.067375742+01:00",
      "DeletedAt": null,
      "wwn": "0x5000c5000daedee6",
      "device_name": "sdf",
      "device_uuid": "",
      "device_serial_id": "ata-ST31000340AS_9QJ1X0NR",
      "device_label": "",
      "manufacturer": "",
      "model_name": "ST31000340AS",
      "interface_type": "",
      "interface_speed": "",
      "serial_number": "9QJ1X0NR",
      "firmware": "SD15",
      "rotational_speed": 7200,
      "capacity": 1000204886016,
      "form_factor": "",
      "smart_support": false,
      "device_protocol": "ATA",
      "device_type": "sat",
      "label": "",
      "host_id": "home_assistant",
      "device_status": 2
    },
    "smart_results": [
      {
        "date": "2024-07-13T08:05:58Z",
        "device_wwn": "0x5000c5000daedee6",
        "device_protocol": "ATA",
        "temp": 39,
        "power_on_hours": 54962,
        "power_cycle_count": 2025,
        "attrs": {
...
        },
        "Status": 0

Hehe you are right it should like be {{ "on" if value_json.data.device[0].device_status in [1, 2] else "off" }} I’m not at my computer so did not test it

Thanks for your persistence, but it’s still not working.
This is the full rest sensor config, I changed the " for ’ in your example:

rest:
  - verify_ssl: false
    scan_interval: 60
    resource: http://db21ed7f-scrutiny-fa:8086/api/device/0x5000c5000daedee6/details
    binary_sensor:
      - name: "HDD - NAS4 SMART Status"
        value_template: "{{ 'on' if value_json.data.device[0].device_status in [1, 2] else 'off' }}"
        device_class: problem
        unique_id: HDD NAS4 SMART Status

I get the following in the log:

  • Template variable error: ‘value_json’ is undefined when rendering ‘{{ ‘on’ if value_json.data.device[0].device_status in [1, 2] else ‘off’ }}’

Just curious, I have an nvme drive(Samsung 970 evo) that scrutiny says has failed test. It has 520 media errors.
I replaced this drive with a brand new drive (Samsung 980 pro) and scrutiny says it has still failed with 520 media errors… (even though the drive name had changed in the report)
Any ideas what’s going on / how to refresh the report?

Hello
Should this add-on work without additional configuration?
I’m getting pretty empty UI view

Found in scrutiny logs:

time="2024-08-17T15:31:16+02:00" level=info msg="Executing command: smartctl --scan --json" type=metrics
time="2024-08-17T15:31:16+02:00" level=info msg="Executing command: smartctl --info --json --device sat /dev/sda" type=metrics
time="2024-08-17T15:31:16+02:00" level=error msg="Could not retrieve device information for sda: exit status 2" type=metrics

After entering the docker:

 smartctl --info --json --device sat /dev/sda
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "aarch64-linux-5.10.17-v8",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--info",
      "--json",
      "--device",
      "sat",
      "/dev/sda"
    ],
    "messages": [
      {
        "string": "Smartctl open device: /dev/sda [SAT] failed: Operation not permitted",
        "severity": "error"
      }
    ],
    "exit_status": 2
  },
  "local_time": {
    "time_t": 1723902705,
    "asctime": "Sat Aug 17 15:51:45 2024 CEST"
  }
}

Any idea why operation is not permitted? I tried both: normal and full-access versions of the add-on.

There is something weird going on with the ports in the addon. Ingress wasn’t defined. But if I do, it doesn’t save? I changed to the host IP and the template worked when I changed it to:

rest:
  - verify_ssl: false
    scan_interval: 60
    resource: http://my.local.host.ip:8086/api/device/aa235110163/details
    binary_sensor:
      - name: "SSD - System SMART Status"
        value_template: "{{ 'on' if value_json.data.device.device_status in [1, 2] else 'off' }}"
        device_class: problem
        unique_id: SSD System SMART Status
  - verify_ssl: false

Hi, if you use ingress and disable the external port the API is likely exposed through the ingress url based on the homeassistant port. Anyway most important thing is that it works :slight_smile:

Hi, not all ssd support smart as I as surpsied to learn ; does yours? The add-on should have in theory max permissions, and I guess you tried also the full access version

I’m using Kingston SSDNow V300. It seems it does support S.M.A.R.T.
CrystalDiskInfo confirms that
And yes, I’ve tried both version of Scrutiny.

I’m still on old HA OS (7.6). Could that be the reason?