Merge pull request #872 from nkm8/readme-edit

Update HA example code for scrutiny readmes
This commit is contained in:
Alexandre
2023-06-14 06:37:01 +02:00
committed by GitHub
2 changed files with 44 additions and 30 deletions

View File

@@ -72,7 +72,7 @@ Two types of api endpoints are available:
- Summary data : http://YOURIP:ADDONPORT/api/summary - Summary data : http://YOURIP:ADDONPORT/api/summary
- Detailed data : http://YOURIP:ADDONPORT/api/device/WWN/details - Detailed data : http://YOURIP:ADDONPORT/api/device/WWN/details
For the detailed data, wmn can be found for each hdd within the scrutiny app. For example for me : http://192.168.178.23:8086/api/device/0x50014ee606c14537/details For the detailed data, wmn can be found for each hdd within the scrutiny app. For example: http://192.168.178.23:8086/api/device/0x50014ee606c14537/details
Example to get data from the first hdd. Example to get data from the first hdd.
@@ -80,21 +80,28 @@ Example to get data from the first hdd.
rest: rest:
- verify_ssl: false - verify_ssl: false
scan_interval: 60 scan_interval: 60
resource: http://YOURIP:ADDONPORT/api/summary resource: http://192.168.178.23:8086/api/device/0x50014ee606c14537/details
sensor: sensor:
- name: "HDD disk 1" - name: "HDD1 - WWN"
json_attributes_path: "$.data[0].smart_results[0]" value_template: "{{ value_json.data.smart_results[0].device_wwn }}"
value_template: "OK" - name: "HDD1 - Last Update"
json_attributes: value_template: "{{ value_json.data.smart_results[0].date }}"
- "device_wwn" device_class: timestamp
- "date" - name: "HDD1 - Temperature"
- "smart_status" value_template: "{{ value_json.data.smart_results[0].temp }}"
- "temp" device_class: temperature
- "power_on_hours" unit_of_measurement: "°C"
- "power_cycle_count" state_class: measurement
- "ata_attributes" - name: "HDD1 - Power Cycles"
- "nvme_attributes" value_template: "{{ value_json.data.smart_results[0].power_cycle_count }}"
- "scsi_attributes" - name: "HDD1 - Power Hours"
value_template: "{{ value_json.data.smart_results[0].power_on_hours }}"
- name: "HDD1 - Protocol"
value_template: "{{ value_json.data.smart_results[0].device_protocol }}"
binary_sensor:
- name: "HDD1 - SMART Status"
value_template: "{{ bool(value_json.data.smart_results[0].Status) }}"
device_class: problem
``` ```
## Illustration ## Illustration

View File

@@ -71,7 +71,7 @@ Two types of api endpoints are available:
- Summary data : http://YOURIP:ADDONPORT/api/summary - Summary data : http://YOURIP:ADDONPORT/api/summary
- Detailed data : http://YOURIP:ADDONPORT/api/device/WWN/details - Detailed data : http://YOURIP:ADDONPORT/api/device/WWN/details
For the detailed data, wmn can be found for each hdd within the scrutiny app. For example for me : http://192.168.178.23:8086/api/device/0x50014ee606c14537/details For the detailed data, wmn can be found for each hdd within the scrutiny app. For example: http://192.168.178.23:8086/api/device/0x50014ee606c14537/details
Example to get data from the first hdd. Example to get data from the first hdd.
@@ -79,21 +79,28 @@ Example to get data from the first hdd.
rest: rest:
- verify_ssl: false - verify_ssl: false
scan_interval: 60 scan_interval: 60
resource: http://YOURIP:ADDONPORT/api/summary resource: http://192.168.178.23:8086/api/device/0x50014ee606c14537/details
sensor: sensor:
- name: "HDD disk 1" - name: "HDD1 - WWN"
json_attributes_path: "$.data[0].smart_results[0]" value_template: "{{ value_json.data.smart_results[0].device_wwn }}"
value_template: "OK" - name: "HDD1 - Last Update"
json_attributes: value_template: "{{ value_json.data.smart_results[0].date }}"
- "device_wwn" device_class: timestamp
- "date" - name: "HDD1 - Temperature"
- "smart_status" value_template: "{{ value_json.data.smart_results[0].temp }}"
- "temp" device_class: temperature
- "power_on_hours" unit_of_measurement: "°C"
- "power_cycle_count" state_class: measurement
- "ata_attributes" - name: "HDD1 - Power Cycles"
- "nvme_attributes" value_template: "{{ value_json.data.smart_results[0].power_cycle_count }}"
- "scsi_attributes" - name: "HDD1 - Power Hours"
value_template: "{{ value_json.data.smart_results[0].power_on_hours }}"
- name: "HDD1 - Protocol"
value_template: "{{ value_json.data.smart_results[0].device_protocol }}"
binary_sensor:
- name: "HDD1 - SMART Status"
value_template: "{{ bool(value_json.data.smart_results[0].Status) }}"
device_class: problem
``` ```
## Illustration ## Illustration