The quotation marks must be left off for the container name. Otherwise you will get the message
```/usr/bin/docker: Error response from daemon: Invalid container name ("home-assistant-pi"), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed.```
After I removed the quotation marks from my systemd service file, everything worked fine.
* The current text assumes your user is always "homeassistant"
If you follow the advanced guide to setup a virtual environment a user named "homeassistant" or whatever you want will be created. See:
https://www.home-assistant.io/docs/installation/raspberry-pi/
If you follow this guide the "homeassistant" user won't be created:
https://www.home-assistant.io/docs/installation/virtualenv
This page actually refers to the Autostart page on which is assumed that you created a user named "homeassistant". It's better to refer to the user which runs HA in general.
* All occurences of [your user] replaced by YOUR_USER
* Update systemd.markdown
I found that After=network.target was not robust enough for Auto-discovery to work correctly and find devices on the network. I changed this to After=network-online.target to wait until the network was completely "up" before starting.
* Remove unnecessary environment variable setup
The environment variables are not needed and are actually overriding the system PATH variable and were causing trouble in certain circumstances.
* Make the user for the service dynamic
* Cleans up leftover comment
* Refine text to reflect the changes in the service
* Revert change of the users home path
* Updated docs based on user suggestions
Thanks to @NeLLyMerC for the suggestions. Removed the EOF syntax for creating a file. Cleaned up the description of the systemctl commands. Added 'sudo' to the journalctl commands as it will not show the logs if running as an unprived user.
* Update systemd.markdown