Home Assistant Core -- TrueNAS CORE Community Plugin

thanks for your prompt reply

please provide more detailed instructions on sharing the required directories using samba so that I can use vs code (when I finally get all my devices integrated and start writing automations)

additionally, I installed the mosquitto plugin. how do I integrate it with home assistant

I’d appreciate links to examples of adding “store/addons” and “hacs/integrations” using the home assistant core plugin, as well as some recommended addons to get me started

finally, are there guides to discover a protocol of an iot device (e.g. a curtain switch or thermostat) which is not currently recognized by home assistant and develop an the missing interface. moreover, these devices usually connect directly to an app (and who knows to what other cloud provider), is there a way to block these communication (other than the suggestions of replacing my whole network to ubiquiti unifi with separate vlans)

Most of your questions can be answered by reading Troy’s excellent github page.

I am assuming you are referring to: https://github.com/tprelog/iocage-homeassistant

I did not find answers to any of my questions there

Thank you @Tromperie :slightly_smiling_face:. Although I think @hanan is correct.

Admittedly, I have dropped the ball with regard to having good (and complete) documentation. I mean, all these questions do have documented answers, but finding them at this point, is like a scavenger hunt. Things like creating a samba share are more of a general TrueNAS topic but it has been my intention for some time, to put together some simple examples that directly relate to this plugin.

Standby… I’m gonna work on updating some basic setup instructions. I started to link some existing steps in this reply, but I have removed them because they needed to much additional information to provide the desired end result with the recent plugin on TrueNAS.

Generally speaking, forget this is a “plugin”. On TrueNAS, the term “plugin” means you can press a button in the UI to install Home Assistant Core. After the installation completes, consider yourself to be running Home Assistant Core, using a Python Virtualenv.

Again, we do not have addons with this installation method. I don’t mean to be rude or picky here, but using the correct terms is important. HACS is a custom integration. The HACS documentation covers configuration and usage much better then I could do :wink:

I’m not the best person to give ideas on what you can do. However, this forum is already filled with many great ideas. I consider my own setup to be very practical, which makes it extremely boring compared to what most people accomplish.

The Mosquitto plugin, as mentioned before, is just a separate jail with the MQTT broker installed. By default, there is no username or password needed to connect. The Mosquitto MQTT Broker itself, can be configure according the it’s documentation. See this post for some links.

In Home Assistant, you just need to add the MQTT integration.

The preferred way to setup MQTT for your installation is via Configuration >> Integrations in the UI, click the button with + sign and from the list of integrations select MQTT

Personally, I use Mosquito with the default settings. I simply installed the plugin, then added the integration to Home Assistant.


I’m not a developer, so I can not answer with any certainty. The jails on TrueNAS use FreeBSD, which is not officially supported by the Home Assistant developers. I’m sure you could manage some basic ground work using this plugin, but for serious development of a new integration, I might suggest starting with the official developer docs - Honestly, I’m not sure if this plugin (or otherwise running in a jail on TrueNAS) is a good option for HA development.

I think it just depends on the particular router that you currently have. It’s been several years since I have used something like a Net-Gear or Asus router. If capable, some suggestions would be block the devices ip address from accessing the internet or create a firewall rule that blocks the traffic. I think vlans make it easier to manage, but lots of home routers still allow some basic firewall functionality that can be used to block unwanted traffic. The downside here, is that you might have to configure a firewall rule for each device individually. If you can create multiple WiFi networks, maybe you can block a particular SSID from the internet and connect all these devices to that.

Many thanks Troy - all back ‘on the road’ again :ok_hand:

1 Like

Sorry I have removed this post

If you did not get this setup yet, updated instructions that will be based on moving the configuration to an external dataset, are coming soon!

Hi @jermstheitguy - Sorry for the trouble.

Did you get it figured?

Are you accessing the jails shell through using the TrueNAS UI?

Sometimes I run TrueNAS in a VM if I need to work on my plugins. I mention this because I have had the same issue that you mention. Personally, I only encounter this when TrueNAS is running in a VM but in this case it has become almost impossible to install appdaemon. Until just now, I thought this was caused by using the VM.

I was going to say, if I connect to the TrueNAS VM using ssh, then access the jails console I am able to install appdaemon without issue.

I am using the TrueNAS UI. I don’t know how but Right after I posted, I tried it again and successfully installed.

I have a really odd problem. Decided to do a fresh install of HA after upgrading to TrueNAS. However my server was accidentally reset during the initial install. So I deleted the HA jail dataset and jail from the UI. But every time I try to reinstall I get the following error:

Error: Jail: homeassistant has a missing configuration, please check that the dataset is mounted.

It’s as if there’s something left over from the failed install but I can’t find anything.

Grateful if anyone knows what’s going on here.

That is strange indeed.

I have encountered a similar error in following the situation – If I cancel a plugin’s installation before it completes. then try to reinstall the plugin a second time, using the same $JAIL_NAME from the canceled (or failed) attempt.

Usually I just pick a new $JAIL_NAME and it works

Alternatively, if there are hidden remains of the previous jail, you can try using this command from the TrueNAS console to remove them. There have been a few time I needed to run this command twice

iocage destroy $JAIL_NAME

Thanks for the suggestion Troy. I did try iocage destroy homeassistant, and it removed the jail, but the problem persisted.

I seem to have solved it by creating a manual jail with the exact same name (homeassistant) and then deleting that via the GUI.

The wiki sounds great. Will peruse that very shortly.

I volunteer to test.

1 Like

Thank you @Tromperie

