Need help setting HDD temperature sensors

Hi,

I’m trying to show my HDD temperature in HA frontend. I have had success with CPU dan motherboard temperature, however HDD temp is just not showing. This is the yaml from sensor.yaml :

  - platform: command_line
    name: CPU Temperature
    command: "cat /sys/class/thermal/thermal_zone2/temp"
    # If errors occur, remove degree symbol below
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(1) }}'
  - platform: command_line
    name: Motherboard Temperature
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    # If errors occur, remove degree symbol below
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(1) }}'  
  - platform: command_line
    name: HD Temperature
    command: "hddtemp -n /dev/sda"
    # If errors occur, remove degree symbol below
    unit_of_measurement: "°C"

I just copy-pasted from example in the docs. However HDD temp is not showing :
image

Here is the error from info page :
Command failed: hddtemp -n /dev/sda

I have tried :

  1. Removing the degree symbol (as per comment in the example)
  2. Using full path and even sudo
    sudo /usr/sbin/hddtemp -n /dev/sda

Still same erorr. Anyone please advise me how to get the HDD temp reading?

PS: I’ve installed hddtemp and can get the reading perfectly from command line

Why don’t you just use the hddtemp sensor for that?

@cgtobi

And that’s my friend, just how cool this community is… I never thought there’s a component for this, because I was looking for CPU temp at first. Thank you. Everything is good now… :slight_smile:

image

1 Like

Anyone using hddtemp with latest Home Assistant (I’m using 0.111.2 with HassOS 4.9) on Raspberry 4? I get following error in logs:

Logger: homeassistant.components.hddtemp.sensor
Source: components/hddtemp/sensor.py:98
Integration: hddtemp (documentation, issues)
First occurred: 12:26:13 (16 occurrences)
Last logged: 12:41:27

HDDTemp is not available at localhost:7634

Commands hddtemp or smartctl seem to be not available in latest OS images.

Thanks, Markus

Hello, I seem to have found the same issue, have you found a solution?

EDIT:
In the case another pool soul comes from Google with the same error: “HDDTemp is not available at localhost:7634”

Here’s what must be done on a Linux host:

First you need to edit the hddtemp config file:
vi /etc/default/hddtemp

If your user lacks write permission you may have to use root:
sudo vi /etc/default/hddtemp

Once the file is open, change:
RUN_DAEMON="false"

To:

RUN_DAEMON="true"

After saving and exit just do this command to reload the service:

service hddtemp restart/start

How to get this working on Debian supervised??

Try this:


It works to me on Debian Supervised.
2 Likes