To get CPU Temp from Synology, possible?

Is there any way to display CPU temp of Synology? The platform synologydsm does not have such value. I run Hassio on a minipc, just for information.

Hello
this line:

 cat / sys / class / thermal / thermal_zone * / type

do you type it?

It doesn’t have thermal folder.

OK. I found it. So the command should be:
cat /sys/class/hwmon/hwmon0/device/temp2_input
The question now is how can I create the sensor?
Please note that I do not run Hassio on my Synology; I run it on a minipc (ubuntu).

Thanks. I’m aware of the template; but I don’t know how to define my Synology server IP and credentials from there.

You would need to allow your hass machine access to your synology server - by setting up SSH between the 2 (for example) and then running the command form a command line sensor in hass

Another option would be to run something on the synology server that will publish to hass (or MQTT) - like a bash script or a python program.

I don’t have the answer in full - just some pointers

Thanks. Good ideas.

Update: I managed to do it by writing a script file to:
0. (do this only once outside script) create ssh private/public keys; and register the public key to my Hassio server. This is to ensure that the rsync in the script do not need interactive password input for connecting to Hassio server

  1. copy temp2_input file to Synology home folder (and give filetype as .txt)
  2. rsync the text files (containing cpu temp) to www folder in Hassio
    Then write a config to read cpu temp from the file.

also - just saw this: https://www.home-assistant.io/components/synologydsm/

Seems to have disk temps at least … fair proxy for system temp given the compact layout of most of these NAS’

You are right. Synology temp report seems to report HDD-a temperature rather than the actual CPU temp.

CPU Temp from Synology
image

System Temp as reported on Synology Info page:
image

HDD a and b temp as report from synologydsm platform

It is working now by copying the temp2_input file to my Synology home, then rsync the file to my Hassio server. (Can’t rsync direct from the source because of its limitation). These commands are in a script file running under scheduled task function in Synology.

cp /sys/class/hwmon/hwmon0/device/temp2_input /volume1/Others/HomeAssistant/scripts/syno_cpu_temp2.txt
cp /sys/class/hwmon/hwmon0/device/temp3_input /volume1/Others/HomeAssistant/scripts/syno_cpu_temp3.txt
rsync -e ssh /volume1/Others/HomeAssistant/scripts/syno_cpu_temp*.txt [email protected]:/usr/share/hassio/homeassistant/syno/

As my Synology has D525 dual-core cpu, which temperatures are in temp2_input and temp3_input psuedo files. The temp2_input always has higher temp value; so I chose it for sensor.
I then created a sensor with this config:

# cpu temperature
  - platform: command_line
    name: Syno CPU Temp
    command: "cat /config/syno/syno_cpu_temp2.txt"
    unit_of_measurement : '°C'
    value_template: '{{ value | multiply(0.001) | round(0) }}'
1 Like

How can you do this? I dont have rsync installed on Hassio

bash: rsync: command not found
rsync error: remote command not found (code 127) at io.c(687) [sender=3.0.9]

rsync command is usually installed with Ubuntu. If not, try
sudo apt install rsync

But i need to install rsyn on hassio ssh server. Apt or Yum command doesnt exist