Autostarting home assistant on rPi - launch on reboot pauses at login page

Hi there! Long time lurker here. I looked up using home assistant and decided to just go for it.

I installed ubuntu as a dual boot and tried it out - worked quite well so I thought I’d go the full hog and install on my raspberry pi (henceforth known as rpi).

I’ve got HA working on my rPi via a virtual env and it manually boots up fine, but autostart on reboot seems to be a little trickier.

I’ve tried following the instructions on systemd and upstart, but neither are really working. Since I’ve come so far with this install I’d really rather avoid wiping my pi and installing hassbian with AIO…

I’m currently manually launching homeassistant as follows:
$ sudo su -s /bin/bash homeassistant
$ source /srv/homeassistant/bin/activate
$ hass

I just tried the instructions and created this file:
/etc/systemd/system/[email protected]

With this content:

[Unit]
Description=Home Assistant
After=network.target

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c “/home/homeassistant/.homeassistant”

[Install]
WantedBy=multi-user.target

When I reboot my pi, I can see it reboots but pauses at the login stage. Is there a way to get around this?

Figured it out. I needed to run the commands on here:

as the sudo user, but substituting [youruser] for the home assistant virtual environment username; in my case it was “homeassistant”.

I hope I helped someone else out there!