Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Milvus

Members
  • Joined

  • Last visited

Solutions

  1. Milvus's post in Export the Disk-Temperatures via MQTT or anything else was marked as the answer   
    Edit 06/15/2024: editet the user-script cronjob: the original made the disks spin up. Now the  "hdparm" checks, if the disks are alive. If not, the temperature will not be taken, so the disks stay asleep.
     
    Alright, I got it, with the help of ChatGPT:
     
    What I did in brief words:
    Unraid System collects the disc-temperatures and writes them into a .txt file. Home Assistant Docker has access to the .txt file Mosquitto Docker installed Setup HomeAssistant MQTT Created an automatism in HA, which takes the Info from the file and sends it via MQTT to my SmartHome Smart Home evaluates, if Discs get too hot, and turns on a Fan, if temp of one disc is too high For anyone who faces the same issue, here a small manual until sending the data via MQTT. The processing to turn on a Fan is very individual I assume, that is why I leave it out here  
     
    create a folder "disktemps" (or any other name you like) in folder /mnt/user/appdata/ Install the app "User Scripts" Configure a CronJob in User scripts, with the following script: #!/bin/bash output_file="/mnt/user/appdata/disktemps/disk_temps.txt" mkdir -p $(dirname "$output_file") > "$output_file" # Datei leeren # Liste der existierenden Geräte filtern for dev in /dev/sd?; do if [ -b "$dev" ]; then # Prüfe, ob die Festplatte im Standby-Zustand ist status=$(hdparm -C "$dev" | grep -i 'standby') if [ -z "$status" ]; then temp=$(smartctl -a "$dev" | grep -i 'Temperature_Celsius' | awk '{print $10}') if [ -n "$temp" ]; then echo "$dev: ${temp}°C" >> "$output_file" fi fi fi done  
               This creates a .txt file with the disk-temps in it
     
    Install HomeAssistant Docker Add an additional Path "Add another Path, Port, Variable, Lable or Device" The host path from the Unraid system, which we have created and in which the temperatures are written by the “User Scripts” app, is therefore routed to the container path. In other words, the files in the disktemps folder become available in the container (normally containers do not have access to data outside the container).  
    Set Up HomeAssistant Now we have to edit the “configuration.yaml” of the HomeAssistant Docker. Here we have to tell HA that we want to have a new data point in Home-Assistant in which we want to have the temperature data. Important: We do this via the Unraid console, not from the Docker! The Docker does not support Sudo or Nano. Open the console in Unraid Navigate to the installation folder of the HA container: cd /mnt/user/appdata/Home-Assistant-Container  
    Open the configuration.yaml nano configuration.yaml  
    Copy the following command one line below the existing content: command_line: - sensor: name: Disk Temperatures command: "cat /config/disktemps/disk_temps.txt" scan_interval: 120      The scan_interval: 120 means that a new temperature is checked every 2 minutes. Set it according to your wishes
     
    restart Home Assistant in WebUI via “Settings->System->Restart” (top right corner) In HA WebUI, go to Developer tools and then States. The entity “sensor.disk_temperature” should now be found here.  
    Install mosquitto Docker. I used the following manual for that: https://unraid-guides.com/2021/02/25/how-to-install-an-mqtt-broker-mosquitto-on-unraid/  
    install MQTT in HomeAssistant Settings -> Devices and services -> Add integration -> MQTT 
    Now enter the IP and credentials of the external system (like IoBroker or else) in the settings! So name and password.  
    set up new automation in HomeAssistant Settings -> Automations & scenes -> Create automation -> Create new automation
    Enter the following (sorry for being in German, you surely can translate easily via a translator ) :
     

     
    Safe, close, try. Now, the data should be send to the other system via MQTT.
     
    Thanks for your replies earlier, they set me on the correct path!

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.