Home Assistant: upgrade
https://iotechonline.com/home-assistant-upgrade-to-python-3-8/?cn-reloaded=1&cn-reloaded=1
https://iotechonline.com/home-assistant-upgrade-to-python-3-8/?cn-reloaded=1&cn-reloaded=1
0
# stop home assistant and related services
sudo service hass stop
# cd into /srv directory
cd /srv/
# move your old virtualenv folder and create an empty new one
sudo mv homeassistant homeassistant.3.7
sudo mkdir homeassistant
# assign necessary permissions
sudo chown homeassistant:homeassistant homeassistant
# become homeassistant user and cd into your new created directory
sudo -u homeassistant -H -s
cd /srv/homeassistant
# create your new virtual environmet in the current folder
# with the new python version you compiled before
python3.8 -m venv .
# activate the new viltual environment
source bin/activate
# install necesary python module and homeassistant
python3 -m pip install wheel
pip3 install homeassistant
# exit the virtual environment and
# start home assistant and check logs for errors
deactivate
sudo service hass start
# check logs
# stop home assistant and related services
sudo service hass stop
# cd into /srv directory
cd /srv/
# move the failed venv and restore the old one
sudo mv homeassistant homeassistant.bad
sudo mv homeassistant.3.7 homeassistant
# start home assistant
sudo service hass start
cd /srv
rm -rf homeassistant20221103
# stop home assistant and related services
sudo service hass stop
# cd into /srv directory
cd /srv/
# move your old virtualenv folder and create an empty new one
rm -rf homeassistant20221103
#create a directory for the installation of Home Assistant Core
sudo mkdir /srv/homeassistant20221103
# assign necessary permissions
sudo chown homeassistant20221103:homeassistant20221103 /srv/homeassistant20221103
# become homeassistant user and cd into your new created directory
sudo -u homeassistant20221103 -H -s
cd //srv/homeassistant20221103
# create your new virtual environmet in the current folder
# with the new python version you compiled before
python3.11 -m venv .
# activate the new viltual environment
source bin/activate
# install necesary python module and homeassistant
python3 -m pip install wheel
pip3 install homeassistant==2023.9.3
# exit the virtual environment and
# start home assistant and check logs for errors
deactivate
sudo service hass start
# check logs
Version core-2023.9.3
Installation Type Home Assistant Core
Development false
Supervisor false
Docker false
User homeassistant20230903
Virtual Environment true
Python Version 3.11.5
Operating System Family Linux
Operating System Version 6.1.53-v7+
CPU Architecture armv7l
Timezone Asia/Shanghai
Configuration Directory /home/homeassistant20230903/.homeassistant
Home Assistant Cloud
Logged In false
Reach Certificate Server ok
Reach Authentication Server ok
Reach Home Assistant Cloud ok
Dashboards
Dashboards 1
Resources 0
Mode auto-gen
Recorder
Oldest Run Start Time September 26, 2023 at 8:14 PM
Current Run Start Time September 29, 2023 at 8:21 AM
Estimated Database Size (MiB) 0.27 MiB
Database Engine sqlite
Database Version 3.40.1