Hassbain Autostart configurator.py help

I am not understanding this documentation clearly to autostart my configurator.py file on boot in hassbain:

Documentation: https://home-assistant.io/docs/ecosystem/hass-configurator/
“If your system is using systemd (that’s usually what you’ll find on a Raspberry PI), there’s a template file you can use and then apply the same process to integrate it as mentioned in the Home Assistant documentation. If you use this method you have to set the BASEPATH variable according to your environment.”

I found the template file that aligns with my system by confirming I am running systemd via:
$ ps -p 1 -o comm=
Template: https://github.com/danielperna84/hass-configurator/blob/master/hass-configurator.systemd

What do I need to do with this template file itself once i modify it… Where do i place it does it go where the [email protected] lives or what… any help would be appreciated!

If you installed using the hassbian image it should already be setup to autostart.

Hassbain does start but im talking about the hass-configurator @silvrr

I figured it out you need to copy the template file into your etc/systemd/system directory and rename it to have .service file type. you must also make sure to set the path to your configurator.py location

1 Like

hey @Andrew_Lozoya tell me how do that.

1 Like

I am also looking for this same answer. My hassbain install does not have /etc/systemd folder structure.

Not sure if anyone here is still looking for this answer… but this is how it’s done.

You get the template from here

Then you modify the template… in my case on Ubuntu x86 it looks like this.

[Unit]
Description=HASS-Configurator
After=network-online.target

[Service]
Type=simple
User=homeassistant
# Some security related options.
# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html for details.
# NoNewPrivileges=true
# ProtectSystem=true
InaccessiblePaths=-/mnt -/media
ReadOnlyPaths=/bin -/lib -/lib64 -/sbin
# PrivateTmp=true
# ProtectKernelTunables=true
# ProtectKernelModules=true
# ProtectControlGroups=true
# RestrictRealtime=true

# Set configuration options by specifying environment variables
# Environment=HC_LISTENIP=0.0.0.0
# Environment=HC_PORT=3218
# Environment=HC_GIT=false
# Environment=HC_ALLOWED_NETWORKS=192.168.1.0/24,127.0.0.1
# ...
# Set the path to your configurator.py location

WorkingDirectory=/home/homeassistant/.homeassistant
ExecStart=/srv/homeassistant/bin/python3 /srv/homeassistant/lib/python3.6/site-packages/hass_configurator/configurator.py settings.conf -s
Restart=always

[Install]
WantedBy=multi-user.target

Once the file is modified, use “sudo Nano” to save it… see the image for the location and file name.

Finally run these commands to create it as a service, load and start it.

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

I followed the instructions here for https://www.home-assistant.io/docs/autostart/systemd/ . under “next steps”