[Answered] home assistant


I installed Homeasssistant via dietpi-software (runs great). I also updated it several times (v 0.83.1) . I was wondering how homeassistant starts at boot-time/reboot?

In htop i see this: /usr/bin/python3 /usr/local/bin/hass -v -config /opt/homeassistant --pidfile /var/run/hass.pid --daemon

Basically i want to stop/start homeassistant from the command line…



Use dietpi-services

:~# dietpi-services
[  OK  ] DietPi-Services | Root access verified.


[ INFO ] DietPi-Services | Invalid command
Available options:

 - start/stop/restart/status            (all services, known to DietPi)
 - start/stop/restart <servicename>     (single service, systemd)
 - systemd_controlled/dietpi_controlled (all services, known to DietPi)
 - enable/disable all                   (all services, known to DietPi)
 - enable/disable <servicename>         (single service, systemd)
 - mask/unmask all                      (all services, known to DietPi)
 - mask/unmask <servicename>            (single service, systemd)

 - You can include/exclude custom services by editing the following file: /DietPi/dietpi/.dietpi-services_include_exclude

:~# dietpi-services status

:~# dietpi-services stop home-assistant

thnx man!

Jep, it’s basically a systemd service, so systemctl start|stop|restart home-assistant can be used.
dietpi-services start|stop|restart <service_name> is our error handled front-end for this.

The services are started at the end of boot stage from: /DietPi/dietpi/postboot
Sadly you cannot natively disable/mask it, since it is already located at /etc/systemd/system/home-assistant.service, where masking would create a symlink to /dev/null usually to prevent the service from being started.
However you could move it to /lib/systemd/system/home-assistant.service, the place which is used by APT packages:
mv /etc/systemd/system/home-assistant.service /lib/systemd/system/home-assistant.service
Then use:
systemctl mask home-assistant or
dietpi-services mask home-assistant