Home Assistant Core -- TrueNAS CORE Community Plugin

Tags: #<Tag:0x00007fc3f2f4ecd8>

x x

TrueNAS CORE 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, runs on virtually any x86_64 system and provide a broad set of features for many users. TrueNAS Plugins expand your system’s capabilities by adding 3rd party software quickly and easily.

x x

:warning: This plugin provides a scripted installation of Home Assistant Core. This is considered an advanced installation method, and using this plugin is not an exception. There will be occasions that require manual intervention. This plugin does not provide the full Supervisor experience. There is no Supervisor panel, hence no add-ons.

:information_source: Home Assistant Core is a Python application that will be run inside the jail, using a Python Virtualenv created during the installation. Plugin updates refer to the installation script and files provided in the overlay. Plugin updates are not updates for Home Assistant. Updates for Home Assistant can be performed at any time, using the jail’s console.

This plugin will create an iocage jail for Home Assistant Core

  • Home Assistant Core will be installed using a Python Virtualenv
  • Also includes options to create separate Python Virtualenvs for the following
  • A separate directory for each virtualenv ( service ) will be created under /usr/local/share
  • The plugin’s provided services run as non-root user homeassistant with a UID of 8123
  • Separate configuration directories for each service are located in /home/homeassistant

This Community Plugin provides these basic configuration files to help get started

A simple console menu is provided to help with basic tasks

Quick Start for Home Assistant Core on TrueNAS CORE

Installation - Community Plugin

Install Home Assistant Core from the Community Plugins page

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.

Initial Startup

Initial startup may take an additional 5-10 minutes before the Home Assistant UI reachable. It takes my TrueNAS 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 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

Click Here

You can install HACS, or the optional services using the jail’s console menu. I tried to make this work easily from the browser. In TrueNAS, 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.

From the main 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/config.json. 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 example configuration 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 homeassistant/custom_components/hacs.

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 homeassistant/packages/freenas_plugin.yaml

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!

Have Fun! :slightly_smiling_face:

Using the Z-Wave JS integration

Click Here

You have likely heard about the new Z-Wave JS integration. It is now the recommended Z-Wave integration for Home Assistant. This integration requires the Z-Wave JS Server.

Z-Wave JS Server provides the connection between your Z-Wave USB stick and Home Assistant. This server runs separately from Home Assistant so your Z-Wave mesh will keep running if you restart or stop Home Assistant. The Home Assistant Z-Wave JS integration connects to this server via a web-socket connection. You need to run this Z-Wave server before you can use the integration.

Z-Wave JS to MQTT - TrueNAS CORE Community Plugin

Config Directory

The default location for this plugin is /usr/local/etc/zwavejs2mqtt - After installing the plugin, this directory will be empty! If you plan to use an external dataset (strongly encouraged) I suggest you add your mount point before configuring your Z-Wave device for the first time. By adding your mount point first, files will be stored externally from the start, avoiding the need to copy any pre-existing configuration from inside the jail!

Related Home Assistant guides by @petro

Be sure to give these posts a like, if you find them helpful

Please visit the wiki for more information

This plugin and example configuration is only a quick start to get things up and running.

If you want to run Hass.io on your NAS check out this post by @Petrica

Thanks for stopping by!


Troy, your work is amazing for the Freenas-User-Community. I’ve been following your installation guides since version 11 (your initial post from 2017) and you’ve been a great (!) help! Keep on this fabulous work, please! Thank you!

1 Like

Thanks for posting this. I had no trouble installing this on FreeNAS 11.2-U7. I have these jails installed per your 11.2 manual. I decided to follow this guide and fstab the hass folder to install data from 11.2. I was on Home Assistant 0.95 or 0.96. Everything upgraded and I had to fix some of my configuration due to Home Assistant changes.

Does anyone have an issue with the GUI in 0.105.4 refreshing every 30 seconds? This causes problems when I’m trying to use the Configurator or and GUI in HA. This bug causes you to lose any unsaved changes because it’s like you press refresh in your browser.

Looks like other system installs have similar issues: https://github.com/home-assistant/home-assistant-polymer/issues/4894

The strikeout issue was due to my http settings and HAProxy. I was able to fix this.

1 Like

Hi, I’m struggiling to get the appdaemon installed, after installation it cannot start. Where can I find any logs for what’s wrong? During installation I am receiving a message: ERROR: requests 2.22.0 has requirement idna<2.9,>=2.5, but you'll have idna 2.9which is incompatible. But even installing previous version of idna component (2.8) does not resolve this problem. Still getting the same error message during appdaemon installation and still the appdaemon service won’t start. Any hints?

I’ve installed it with pip3 install appdaemon in the /srv/appdaemon virtual environment and works ok, no problem with this dependency occured anymore. There was another one, i had to downgrade the astral component as per advise here
All good now but seems that the plugin requires some fixing


Thanks for reporting this.

I did know about the need to downgrade astral ( that already happens in the plugin script )

:thinking: This is weird… I mean, the plugin creates a new virtualenv for appdaemon. I just did a clean install of the plugin and installed appdaemon. Everything worked as expected and appdaemon started as soon as the install was finished. I’ll need to do some further investigating on this one…

1 Like

Hey thank you for years of great guidance! i have a homeassistant jail created with the old guide, how would i go about uprgrading/ migrating? what is the best way?

@lop3r Hello

It really depends on what you want to do and if you’re using a separate dataset for /home/hass

