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.

HA to turn on/off Unraid

Featured Replies

Hi guys,

 

I am looking for a simple way to turn on and off via home assistant. Maybe some other interesting features related to HA if possible.

 

I don't really need to run my server 24/7.

 

Thanks for any advice

From my understanding, I am not sure you can do it directly since by definition VM and Docker container should not have direct access to the main server.

But you could make it work with a few Unraid and HA scripts I guess.

 

  1. HA creating a file in share it has access to to order the shutdown with a 'touch' command.
  2. Unraid script running at fixed interval that is basically if file exist, then delete the file and 'poweroff'.

 

But I can be very wrong as I do not run HA and don't do much more than basic NAS and dockers in my system. Maybe there is a very simple way to do that. :D

My cheap asrock on-board cpu itx motherboard had this option in the bios.

Check your server's bios settings for things like 'BIOS power-on', 'APM settings', 'RTC alarm', 'wake-up alarm', etc...

  • Author

What does bios have to do with home assistant integration? 

You don't specifically say if HA is running on the server itself.

 

BIOS settings would be related to how you can get it to power up again.

  • Author

Yes Yes Yes... But it is more convenient to control my server with voice commands than via webUI and scheduled power ons/offs are not what I am looking for

Edited by pkoci1

14 minutes ago, trurl said:

You don't specifically say if HA is running on the server itself.

 

25 minutes ago, pkoci1 said:

Well I should have mentioned that (running on rpi and docker)

 

I found this https://community.home-assistant.io/t/turn-on-off-unraid-server-from-hassio-voice-assistant/120767 and wake on lan works but turning off my server ends up with this message "Command failed: ssh -i /config/unraid/.sshid_rsa -o StrictHostKeyChecking=no [email protected] 'powerdown'"

Have you tried changing command to poweroff? or you might need the full path /usr/local/sbin/powerdown

Edited by SimonF

I have a few smartplugs throughout my house. I just say, "computer lights off kitchen". You can easily plug your array into a smartplug, assign a nice short word for it and then your phone will always be able to power off/on your array through the Alexa or Google app. Could be, "computer power off unraid". And then when your BIOS detects power again, "computer power on unraid" it will power your rig up.

  • Author

Really? Do you think it is a good idea to just cut a running server off the power?

5 hours ago, pkoci1 said:

Do you think it is a good idea to just cut a running server off the power?

NO!

6 hours ago, pkoci1 said:

Really? Do you think it is a good idea to just cut a running server off the power?

The best outcome from doing that would be a non-correcting parity check due to unclean shutdown. Other worse outcomes are possible.

8 hours ago, pkoci1 said:

Really? Do you think it is a good idea to just cut a running server off the power?

Definitely a bad idea.

 

it might be possible if you have a UPS between the smart switch and Unraid to switch off the power supply to the UPS, and make that trigger Unraid to shutdown tidily.   After you have given enough time to be sure Unraid has shutdown you then re-enable the power to the UPS to keep it charged.

Having the UPS beeping for several minutes might not be a great solution. :D

And deactivating the alarm is quite risky for my taste.

 

Plus that would add unnecessary unload/load cycles on the battery and you would not be sure to have a full battery when you actually need it.

  • Author

I am suprised that none of you has recommended to hire a person to manually turn the server on/off yet. Would safer than smart plug :)

 

So no home assistant guru here?

Edited by pkoci1

49 minutes ago, pkoci1 said:

I am suprised that none of you has recommended to hire a person to manually turn the server on/off yet. Would safer than smart plug :)

 

So no home assistant guru here?

dId you try my suggestions?

  • Author

Same error.

 

What about /usr/local/sbin/shutdown ? And not 'powerdown/poweroff'.

  • Author

You're my hero!

 

Would you be able to create a sensor that monitors whether hdds are spun up/down? I would like to collect some data. I do not need my HDDs run 24/7 but want to avoid too many spin ups/downs per day.

21 hours ago, pkoci1 said:

avoid too many spin ups/downs per day

You can set the default spindown delay for all disks in Disk Settings, and override that for any of your disks on each disks settings page.

  • Author

I know so how does that help me with creating a sensor for home assistant?

Your best option is to check home assistant forum and start from there.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

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.