Quick Start for Home Assistant Core on FreeNAS 11.3 and TrueNAS Core 12
FreeNAS is a free and open-source network-attached storage (NAS) software based on FreeBSD and the OpenZFS file system. It is licensed under the terms of the BSD License and runs on commodity x86-64 hardware.
Home Assistant Core is now available as a FreeNAS Community Plugin
- This plugin will create an iocage jail for Home Assistant Core
- This will install Home Assistant Core using a python virtualenv
- Also includes options to create and install separate python virtualenvs for the following
The FreeNAS Community Plugin provides these basic configuration files to help get started
|Home Assistant Core||homeassistant||/srv/homeassistant||8123||hass||/home/hass/homeassistant|
I am considering to change the default virtualenv location, user and config directories before the official release of TrueNAS Core 12. I am also working on an updated service script that should allow this plugin to be more easily re-configured after the initial install.
Installation - Community Plugin
Home Assistant Core is available on the Community Plugins page in FreeNAS 11.3
At a minimum you only need to enter a name for this jail to enable the save button. I manage all of my device IP address from my router, so I leave DHCP checked and click save to begin the install.
Installation - Standard jail
You can use the Community Plugin installation script in a standard jail
Use the standard jail if you need to compile packages from the ports tree or if you need more advanced control over the FreeBSD system itself. With regards to Home Assistant Core and the other services running in virtualenvs, there should be no advantage to using a standard jail.
Create a new jail for Home Assistant Core
- You can
--nameyour jail as you wish
iocage create -r 11.3-RELEASE dhcp=on bpf=yes vnet=on boot=on allow_raw_sockets=1 --name JAIL_NAME
Enter the jail console and install some requirements
iocage console $_JAIL_NAME pkg install autoconf bash ca_root_nss git-lite gmake openssl pkgconf python37 py37-sqlite3
Now git the plugin artifacts and finally install
git clone -b 11.3-RELEASE https://github.com/tprelog/iocage-homeassistant.git /root/.iocage-homeassistant bash /root/.iocage-homeassistant/post_install.sh standard
Manual Install - Update Coming Soon
It takes my FreeNAS about 10 min from the time I press install until I am able to login for the first time. This amount of time will vary depending on your FreeNAS setup and hardware. After the initial startup is complete, you will able to reach Home Assistant Core from the Plugins page by pressing MANAGE.
The first time you connect to Home Assistant, you will need to complete the onboarding process. At the end of onboarding you will be given an opportunity to add any auto discovered integrations. If you plan to add the optional services for the Configurator and AppDaemon, or install HACS (Home Assistant Community Store), just skip this step for now. At this point, we are just interested in getting everything installed. Any of these extras are of course optional.
Installing optional services
You can install the optional services and HACS using the jails console or shell, its the same thing. Don’t worry, there are no commands to copy paste at this point. You can connect with ssh if you want but I tried to make this all work easily from the browser. Back in FreeNAS, your Home Assistant Core plugin will show up under both, Plugins and Jails, it is still a jail after all. Enter the console from the Jails page by pressing SHELL.
The FreeNAS plugin includes a simple console menu to help with some common functions inside the jail. From the main console menu, number 2 will be the Configurator. Use option 8 to install.
After the install has finished, use the given link to open the Configurator in a new browser tab. We’re gonna use it in the next steps to add the long lived access token(s) to the configuration file(s). Leave the Configurator open and head back over to the Home Assistant tab in your browser.
We’re gonna create two tokens at this point. One for the Configurator and one AppDaemon. Hopefully, this is where the included configuration starts to make things easy. You can create your your long lived access token from your profile page. Start by creating an access token for the Configurator and copy it to your clipboard.
Using the Configurator, add the token you just created to
configurator/configurator.yaml. Paste your access token to the second line where indicated. Be sure to save the file!
Next, if you plan to install AppDaemon, you should set that up now as well. The configuration I included with AppDaemon is set up to share the Home Assistant secrets file to store its access token and location information. Go back to your Home Assistant profile page and create another long live access token for AppDaemon. Use the Configurator to add the token to
homeassistant/secrets.yaml. While you there, you should also configure your correct location information as well. Make sure you save your changes!
We are done with the Configurator for now. You can close it’s browser tab and head back over to FreeNAS. From the Configurator service menu, select 3 to restart the configurator.
After the Configurator restarts, press 1 to return to the main menu, then press 3 to enter the AppDaemon service menu. Use option 8 to install
Saving the best for last! There’s one more step before you restart Home Assistant. Installing HACS. There’s no service menu since HACS is a custom integration. This is just a little shortcut to download the latest HACS release and extract it to
At the main console menu of the jail, type
install hacs and press enter.
Now head into the Home Assistant Core service menu and select 3 to restart Home Assistant. Notice here that option 8 is check_config. The service will also check_config automatically before restarting Home Assistant. The first time check_config used, you may see an additional package or two get installed. This is normal and only happens the first time.
After you restart Home Assistant you should have links for File Editor and AppDaemon added to the side panel. These are simply iframes that have been enabled in
Finally, head to the integrations and finish adding HACS.
At this point, it’s all yours!
Continue to add any auto discovered integrations and begin your Home Assistant journey!
Attention HomeKit Users - FreeNAS 11.3
This does not apply to the Home Assistant Core – TrueNAS Core 12 Community Plugin
HomeKit requires openssl 1.1.0 or later as the HomeKit Accessory Protocol (HAP) uses the ChaCha20 stream cipher and the Poly1305 authenticator. Please beware that the 11.3-RELEASE base only contains openssl 1.0.2. The FreeNAS 11.3 Community plugin can be updated to use openssl 1.1.1 for Home Assistant Core. This should allow HomeKit to work again but manual intervention will be required.
Using a USB Z-Wave or Zigbee Controller
This is not required for the Home Assistant Core – TrueNAS Core 12 Community Plugin
To directly access USB devices like the Aeotec Gen-5 Z-Stick, Nortek HUSBZB-1 or similar USB controllers inside an iocage jail, you will need to use a custom devfs_ruleset. Before a jail can use the custom devfs_ruleset, it must first be created on the FreeNAS host.
Using the OpenZWave (beta) Integration
- Outline steps to use a RPI with Docker for ozwdaemon
- Create a separate iocage jail for ozwdaemon ( unofficial build )
Additional information might be found in the plugin project wiki
My FreeNAS Community plugins
Most of these are available on the community plugin page in FreeNAS
- Home Assistant Core
- Mosquitto (MQTT Broker)
The FreeNAS plugin is only a quick start to get things up and running
Further configuration will likely be required to meet your specific needs
Thanks for stopping by!