Having that separate dataset changes everything – I’ll assume as most people, you do not…

If you want to upgrade your existing jail, it is possible to do that and then copy some updated files into place. ( nothing by itself is difficult but this would likely be the most “advanced” )

If you want to migrate from your existing jail to the plugin, basically you just need to install the plugin and then copy your existing configuration into place. There are numerous ways to go about this depending on how comfortable you are on the command line.

The very first thing to consider is the name you want to use for the new plugin-jail. If you want to use the exact name of your existing jail, then you will need to destroy it before you can use the name again.

IMO, the easiest approach is to use a different name for the plugin. This way you can be sure the plugin is setup and working before you destroy the existing HA jail. Taking this approach I would basically do these steps.

  1. Install new plugin-jail, let Home Assistant finish installing and do initial onboarding
  2. Stop plugin-jail – Stop existing jail
  3. Use the FreeNAS console to rename (or remove) /home/hass in the new plugin-jail
  4. Use rsync from FreeNAS console to copy /home/hass from the existing jail to the new plugin
  5. Start plugin – Install Configurator – Install Appdaemon

If you want to use the exact name that’s already in use then you would basically

  1. Backup the existing /home/hass ( use a zip or tar ) and copy the backup to somewhere safe
  2. Export the the existing HA jail ( this makes a backup you can restore later if necessary )
  3. Destroy the existing HA jail
  4. Install new plugin-jail, let Home Assistant finish installing and do initial onboarding
  5. Stop Home Assistant service – restore config
  6. Start Home Assistant – Install Configurator – Install Appdaemon

Let me know, I can help with more detailed steps depending on what you want to do or if you are using a separate dataset for /home/hass

1 Like

Omg man youre amazing! Ill try when i get home!

Thank you for this! One question though (apologies in adv. if this is stupid) but when creating the USB controller to use the stick you mention
I used the FreeNAS console to create the script in my user’s home directory.

Where would I be installing this, in root or the homeassistant jail or where else?

Hi @slickbeerd

I used the FreeNAS console to create the script in my user’s home directory

On my FreeNAS, I have created myself a normal user and I also have created dataset that I use as a “home directory”. I store my zwave-ruleset in my “home directory” dataset

Really this can stored almost anywhere on your FreeNAS. I have found only these consideration.

  • It should be stored inside a dataset of your main zpool.
  • It should not be stored anywhere inside the iocage dataset. ( This means you can not use the Home Assistant directory )

So turns out i had created a separate dataset for it as per youre instructions. i had just forgotten about it caus it was so long ago. Made the upgrade a breeze.
Thanx man!

1 Like

Hi Troy, been using your guides for the last couple of years now, thanks for all your hard work and time spent making this simple!

If I were to use the new plugin method do I still have the ability to manually upgrade home assistant and the other tools as I would in a custom jail?

Absolutely! There is even a new menu when you login to the jail console to make it even easier. Basically everything from the manual jails still applies to the plugin. They both use the same script to install

Additionally the plugin itself can be updated using the FreeNAS webui. To be clear, when you update the plugin, it will only update the system files I have provided ( like the console menu or the rc.d/startup scripts ). The plugin update will not update Home Assistant or the other services that can be individually updated from the jails console menu.

This is great! The only thing not working is installing HACS.

Archive:  /var/tmp/hacs.zip
unzip: open('homeassistant/custom_components/hacs/const.py'): No such file or directory

Press ENTER to continue...

Worked here. Used winSCP to updload the files.
Followed the instructions here.

To update to latest version of HA do i have to wait for the plugin manager to update it? or is there anyway to update it manualy?

Yes – I added a console menu to make it easier to use from the FreeNAS webui
When you log into the HA plugin console – there should see main menu

Use number 1 for Home Assistant

Use number 4 to upgrade HA

OR – You can use the command line

service homeassistant upgrade

No – The plugin manager will never update HA or any other virtualenv

  • I will always leave this in your control

The plugin manager will only update the FreeBSD system packages. It will also update the system files I provided with the plugin. For example, when I add ( or need to fix ) something in the console menu – or when there is an update to the service script

1 Like

Uau :smiley: damn you’re the MAN! :smiley: thanks

1 Like

Troy - really appreciate the massive effort you’ve put into making a Freenas plugin for HA. Can’t thank you enough.

Does anyone have any experience of installing Zigbee2mqtt on Freenass? I’m trying to hook up some Xiaomi sensors. The official instructions over at www.zigbee2mqtt.io give guidance on running on a bare-metal Linux and virtualized environments, but as we know Freenas is basically Freebsd and I am out of my depth with that, the syntax and commands are not the same and although I can handle using the command line I tend to struggle a bit at the best of times.

Is it necessary to install Zigbee2mqtt in a separate jail from the main HA jail?
Is it possible to install Hass.io on freenas? Zigbee2mqtt is available as an official addon for that.

Any help much appreciated


  • What kind of zigbee hub do you have? Is it a USB device?

With a few extra steps – USB devices like the HUSBZB-1 can be used by HA directly.

  • Is there a reason you do not connect directly to HA?
  • Is there a reason you want ( or need ) to use Zigbee2mqtt?

I’m asking so I can understand if you have a different use case that would require Zigbee2mqtt.

If you want to install Zigbee2mqtt I would strongly recommend a separate jail

In any case – To connect a USB zigbee or zwave hub, to any jail on FreeNAS

This is something separate – I can only say where to look.

Yes – but there is no way to access your usb zigbee device

1 Like