One of my biggest problems is that I am having so many different projects. So if I do not write down important steps I tend to forget them and I have to find the solution again from scratch. Because I am doing this now for the third time I am now writing it down.
I installed Home Assistant on a virtual Ubuntu quite a while ago. Because the documentation states that it is a best practice to use virtualenv I did so. But one major drawback of this installation is: You have to remember some additional steps every time you want to update, fix or configure something. So this post should contain the most important steps to handle your instance of Home Assistant.
This might be one of the most frequently used step-by-step-guides. Especially in the beginning of your evolution.
- Login to your system. (locally or via SSH)
- Switch the user. (homeassistant is the username you chose during the installation)
sudo su -s /bin/bash homeassistant
- Edit the configuration file.
nano ~/.homeassistant/configuration.yaml
- Switch back to your default user.
exit
- Restart Home Assistant.
sudo systemctl restart home-assistant@homeassistant
Updating Home Assistant
- Login to your system. (locally or via SSH)
- Switch the user. (homeassistant is the username you chose during the installation)
sudo su -s /bin/bash homeassistant
- Change the location into the virtualenv. (/srv/homeassistant is the location you chose for the virtualenv)
source /srv/homeassistant/bin/activate
- Run the upgrade.
pip3 install --upgrade homeassistant
- Check the version in the commandline.
hass --version
- Switch back to your default user.
exit
- Restart Home Assistant.
sudo systemctl restart home-assistant@homeassistant
- Check the version in the UI. It should also match your installed version.
Remember: Home Assistant controls your home, so stay tuned! (And do not forget the operating system.)
Changing files of components (if there is a bug and you want a quick fix)
Since version 0.40.0 there is a bug with the zamg sensor. Some of the values are not displayed. This bug (6616) has been reported but the PR has not been accepted so far. My smartphone launches my UI every morning when the alarm is disabled. This has two reasons: I want to know something about the conditions outside and I want to turn on my light so that I do not stumble over something in the darkness.
- Login to your system. (locally or via SSH)
- Find your installation path.
find / zamg.py
- Change the directory to the installationpath. (/srv/homeassistant/ is the default installationpath)
cd /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/
- Edit your file.
If you do not know the path checkout the states in the "Developer Tools" in your UI. This page has some hints for you!
- Restart Home Assistant.
sudo systemctl restart home-assistant@homeassistant
- Check the UI.