Home Assistant Core -- TrueNAS CORE Community Plugin

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

So, with the configuration on a separate dataset, not only is it safely separated from the jail but we can now take snapshots as well!

I know snapshots are nothing new for zfs and the functionality is built right into TrueNAS UI already so I’m not sure if worth anything but I thought I’d ask…

Is anybody interested in triggering snapshots from Home Assistant?

I don’t even know how many different ways you can do this already with Home Assistant but I made a simple rest_command and modified this blueprint to configure automations that can trigger it.

It seems like a lot but using a simple script to activate the automation, I can now say “Hey Google, activate snapshot config” and TrueNAS will create a zfs snapshot of my configuration dataset.

1 Like

I’m interested. Having a separate dataset is fantastic, but to have a backup too keeps the critical part more secure.

Well, I was hoping somebody would be interested…

So blueprints will be in the next release…

I’m not applying this in the typical manner so the import function doesn’t work. But of course we can add the file manually.

There’s a few parts to this, I’ve started a wiki page with the first example using a blueprint.

Here’s what the blueprint looks like

I think, I still want to make some changes to the snapshot name that is generated by the automation. Currently, it is not bad, something like

automated_backup_2020.12.11_16.07

But with an additional version sensor we can include the current Home Assistant version that was installed at the time of snapshot. That would look something like

automated_backup_1.0.0b5_2020-12-12_12-31

The main part is only the rest_command. Using the blueprint only one approach to creating automations that use the rest_command. I’ll probably add some more traditional examples to use the rest_command as well

I installed the plug in for HA on my TrueNAS but it crash when middle of installation. Any idea what’s wrong? I have 2 network cards. I chose DHCP during installation.

Hmm, too little information. What is your NAS set up and why two NICs?
TrueNAS requires minimum hardware and jails demand more.

Hello.
Whenever I restart my truenas, the configuration of the mqtt plugin disappears.
I have to uninstall, and reinstall. I’ve tried to follow this procedure and I can’t. My user / pass is casa / casa
How do I do it, so that the user / pass settings are memorized?

Hello Troy, I wonder if you can help again. Since upgrading to TrueNAS 12, I can’t access my USB Z-wave controller. If I list cua* devices, I see cuau0 and cuau1 but no cuaU0 as I did before. I have tried creating a fresh jail using plugin v5 (to check if it was a problem with my upgraded jail) but still no sign of the Z-wave radio device. I have done a dmesg on the host OS and it confirms it is seeing the stick at ugen 0.6. I have tried changing the HA configuration to point to cuau0 but that fails as well. Any ideas?

:thinking: Are you talking about the actual Mosquitto plugin (running in a separate jail)?

  • This case, I’m not sure off hand. I’ll see if I can reproduce the issue for further investigation

Or do you mean your configuration in Home Assistant, for the MQTT integration.

  • This case, my first guess would be a permission error that is preventing Home Assistant from saving the configuration to necessary files

So there are lower case now? That is odd. How does it look inside the jail

iocage console $JAIL
# Press 0 to exit the menu
ls -al /dev
Here's my HUSBZB-1

[email protected]:~ # ls -al /dev
total 10
dr-xr-xr-x  14 root  wheel       512 Dec 15 13:01 .
drwxr-xr-x  19 root  wheel        23 Dec  8 23:37 ..
crw-------   1 root  wheel      0x17 Dec 15 13:01 bpf
lrwxr-xr-x   1 root  wheel         3 Dec 15 13:01 bpf0 -> bpf
crw-rw-rw-   1 root  wheel      0x53 Dec  9 23:13 crypto
crw-rw----   1 uucp  dialer    0x1aa Dec 15 13:01 cuaU0
crw-rw----   1 uucp  dialer    0x1ab Dec 15 13:01 cuaU0.init
crw-rw----   1 uucp  dialer    0x1ac Dec 15 13:01 cuaU0.lock
crw-rw----   1 uucp  dialer    0x1b0 Dec 16 12:05 cuaU1
crw-rw----   1 uucp  dialer    0x1b1 Dec 15 13:01 cuaU1.init
crw-rw----   1 uucp  dialer    0x1b2 Dec 15 13:01 cuaU1.lock
dr-xr-xr-x   2 root  wheel       512 Dec  9 23:13 fd
crw-rw-rw-   1 root  wheel      0x31 Dec 16 12:00 null
crw-rw-rw-   1 root  wheel       0xf Dec  9 23:13 ptmx
dr-xr-xr-x   2 root  wheel       512 Dec 15 13:01 pts
crw-r--r--   1 root  wheel       0x7 Dec  9 23:14 random
lrwxr-xr-x   1 root  wheel         4 Dec 15 13:01 stderr -> fd/2
lrwxr-xr-x   1 root  wheel         4 Dec 15 13:01 stdin -> fd/0
lrwxr-xr-x   1 root  wheel         4 Dec 15 13:01 stdout -> fd/1
lrwxr-xr-x   1 root  wheel         6 Dec 15 13:01 urandom -> random
crw-rw-rw-   1 root  wheel      0x32 Dec  9 23:13 zero
crw-rw-rw-   1 root  operator   0x51 Dec  9 23:13 zfs

Did you previously create the custom_devfs ruleset for pass through? We don’t need that anymore with the TrueNAS plugin. Please try

iocage set devfs_ruleset=4 $jail
iocage restart $jail

I also notice I can lock-up my HUSBZB-1 from time to time. Though, this really only happens if I restart Home Assistant multiple time in row, without waiting several minutes in between. When this happens, I must 1) Stop the jail. 2) Unplug, then re-plugin again the HUSBZB-1 from the USB port. 3) Start the Jail

yea. is the truenas plugin, working separately