Making HA run at boot RasPi3

I’m trying to make HA run at boot using systemd. I have been following home-assistant.io/getting-started/autostart/

I have a custom location for config in /home/pi/data/home-assist. It works fine if I start with

hass --config /home/pi/data/home-assistant

my /lib/systemd/system/[email protected] file reads

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

[Service]
Type=simple
User=%i
WorkingDirectory=%h
ExecStart=/usr/bin/hass --config %h/data/home-assistant/

[Install]
WantedBy=multi-user.target

I have then ran

sudo systemctl --system daemon-reload
sudo systemctl enable home-assistant@pi
sudo systemctl start home-assistant@pi

When I try and start I get error.

pi@emonpi:~ $ systemctl status [[email protected]](mailto:[email protected])
● [[email protected]](mailto:[email protected]) - Home Assistant
   Loaded: loaded ([/lib/systemd/system/[email protected]](mailto:/lib/systemd/system/[email protected]); enabled)
   Active: failed (Result: resources) since Tue 2016-03-29 00:09:56 UTC; 14min ago
 Main PID: 31655 (code=exited, status=203/EXEC)

Any ideas where I’m going wrong? Thanks a lot, loving HA so far :slight_smile:

I think the only problem you’re having is that the hass executable is in /usr/local/bin/hass. Change that after the ExecStart and you should be ok.

raw.githubusercontent.com/ballo … 40.service is an updated version.

Yup, well spotted: hass is indeed in /usr/bin/local Thank.

However I have updated my /lib/systemd/system/[email protected] file to read the following and I’m still having the same issue.

[code]# This is a simple service file for systems with systemd to tun HA as user.

[Unit]
Description=Home Assistant for %i
After=network.target

[Service]
Type=simple
User=%i
WorkingDirectory=%h/data
ExecStart=/usr/bin/local/hass --config %h/data/home-assistant/
SendSIGKILL=no

[Install]
WantedBy=multi-user.target[/code]

I wasn’t sure that the %h would be a problem, but I have seen that the %h could be a problem. Instead of using that, I would remove that and use the absolute path (/home/pi/data/home-assistant/). I’m guessing at the absolute path for your config, so definitely check that before using it.

Got it, using absolute paths and updating updating to /usr/local/bin/hass instead of /usr/bin/local/has. Sorry, should have noticed this myself.

[code]# This is a simple service file for systems with systemd to tun HA as user.

[Unit]
Description=Home Assistant for %i
After=network.target

[Service]
Type=simple
User=%i
WorkingDirectory=/home/pi/data
ExecStart=/usr/local/bin/hass --config /home/pi/data/home-assistant/
SendSIGKILL=no

[Install]
WantedBy=multi-user.target[/code]

Thanks a lot for your help. I work for OpenEnergyMonitor.org. I have been working on integrating Home Assist to work with our platform. I hope to post blog post in the next day or so on our blog: http://openenergymonitor.blogspot.co.uk/

Thanks again for your help.