My (outdated) Quick Start for Home Assistant Core on FreeNAS 11.2

Hello @angyp74 Welcome to the forums

For the PyNaCL there are two ways to solve this.

Please try this first. Using this approach should help avoid /.cache permission errors moving forward

  • remove the /.cache folder
  • recreate /.cache as a link to /home/hass/.cache with owner set to hass
iocage homeassistant
rm -rf /.cache
install -l s -g hass -o hass -m 700 /home/hass/.cache /.cache
service homeassistant restart

If that doesn’t work the fall back method that has always worked in the past with any /.cache permission error is to install manually.

iocage console homeassistant

su - hass
source /srv/homeassistant/bin/activate
pip3 install --upgrade PyNaCl
deactivate && exit


Unfortunately I do not have any guess about the ssl error right now… Maybe after PyNaCl install is will go away. If not let me know and I’ll try to investigate further.

Thanks, Troy,

That worked. I actually found your second bit of advice on a freenas forum late last night and used it. The SSL errors are still occurring but reading the message make me think it’s receiving http request on the SSL port.

ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1056)

@troy,

Any other ideas how to upgrade or overcome SSL issue. I’m still unable to manage my Ecobee Switches (homekit controller needed) and it’s failing on registration due to SSL issue.

Thanks

Sorry no. From my understanding it’s not possible to upgrade the “base” BSD that is used when creating jails and the jail can not run a newer “base” version than the host. I’ve discovered this seems to be an ongoing issue for FreeNAS, it’s always been this way and likely always will. :frowning: (I mean FreeNAS is usually behind the actual FreeBSD from which it’s based on. For example we are waiting for an update to FreeNAS 11.X but FreeBSD is actually on 12.X - In other words new FreeNAS is not even released yet and it’s already outdated in BSD terms)

You do have a few options but they not likely to be what you had in mind.

  1. FreeNAS 11.3 Beta 1

  2. Switch to Hassio on FreeNAS

Personally I have no plans of switching to Hassio but I did follow @Koen’s link to give it a try. I was able to successfully get Hassio running using a VM in about 20 min.

This has been working perfectly for me for some months, with fairly infrequent updates. I think my last update to 0.102.3 has broken the mobile integration which now uses mobile_app: in the configuration.yaml.

With this added, I get the following error when checking the configuration:

Component error: mobile_app - Requirements for mobile_app not found: ['PyNaCl==1.3.0'].

Anyone had a similar problem and found a fix?

Thanks

I think you can just install PyNaCL manually

Starting from your FreeNAS console

iocage console homeassistant

su - hass
source /srv/homeassistant/bin/activate
pip3 install --upgrade PyNaCl==1.3.0
deactivate && exit

Finally restart Home Assistant

1 Like

Perfect. Thank you!

1 Like

Hi Troy. I spoke too soon. I was using the auto zwave component integration and my Zwave USB stick was showing up as a node in the Zwave configuration, so I assumed all was well. However, I finally got around to trying to add a Zwave device and it just wont pair. So, I decided to remove the auto integration as you suggested and add it to the config file manually. Now the USB stick doesn’t show up and the zwave configuration options in the UI aren’t available. I tried to generate a network key using the command from inside the jail but I get an “illegal byte sequence” error, so I can’t generate a code, but not sure it’s needed. It seems the manual addition of the zwave stick isn’t working. Any idea what could be wrong?

Sorry, I think that’s my fault. I copied this from old configuration.
I had python3.6 but it should be python3.7. Try this (I will also fixed this in my previous post)

zwave:
  network_key: !secret zwave_key
  usb_path: /dev/cuaU0
  config_path: /srv/homeassistant/lib/python3.7/site-packages/python_openzwave/ozw_config

Are you 100% certain you are actually in the jail. This is the exact error shown when I try to run the command on the FreeNAS host. For additional clarity, I have this time included the first command to ensure we’re operating inside the jail. Please try the following.

iocage console homeassistant
cat /dev/urandom | tr -dc '0-9A-F' | fold -w 32 | head -n 1 | sed -e 's/\(..\)/0x\1, /g'

You don’t have to have a z-wave key but I think It’s strongly preferred that you do. The z-wave key is required to secure you z-wave network and it is likely required by any kind security device. Also you need to follow the docs when adding devices to your controller.

EDIT Reading through the docs myself (It’s been awhile) I see this has been added

Secure devices require additional bandwidth, and too many secure devices can slow down your Z-Wave network. We recommend only using secure inclusion for devices that require it, such as locks.

Thanks Troy - that enable me to generate the key (zwave_key: 0x37, 0xD5, etc placed in secrets.yaml), but the integration still isn’t working. The Zwave USB isn’t showing up as a node on the Zwave config page

:thinking: Let’s be sure the controller is showing up in the jail its self

What is the output from this command?

iocage console homeassistant
ls -al /dev/

The z-wave will show as cuaU*

I have the HUSBZB-1 USB Hub which is both z-wave and zigbee.

image

Thanks Troy - it’s definitely there. I get the same output as your pic. I find that I can add the USB stick using the auto-integration menu and entering the usb destination as /dev/cuaU0. If I remove this integration and do it manually in the config file, it doesn’t get integrated.

That’s really weird. Are there any errors in the log?

What if you leave Z-wave in your configuration but try commenting out the path and the config like this.

zwave:
  network_key: !secret zwave_key
  #usb_path: /dev/cuaU0
  #config_path: /srv/homeassistant/lib/python3.7/site-packages/python_openzwave/ozw_config

Do you get any errors in the log now?

Hi, there. Just starting on my HA + FreeNAS journey, and I arrived here from a google search.

However the same Google search also led me to https://www.home-assistant.io/docs/installation/freenas/

This thread seems more comprehensive, but the official docs aren’t abandoned as they seem to be regularly updated.

Just curious what the substantial differences are, if any?

When I wrote this guide the official docs were outdated, did not uses a virtualenv and ran HA as root. Recent updates to those docs have brought them more in line with this guide.

The main differences between my guide and what’s included in the official docs are personal choices and really have no effect on the end result of running Home Assistant.

Difference - This Guide - Official Docs
User Name - hass - homeassistant
Install Dir - /srv/homeassistant - /usr/local/share/homeassistant
Config Dir - /home/hass/homeassistant - /home/homeassistant/.homeassistant

Otherwise this guide is just more in-depth

1 Like

Thank you!

Why can’t software be like my music collection and only update a little every 5 years?

1 Like

Hi Troy,
I ran your Node-RED script to install into a new jailplugin. I also un-commented the panel iframe entry in your example config file to get the Nod-red icon to show up in the sidebar in HA. This gets me to my node-red instance, but node red isn’t seeing any of my HA entities as it isn’t integrated with HA. Pretty much every post on this subject seems to be about using the hass.io add-on. Any tips on how to get this working?

Thanks,

Andy.

Hi @axg20202
Node-RED is just a generic plugin for FreeNAS (I guess not everyone uses HA) so there is nothing for HA configured by default. Honestly learning Node-RED is still on my ToDo list.

EDIT

I found it! After NR is installed I followed this video to configure with HA

Video should start about 1 minute in…

Great. Thanks very much. Will check it out.

I’m working on some updates to this guide for the upcoming FreeNAS 11.3

  • manual install guide - same as it ever was, maybe slightly expanded
  • script install - a scripted version of the manual install guide
  • plugin install - new easy button for a basic script install

Nothing groundbreaking but if you’re thinking about a fresh install this might be worth a shot.

spoiler alert

I think that should be fun for most people who want to follow this guide in the future. :slightly_smiling_face:

1 Like