Installation of Home Assistant on your FreeNAS

I have the same OpenSSL issue with a fresh install in a freenas jail.

Welcome VlcaSh to the fourms!

I actually think I figured it out!
You will need to update to TrueNAS 12.X then upgrade the jail to 12.X or rebuild it to regain support.

I am working on a script that I should be able to share that can build a new jail very close to this guide.
I will hopefully be able to post it tonight or tomorrow.

Thanks Weldfire!

I did a quick google search on TrueNas, am I right in assuming I need to buy the TrueNas hardware to run it as supposed to FreeNas running on my home (made) server?

Not at all.
TrueNAS Core is the free version of what was FREENAS. All you need to do is update to TrueNAS, which I did months ago when it was still in beta, and install the community plug-in, which is very easy, or use this guide.

The community plugin on TrueNAS Core is a scripted installation of this guide with a few extra functions for convenience. Among other things, thereā€™s a simple console menu for common functions like upgrading or restarting Home Assistant. It also has a function to rebuild the virtualenv with one command.

Hi troy,
Given your excellent work in creating the plugin, Iā€™m not sure why this thread exists.
Iā€™ve only used your plugin but keep reading about a Supervisor; is that worthwhile addition and, if so, can you point me in the way of installing it, please?

Iā€™ve updated to TrueNas, installed HomeAssistant from the plugin menu and got it up and running! Thank you for the help!

2 Likes

Hereā€™s my TL;DR take on it

The Supervisor comes with Home Assistant OS, it not something you can just add. It also requires Docker, which is not available on FreeBSD at this time. Home Assistant OS is designed to be an appliance and provides addons, which are simply other Docker containers, that have been pre-configured to work with Home Assistant, mostly ā€œout-of-the-boxā€. Itā€™s my understanding, the Supervisor is responsible for managing all the addons (Docker containers) and provides a means to configure them from within the Home Assistant UI.

Addons are similar to plugins on FreeNAS / TrueNAS Core. Basically, the purpose is to provide some additional piece of software. Unlike addons, plugins are typically a standalone service, meaning they not pre-configured to work with other plugins. ā€“ So do you need these addons? I donā€™t knowā€¦ Do you need plugins? :man_shrugging: In either case, 99% percent of the time, the software can be installed manually and configured to work as needed.

If youā€™d like to consider running Home Assistant OS on TrueNAS CORE, see this guide. ( On the other hand, TrueNAS SCALE is based on Debian and will include Docker. )

I am newbie. I am trying to install the Home Assistant on my TrueNAS server. I manage to create the jail but not able to run the ā€œpython3.8 -m venv . source ./bin/activateā€. Please help? I am stuck her and not sure how to create virtualenv or the syntax is wrong??

I am not able to start the service on Shell (not jail shell). failed precmd routine for homeassistant.
image

Why not just install the plugin and save yourself a lot of grief?
The plugin works out of the box, does everything you need, and is hassle free, thanks to the work of @troy.

1 Like

Hi @MrTeaIOT ā€“ Sorry your having trouble.

Installing the community plugin is the easiest solution. If you would like to continue with a manual installationā€¦

The answer to your question about the failed pre-cmd routine. It looks like you have not created the homeassistant user group inside the jail. Are you trying to run Home Assistant as a different user or have you created the homeassistant user with a different group? There a solutions for all of these cases but I need to know what your trying to accomplishā€¦

Again, if you just want to get Home Assistant installed, use the pluginā€¦ The most important thing with any installation method will be moving your configuration to a separate dataset. This will move your configuration safely outside the jail, allowing you to easily switch from the plugin to a manual jail at any time.

I did follow the instructions and created user and group under same 8123. I am not able to run using the plug-in because I tried it 2 times and my TrueNAS server GUI screen froze up and kill my internet network down. After I reboot the TrueNAS from console, the internet back online. I like to do plugin if it works. Any video instruction to do manually in the jail will be okay too?

A couple things hereā€¦

First you are not using the suggested name. Thatā€™s OK though, you can use any user name you want, however you will need to configure the Home Assistant service accordingly.

Before we get to thatā€¦ From your screen shot, it looks as though youā€™ve created this user on TrueNAS. I realize this may be confusing, let me briefly try to explain.

For the Home Assistant service to run, you need to create the user inside the jail. This is not the same user you created on TrueNAS. Think of the jail as a separate computer and you have the same account on two computers.

  • The user is required to exist inside the jail.
  • The user on TrueNAS is optional. We only create this user for convenience

Iā€™m not sure what would cause that. The plugin only provides the installation script. The delivery system for files and what you click on in the UI, is all handled by TrueNAS itself. I donā€™t control any part of the delivery system or how the jail is created from the manifest.


To solve the pre-cmd error using the hassio user name you have already created on TrueNAS,

Please try the following to also create the hassio user inside your Home Assistant jail.

iocage console $JAIL

## Create empty home directory and add user
install -d -g 8123 -o 8123 -m 775 -- /home/hassio
pw adduser -u 8123 -n hassio -d /home/hassio -w no -s /usr/local/bin/bash -G dialer

## Configure the Home Assistant service to use a different user or group
sysrc homeassistant_user=hassio
sysrc homeassistant_group=hassio

## Set a path to the configuration directory
sysrc homeassistant_config_dir=/home/hassio/homeassistant

I also have a guide in plugin wiki page for using the rc.d/homeassistant script to install Home Assistant in a manual jail. It is the middle ground between this guide and using the plugin

A post was split to a new topic: Connecting Node Red to Home Assistant

Now that HA has dropped support for python 3.7 is anyone else having issues upgrading? I just tried upgrading to 2021.3.2 but even after updating my Python env to 3.9, I canā€™t install cryptography. Looking on freshports, it looks like there isnā€™t a version for FreeBSD that supports python 3.8 or 3.9ā€¦ Anyone find a work around?

What I did in the TrueNAS community plugin, was to add a pip.conf file (this stops pip from nagging about the available update, which should not be updated) and I started using requirements and constraints during pip install.

Basically download both files inside you HA jail, then you need to edit the first line of requirements.txt so it points to the constraints.txt file you also downloaded.

Then to install Home Assistant, activate a new virtualenv and use the following

pip install wheel
pip install homeassistant -r /path/to/requirements.txt

I canā€™t install cryptography . Looking on freshports, it looks like there isnā€™t a version for FreeBSD that supports python 3.8 or 3.9

FYI, I donā€™t install cryptography from fresh ports in the TN plugin, it gets compiled and installed automatically by Home Assistant, inside the virtualenv

Worth upgrading the instructions to Python v 3.9? Iā€™m a little hesitant of just changing 38 to 39 without knowing its been tested ā€¦ thanks

Python version

Support for the running Python version 3.8.8 is deprecated and will be removed in Home Assistant 2022.1. Please upgrade Python to 3.9.0 or higher.

You have no choice

Python 3.8 has been deprecated because Python 3.10 has been released. Support will be dropped in Home Assistant 2022.1.

I have the choice of waiting up to two months and making sure the instructions are up-to-date and tested before updating my core system. I also would like to help other users by asking the question publicly. I also have the choice of not being facetious.