You just won the lottery. How do you build the most stable HA server?

I did not win the lottery, however HA has become an integral part of my home and I’m looking to minimize downtime. I was running on a pi but it went belly up. I moved to a virtualenv install on vmware which has been running very well but now I can’t upgrade because the version of python has changed. Do I start over with a new virtualenv? Move to docker? If I go to docker do I go with hassio or vanilla hass? Any opinions, partial opinions, pros and/or cons are welcome.

Setting up a new virtual environment takes like 2 minutes, then you just install homeassistant in to it and copy your configuration back in.

Ten minutes max.

1 Like

My knowledge of python virtual environments is pretty bad. Is it really that simple? This thread: Python 3.6 upgrade of a virtualenv seems to imply there’s a lot more to it. There also seems to be an issue with openzwave, does that mean all my zwave IDs will change? That’s not a huge deal but like I said I’m looking for the most stable environment and am willing to put in a little work now to do things right if it means not having to redo it again in 6 months.

In fairness, I was presuming from the way you worded your first post that you’d already installed a newer python version, but realised that you can’t ‘upgrade’ the venv.

Adding installation of python to the process, let’s call it a nice round 15 minutes, with time for a tea break at half time.

Honestly, it’s easy as pie.

Download and install python 3.6.4, delete the old venv (NOT your homeassistant folder!), create a new venv with python 3.6, install homeassistant in it, done. :+1:

1 Like

I’ve just looked in that thread you linked to, and I can see why you were apprehensive. There is no reason to do half of the steps in there.

As soon as you copy in your configuration and run homeassistant it will install all the requirements you need, same as it would if you added a new component and restarted. So all that saving requirements.txt is guff tbh (no offence to the author of that thread)

1 Like

I’m planning a new install soon to meet the python requirement. I’m waiting on the new LTS release of Unbutu due later this month.

Running on a old desktop has been rock solid for me.

Detail of my setup are on my repo.

https://github.com/SilvrrGIT/HomeAssistant

If I won the lottery about the only thing I would change is to move to some more power efficient hardware.

Yeah, agreed, some super-awesome server device but that would just be for fun, the actual install of homeassistant would still be a venv on whatever device I happened to decide was the most minty for shelling out the cash on.

i have zwave and followed the steps in that thread. I skipped the part about requirements.txt and instead did a normal home assistant install once python was updated. Once you copy your configuration everything else will reinstall. If you see any errors in the logs you can most likely manually install the failed module.

My personal install is on a venv in a i5 with 6gb of RAM on a SSD…runs really smooth and hass restarts are 30 seconds normally. I am also running zoneminder, nextcloud, node-red, inlfuxdb and grafana.

@afreelan

Step by step, because I’m sat at work bored so may as well…

(Assumes you have a privileged user, and an unprivileged account called homeassistant upon which you run your instance, and that the venv is located at /srv/homeassistant)

STOP HOMEASSISTANT FIRST

Starting as privileged user…

sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev

wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar xzvf Python-3.6.4.tgz
cd Python-3.6.4/
./configure
make
sudo make install

Make tea

cd /srv/homeassistant 
sudo rm *
cd .. 
sudo chown homeassistant:homeassistant homeassistant
sudo su -s /bin/bash homeassistant
cd
mv .homeassistant/ .homeassistant_backup
cd /srv/homeassistant
python3.6 -m venv .
source bin/activate
pip3 install homeassistant
hass

Wait a minute, press ctrl + c

deactivate 
cd .homeassistant 
rm *
cd .. 
mv .homeassistant_backup/* .homeassistant/
exit
sudo reboot 

Presuming your autostart service was working before and we’ve installed everything back to the exact same place should be back up and running pretty sharpish. Remember that when it restarts it will be downloading all the requirements and dependencies specific to your installation so it may take a while.

Hope this helps.

8 Likes

I’d build me a bad ass unRaid server and leave my little 24 TB single CPU Xeon box for HomeAssistant, NodeRed, etc all running in docker containers.

1 Like

If running venv I would create script and automate upgrade process. This would include some “upgrading,please check back in 5min” webpage.

Docker is 20 second upgrade, 1 minutes max. Not saying it’s better, just giving time for your reference.

In both cases, breaking changes may hose the process so for this reason I only upgrade for new feature or some security update.

That approach can be a double edged sword. When you do decide to upgrade the chances of hitting breaking changes is higher, and you probably have to address several at once.

Plus finding bugs in every new version helps the software to be better in the long run.

1 Like

@anon43302295 That worked perfectly. No glitches, booted right back up. You didn’t even have any typos (are you a robot? not judging, just curious). Thanks for all the help.

2 Likes

Ha, no, but I type these things out on my phone so much that the predicted next word thingy takes care of most of it :smile:

How long did it take?

maybe 10 minutes

1 Like

Ace :+1:

Glad you’re all sorted :slight_smile:

Expanding on the original question here. With Home Assistant (HA), AppDaemon (AD) and the AD web Dashboard running on the same box, my environment was overwhelming my PI, even breaking it out to two PI’s was still giving me performance issues. So I bit the bullet and bought one of these little headless bricks that are about the size of 2 PI’s put together. This resolved my performance issues and has been rock solid since I did it about 2 months ago.
Because I now have a more powerful system I felt the need to setup virtual environments for HA and AD. This protects them from each other and from any other applications I might decide to install on this server in the future. If you are limiting your server to just HA and AD, and your are not a developer that needs isolated installs of AD or HA, then there really isn’t a need for virtual environments or docker installs in my opinion. Just use the basic install. Personally, I would stay away from hasio for a while (6 months or so) longer until it’s growing pains have subsided.

Thank you so much. I will try tonight.

1 Like

I ended up by installing it in my Synology NAS which has a UPS connected. Zero problems so far. If you have one you may consider it as an option.

1 Like

Same as @soukron but limited to HA 0.64.3 owing to python 3.5.1 limitation on synology. However this setup is very stable