All integrations lost after auto start SOLVED!

Noob here. Sorry if this has been answered but I couldn’t find anyone with the same issue. When I reboot my RaspberryPi4 (running Home Assistant on Raspbian), Home assistant appears to loose all configurations. When i start it using the Hass command, it starts normally.

Then probably your startup script is using the wrong user :wink:

I’d expect that’s likely a file in /etc/systemd/system starting with home

Thanks for answering! I can run the hass command from the user homeassistant, so I set that as the user for my script. Ill post the script below.

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

[Service]
Type=simple
User=homeassistant
ExecStart= /srv/homeassistant/homeassistant_venv/bin/hass

[Install]
WantedBy=multi-user.target

Also, I just realized, when I start the script from command line with hass not running, it starts fine. However, after a reboot, it doesn’t load correctly.

I figured it out! Hope this helps someone else with the same issue.

I added a 30 second delay to the script. I’ll post the full script i used for my autostart below.

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

[Service]
ExecStartPre=/bin/sleep 30
Type=simple
User=homeassistant
ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target