1. base OS
2. prereqs
yum -y install gcc make python39 python39-devel
python3.9 -m pip install --upgrade pip
3. (re)compile sqlite
curl -s https://sqlite.org/2022/sqlite-autoconf-3380100.tar.gz | tar xz
cd sqlite-autoconf*/
./configure && make && make install
rm -fr sqlite-autoconf*/
echo "/usr/local/lib/" > /etc/ld.so.conf.d/sqlite3.conf
ldconfig
cd
4. installation
mkdir -p /opt/homeassistant
cd /opt/homeassistant/
python3.9 -m venv .
source bin/activate
python3.9 -m pip install --upgrade pip
pip3.9 install homeassistant home-assistant-frontend
5. service
echo 'hassopts="-v"' > /etc/sysconfig/homeassistant
touch /opt/homeassistant/bin/homeassistant.sh
chmod +x /opt/homeassistant/bin/homeassistant.sh
vi /opt/homeassistant/bin/homeassistant.sh
#!/bin/sh
set -e
hassopts=""
test -f /etc/sysconfig/homeassistant && source /etc/sysconfig/homeassistant
source /opt/homeassistant/bin/activate
hass "${hassopts}"
exit 0
vi /usr/lib/systemd/system/homeassistant.service
[Unit]
Description=homeassistant
After=network.service xinetd.service
[Service]
ExecStart=/opt/homeassistant/bin/homeassistant.sh
ExecStop=/bin/pkill -u hausr
WorkingDirectory=/opt/homeassistant/
RemainAfterExit=no
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable --now homeassistant.service
systemctl status homeassistant.service