Please have a look at the link I provided above, Moving configuration to an external dataset – Please follow the guide and let me know

  • In your opinion, is the guide approachable for new user
  • Is the guide easy to follow
  • Where you successful

EDIT. I just fixed link, so if you tried it already and went nowhere, it should work now

@troy,
I am happy to report that my configuration folder now resides in another dataset, thanks to your guide.

In answer to the questions;
The guide is approachable for a new user of HA. I would venture that most users of Free/TrueNAS will be comfortable with the CLI.
The guide is easy to follow. I suggest the commands be pasted into a text program, such as Notepad or Notepad++, and edited there before being pasted in. I use Chrome, so the paste function is available.
YES, success. I didn’t check the command carefully enough and have another mnt which I have since deleted.

Many thanks, again, for your fine work.

1 Like

Version 5 is here!

TL;DR

First, let me briefly say what this plugin is and what a plugin update actually means.

This is just a scripted installation method to install Home Assistant Core. Home Assistant Core is Python application that runs inside a jail, using a Python Virtualenv created during the installation. Updates for this plugin, refer to the installation script and files provided in the overlay. Updates to this plugin are not related to updates for Home Assistant Core. Updates for Home Assistant are preformed using the jail’s console. A simple console menu has been provided to help simplify this task. The console menu is provided in the overlay and is an example of something that could be updated in a plugin update.

Possible breaking changes

  • This will effect any users who have initially installed this plugin on FreeNAS before August 2020.

  • If you have updated the plugin since that time, you are likely running version 4 and the old hass setting have been explicitly set during the update. You can continue to update the plugin, remaining on version 4 with no breaking changes.

  • A clean install in the future will no longer apply the old hass settings for you. If you are referencing the path to /home/hass in any of your Home Assistant configuration, it will need to be changed to /home/homeassistant before installing version 5.

  • A clean install of this plugin will now install version 5

  • Version 4 can still be installed using the TrueNAS console, however it is no longer being maintained and instruction for reinstalling this version will only be provided by request ( and I’m still gonna try to talk you out it! )

Running a Plugin -> UPDATE will update all files found in the overlay, so everyone who pushes the button is getting this update. For users who initially installed this plugin on TrueNAS Core, the plugin update will suffice. However, the only way I can ensure a clean break is to require a fresh install in-order to officially upgrade. Basically, That means I’m only setting the plugin to version 5 during the installation. The version number will not be changed during a Plugin -> UPDATE, if it already set to a anything less.

Also, I’m in the process of updating the wiki. New pages are (finally) being added. Examples and screenshots will be updated to reflect the version 5 in short order.

The first, and arguably most import page on the wiki has been added.

Hey Troy, been following your work for a while, thanks for the hard work.

Working on Moving configuration to an external dataset, a note and a question.

Create the group

I already had a Group “hass” with the GID of 8123, The add user wizard recommended against it, but I checked the “Allow Duplicate GID”.
Not sure when I added it, original install was back in FN-11.2 and was just a Jail, then HAC in 12.1. I guess at some point I set up an external dataset, but did not use it when going to HAC. (oops).

Add the user

Going off the instructions and screenshot, the SUBMIT stays greyed out until you enter a password. Can we assume the password can be anything since its using “nologin” in the shell?

1 Like

That should be fine for now. I’m working on a page to cover the switch from hass to homeassistant. There’s really a few ways to set this all up but I’m only going to cover one simple approach. But basically homeassistant is replacing hass.

Good catch! Just go back and Disable Password to YES. I’ll update the picture ASAP. I updated the picture! Thanks for pointing that out @Arb1es

The password will only need to be set if certain cases when connecting using the SMB share. I will cover if and when the password should be enabled on the SMB page of the wiki


EDIT to add. I don’t want to make it confusing so I’m going to suggested switching from hass to homeassistant for everyone still using those settings. Technically if understanding the relation of the permissions, the part that really matters is that UID and GID match. The name on TrueNAS doesn’t really matter so much but it be easy to get confused when they don’t match also

@troy,
When attempting an update, the message said it wouldn’t and required manual intervention. Using this as an “excuse”, I deleted the jail, installed V5 of HA plug-in and went through the process of creating an external dataset detailed in the wiki and, voila, an up-to-date instance of HA with the external dataset I created two days ago. Worked perfectly.

1 Like

It should fail if you originally installed this plugin before August 2020 and did not run a Plugin → UPDATE since. That message means the previous hass setting had not been explicitly set (version 5 is no longer setting those)

Perfect, that’s be the idea!

I’m happy to say plugin version 5 is now installing!

First, let me briefly say (again) what this plugin is and what a plugin update actually means

This plugin provides a scripted installation method to install Home Assistant Core. This is considered an advanced installation method and using this plugin is not an exception. Home Assistant Core is Python application that runs inside the jail, using a Python Virtualenv created during the installation. Updates for this plugin refer to the installation script and files provided in the overlay. Updates to this plugin are not related to updates for Home Assistant Core. Updates for Home Assistant are preformed using the jail’s console. A simple console menu has been provided to help simplify this task. The console menu is provided in the overlay and is an example of something that could be updated in a plugin update.

:warning: This plugin does not provide a fully managed system like Home Assistant OS. There is no Supervisor and addons are not available here.

There will be occasions that require manual intervention!

:information_source: A simple console menu is provided to help with basic tasks

Plugin Version 5 only on TrueNAS Core

  • Focused, Refactored and KISS
  • Support on FreeNAS has depreciated
  • Now with version numbers :smile:
  • Updated wiki with new pages added (still more to come)

Please visit the wiki for more information

1 Like