pkoci1 Posted March 30, 2022 Share Posted March 30, 2022 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 Quote Link to comment
ChatNoir Posted March 31, 2022 Share Posted March 31, 2022 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. HA creating a file in share it has access to to order the shutdown with a 'touch' command. 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. Quote Link to comment
Aran Posted April 6, 2022 Share Posted April 6, 2022 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... Quote Link to comment
pkoci1 Posted April 6, 2022 Author Share Posted April 6, 2022 What does bios have to do with home assistant integration? Quote Link to comment
trurl Posted April 6, 2022 Share Posted April 6, 2022 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. Quote Link to comment
pkoci1 Posted April 6, 2022 Author Share Posted April 6, 2022 (edited) 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 April 6, 2022 by pkoci1 Quote Link to comment
trurl Posted April 6, 2022 Share Posted April 6, 2022 14 minutes ago, trurl said: You don't specifically say if HA is running on the server itself. Quote Link to comment
pkoci1 Posted April 6, 2022 Author Share Posted April 6, 2022 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'" Quote Link to comment
SimonF Posted April 6, 2022 Share Posted April 6, 2022 (edited) 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 April 6, 2022 by SimonF Quote Link to comment
opentoe Posted April 7, 2022 Share Posted April 7, 2022 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. Quote Link to comment
pkoci1 Posted April 7, 2022 Author Share Posted April 7, 2022 Really? Do you think it is a good idea to just cut a running server off the power? Quote Link to comment
JonathanM Posted April 7, 2022 Share Posted April 7, 2022 5 hours ago, pkoci1 said: Do you think it is a good idea to just cut a running server off the power? NO! Quote Link to comment
trurl Posted April 7, 2022 Share Posted April 7, 2022 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. Quote Link to comment
itimpi Posted April 7, 2022 Share Posted April 7, 2022 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. Quote Link to comment
ChatNoir Posted April 7, 2022 Share Posted April 7, 2022 Having the UPS beeping for several minutes might not be a great solution. 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. Quote Link to comment
pkoci1 Posted April 7, 2022 Author Share Posted April 7, 2022 (edited) 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 April 7, 2022 by pkoci1 Quote Link to comment
SimonF Posted April 7, 2022 Share Posted April 7, 2022 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? Quote Link to comment
Aran Posted April 12, 2022 Share Posted April 12, 2022 What about /usr/local/sbin/shutdown ? And not 'powerdown/poweroff'. Quote Link to comment
pkoci1 Posted April 12, 2022 Author Share Posted April 12, 2022 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. Quote Link to comment
trurl Posted April 13, 2022 Share Posted April 13, 2022 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. Quote Link to comment
pkoci1 Posted April 13, 2022 Author Share Posted April 13, 2022 I know so how does that help me with creating a sensor for home assistant? Quote Link to comment
Aran Posted April 13, 2022 Share Posted April 13, 2022 Your best option is to check home assistant forum and start from there. Quote Link to comment
Recommended Posts
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.