Homeassistent stops working when putty is closed

I did an installation of home assistant with etcher. Afterwards i followed the setup of BRUH Automation on youtube. Everything works fine except for the start, restart and stop command. The biggest problem is that putty needs to remain running otherwise home assistant doesn’t work. I’ve taken a look here (https://home-assistant.io/docs/autostart/systemd/) to solve it but it’s to complicated for me to do. What could be my problem and how can I solve it.

Thanks in advance for the help.

Did you enable HA to start on boot using systemctl enable. Also, sudo systemctl restart [email protected] (you may have to change the user) should restart HA and bring back the shell. You can then close Putty safely.

1 Like

Thank you for the fast reply.
I’ve done the command sudo systemctl enable. Now i’m prompted to enter a password. Neither the password of my pi or the password of home assistant is correct. Is there another home assitant password I should enter?

You are probably running it from inside the venv. You need to run the command from outside the venv

I looked up on how to do it but I do not get how to run a command outside venv. Could you explain a bit more on how to do that? I am very new to this.

Open putty

Ssh in to the pi

Log in as user pi

Run the command

1 Like

Thank you for the reply.

I did this but i get a message: Too few arguments
Is there something i did wrong?

This is a screenshot:

The command should be…

sudo systemctl enable [email protected]

(presuming your HA user is called ‘homeassistant’ - which is should be if you used the all-in-one installer recently - and that you followed the guide you linked to in your first post to set up the service)

1 Like

I’ve done it, but i got nothing like confirmation and the start command still doesn’t work even after closing putty and reopening it. There must be something I did wrong. Thanks for your help anyway!

This is what I get after running the command:

After this try:

sudo reboot

1 Like

That means it worked. Reboot the pi and homeassistant will start in the background.

1 Like

Thank you for the help!