HA to turn on/off Unraid


pkoci1

Recommended Posts

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

Link to comment
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
Link to comment

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.

Link to comment
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.

Link to comment

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.

Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.