Manual starting working but autostart using systemd raise error.
cat /etc/systemd/system/[email protected]
[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/home/homeassistant/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
[Install]
WantedBy=multi-user.target
HA worked correctly if I run it manually:
sudo -u homeassistant -H -s
source /srv/homeassistant/bin/activate
cd ~/.homeassistant
hass
but only autostart raise error that start from:
First part of error traceback:
Dec 26 21:58:10 raspberrypi hass[413]: 2021-12-26 21:58:10 ERROR (MainThread) [homeassistant.setup] Error during setup of component http
Dec 26 21:58:10 raspberrypi hass[413]: Traceback (most recent call last):
Dec 26 21:58:10 raspberrypi hass[413]: File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 229, in _async_setup_component
Dec 26 21:58:10 raspberrypi hass[413]: result = await task
Dec 26 21:58:10 raspberrypi hass[413]: File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/__init__.py", line 192, in async_setup
Dec 26 21:58:10 raspberrypi hass[413]: local_ip = await async_get_source_ip(hass)
Dec 26 21:58:10 raspberrypi hass[413]: File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/network/__init__.py", line 35, in async_get_source_ip
Dec 26 21:58:10 raspberrypi hass[413]: return source_ip if source_ip in all_ipv4s else all_ipv4s[0]
Dec 26 21:58:10 raspberrypi hass[413]: IndexError: list index out of range
If I restart HA manually it start working fine.
sudo systemctl restart home-assistant@homeassistant
But I need to run it automatically from raspbian startup
Prerequisites:
- Raspberry Pi4 mode B (8gb) + Argon ONE M.2 case
- Raspbian GNU/Linux 11 (bullseye)
- HomeAssistant 2021.12.5 (core installed)