Reinstalling Home Assistant: What's your way to do it?

I had to reinstall home assistant because tradfri component stopped working. I got messages about missing tinydtls and missing apifactory and so on. Even after upgrading to 0.57 (that was released some hours before this post). I don’t know what went wrong. I experimented a lot and tried every hint I found in the internet to revive tradfri. Nothing worked. So I reinstalled Home Assistant with the following commands:

uninstall home assistant:
pip3 freeze | xargs pip3 uninstall -y

in your .homeassistant directory remove deps:
rm -rf ./deps/ (this command is potentially dangerous! see post scriptum below)

then reinstall home assistant

pip3 install homeassistant
pip3 install aiohttp
pip3 install websockets

PS: a joke about rm and russian roulette (picture was stolen somewhere from the internet, no text version for safety;)):

1 Like

love the comic

I use docker. Never a problem after upgrade!!

docker rm hass 
docker create <my ports and files> hass
docker run hass

Will eventually create an automation in HA that I can fire off to do this
I also wait 3 days before update or until xx.1 release to allow bug fix (unless some nice new component comes out)

I’m running the AIO version prior to Dec 2016 so names and paths may vary.
I also had to reinstall it to get the tradfri version running but it only takes a few minutes and I don’t have to redo any configuration. (always make a backup tough, don’t blame me if everythings gone)

  1. Rename the old virtual env. (just so you can restore it if everything goes FUBAR)
    sudo mv /srv/hass/hass_venv/ /srv/hass/hass_venv_old/
  2. Create a new virtual env. with the same name
    sudo mkdir /srv/hass/hass_venv
  3. change ownership to old user hass
    sudo chown hass:hass /srv/hass/hass_venv
  4. Switch to hass user
    sudo su -s /bin/bash homeassistant
  5. Setup the virtual env.
    virtualenv -p python3 /srv/hass/hass_venv
  6. Activate the virtual env.
    source /srv/homeassistant/bin/activate
  7. Install home-assistant
    pip3 install --upgrade homeassistant

And now you should be able to start home-assistant as usual. Steps adapted from https://home-assistant.io/docs/installation/virtualenv/#step-2-create-a-directory-for-home-assistant

1 Like

Docker is the savior here for Home Assistant