Upgrading Home Assistant

  1. Stop Home Assistant (sudo systemctl stop homeassistant.service)
  2. Open the directory where the virtual environment is located: (cd /srv/homeassistant/)
  3. login as homeassistant…. sudo -u homeassistant -H -s
  4. Activate the virtual environment: source bin/activate
  5. Upgrade Home Assistant: ‘python3 -m pip install –upgrade homeassistant’
  6. Start Home Assistant (sudo systemctl start homeassistant.service)
  7. Check status (sudo systemctl status homeassistant.service)
  8. You can now reach the web interface on http://ipaddress:8123/ – the first start may take up to 20 minutes before the web interface is available

Update

  • If python needs updating….
    • As pyenv is installed a download of python and
      • a ./configure – -enable-optimisations followed by a make -j2 does not work as a module called encodings is not found.
      • there is another way ……
    • Create a new venv using the pyenv version of python
      1. get the latest version of python from pyenv needed.  
        • pyenv list
        • pyenv install <version>
        • pyenv global <version>
      2. stop homeassistant. sudo systemctl stop homeassistant
      3. login as homeassistant
      4. Go to /srv …. cd /srv
      5. sudo mv homeassistant homeassistant_old_<yymmdd>
      6. sudo mkdir homeassistant
      7. change ownership. sudo crown homeassistant:users homeassistant
      8. now install virtual environment.
        • cd /homeassistant
        • python13 -m venv .
        • source bin/activate
      9. Install homeassistant.  python3 -m pip install homeassistant
      10. system runs mysql database and this needs to be installed as well python3 -m pip install mysql
      11. check has installed.  file ‘hass’ should be in /srv/homeassistant/bin
      12. restart.  sudo systemctl restart homeassistant