I’m trying get Wake on LAN working for the shutdown part at the bottom of here:
I’ve searched the forums and tried a lot of things but I can’t seem to solve this. I am pretty new to linux, so I’m hoping it’s an easy fix.
I have setup a user in proxmox that only has authority to sys.PowerManagement and sys.Audit for a user hass (PAM not pve user). Followed the instructions, and checked it over so many times I’m ready for help. I did change to shutdown, I don’t want to suspend. The killer, I can copy and paste this command in the hass terminal and it works, no password needed. It will start the shutdown process of the vm’s and containers and then shut the machine off. Perfect.
This is the command and I have tried single, double and no quotes around the actual command with no luck.
You have to use -i to ssh to specify the key to use.
By default, ssh looks for it in ~/.ssh, which won’t work for the HA docker image. You’ll have to create and use a keypair in /config
HA always run in a docker container unless you use the “Core” installation method (plain python venv).
In your VM, it’s further encapsulated into HAOS.
I have modified my setup to point to the file directly as you suggested, thank you again. It’s in config/sshkeys/server1 (server1 is what I named the key file). I’m curious if double quotes vs single vs no quotes makes any difference. I’ve been assuming that it is double (") because of the WoL article listed above.
Using the YAML “>” is useful because it simplifies quoting: You don’t have to on next line.
The single quote delimitates the command executed in the SSH shell.
Logger: homeassistant.components.shell_command
Source: /usr/src/homeassistant/homeassistant/components/shell_command/init.py:117
Integration: Shell Command (documentation, issues)
First occurred: 11:18:28 AM (1 occurrences)
Last logged: 11:18:28 AM
Do you see anything that would cause that error? I am still able to copy the entire “ssh -i…” command and paste it into the home assistant terminal and it shuts down the proxmox server, no password promted. This seems like it should be so close to working, but the error in home assistant is not very helpful…
That did it! Wow, what a small change but adding the single quotes seems to have been the difference. I did remove the tilde too. Thank you so much for the help!