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

@skearney First welcome to the forums

Sorry this isn’t working for you. There has been a breaking change to my example configuration file.

Unfortunately, support for the API password has been removed from HA beginning with 0.101 and now the configuration will no longer pass validation.

To get HA running:

If your still having trouble we may need to downgrade to HA 0.100.3 just to get the UI configured. I have had trouble getting HA to start with a clean install after version 0.101 (but I’ve not had time to investigate the issue because of travel for work)

The workaround for now seems to be a downgrade to HA 0.100.3 just long enough to go through initial configuration. Once the HA GUI is up and running we can upgrade again to the latest HA and everything will continue to work.

Sorry for the inconvenience, it will likely be a week or two before I can have time to fix this properly. If you still can not get to the GUI after commenting out the configuration lines as shown above, You can find the steps to downgrade HA HERE

Another question that I cant find the answer too:

I am trying to update to python 3.7 since that is a future requirment, but I get this error when following the above guide:

[root@hass /]# pkg install -y python37 py37-sqlite3 ca_root_nss python3.7 -m ensurepip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'python3.7' have been found in the repositories

Any ideas on how to solve it?

1 Like

Upgrading Home Assistant to use python 3.7

We can’t just upgrade the existing virtualenv. We’ll have to create a new one using python 3.7 and re-install Home Assistant.

First log into the HA jail and stop Home Assistant

iocage console homeassistant
service homeassistant stop

Next we’ll rename the existing virtualenv in case there is any need to restore it later.

mv /srv/homeassistant /srv/homeassistant.old

If you want to just remove the existing virtualenv you can do this instead

rm -rf /srv/homeassistant

With the old virtualenv either renamed or deleted we can proceed to install python 3.7 and create a new virtualenv.

pkg install -y python37 py37-sqlite3
python3.7 -m ensurepip
pip3 install --upgrade pip
pip3 install --upgrade virtualenv
install -d -g hass -o hass -m 775 -- /srv/homeassistant

Now we can switch to user hass , activate the virtualenv and re-install Home-Assistant

su - hass
   virtualenv -p /usr/local/bin/python3.7 /srv/homeassistant
   source /srv/homeassistant/bin/activate
   pip3 install --upgrade homeassistant

There seems to be some bug causing the front-end to not get installed properly.
For now we can get around this by installing it manually.

   pip3 install --upgrade home-assistant-frontend
   deactivate && exit

Finally restart homeassistant

service homeassistant start

Profit!

6 Likes

you are the man!

Thank you very much.

Quick question: will the bash update work after we do this for future updates ?

Thanks again.

Yep! At least it should, if not I’ll fix it so it does :wink:

@troy

I’m trying to use homekit controller component and i’m getting OPENSSL issue with freebsd.

2019-11-11 12:13:47 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
 File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/homekit_controller/config_flow.py", line 251, in async_step_pair
   return await self._entry_from_accessory(pairing)
 File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/homekit_controller/config_flow.py", line 324, in _entry_from_accessory
   pairing.list_accessories_and_characteristics
 File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
   result = self.fn(*self.args, **self.kwargs)
 File "/srv/homeassistant/lib/python3.7/site-packages/homekit/controller/ip_implementation.py", line 73, in list_accessories_and_characteristics
   self.session = IpSession(self.pairing_data)
 File "/srv/homeassistant/lib/python3.7/site-packages/homekit/controller/ip_implementation.py", line 441, in __init__
   c2a_key, a2c_key = get_session_keys(conn, pairing_data, write_fun)
 File "/srv/homeassistant/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 296, in get_session_keys
   ios_key = x25519.X25519PrivateKey.generate()
 File "/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py", line 42, in generate
   _Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
cryptography.exceptions.UnsupportedAlgorithm: X25519 is not supported by this version of OpenSSL.
2019-11-11 12:13:47 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
 File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/homekit_controller/config_flow.py", line 278, in async_step_pair
   start_pairing, self.hkid, self.hkid
 File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
   result = self.fn(*self.args, **self.kwargs)
 File "/srv/homeassistant/lib/python3.7/site-packages/homekit/controller/controller.py", line 374, in start_pairing
   raise AlreadyPairedError('Alias "{a}" is already paired.'.format(a=alias))
homekit.exceptions.AlreadyPairedError: Alias "AF:8C:F3:FD:D0:2D" is already paired.

Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
cryptography.exceptions.UnsupportedAlgorithm: X25519 is not supported by this version of OpenSSL.

Do you have any idea how to update OpenSSL 1.0.2o-freebsd to 1.1.1?

Thanks

@Dario_Lemes_Gonzalez – I’m not 100% certain but try this first.

iocage console homeassistant
pkg install openssl111

@troy,

Already tried that… No luck… Any other ideas?

Thanks

openssl isn’t looking very easy to solve. I don’t have anything homekit so it’s tough for me to test any trouble shooting. I did try going to the integrations and adding “HomeKit Accessory” It looks like any requirements install correctly (at least I get no errors in the logs) and at the end I get a notification “No unpaired devices could be found”.

I just wanted to double check are you sure the error you mentioned is not caused by this:

File "/srv/homeassistant/lib/python3.7/site-packages/homekit/controller/controller.py", line 374, in start_pairing
   raise AlreadyPairedError('Alias "{a}" is already paired.'.format(a=alias))
homekit.exceptions.AlreadyPairedError: Alias "AF:8C:F3:FD:D0:2D" is already paired.

I’m asking because I don’t know if it will possible to make the upgrade to openssl.

Even after pkg install openssl111 – we are still getting this:

# openssl version
OpenSSL 1.0.2o-freebsd  27 Mar 2018

Then I found the thread below, which mentions there is no way to change base version of openssl. I suspect something very similar. The solution in this thread was to install openssl111 and then configure/install the app from ports with openssl111 enabled.

In your case though I’m guessing the homekit setup is expecting openssl version == 1.1.1 but to get that would mean changing the base version but that seems not possible. Only option might be having to wait for FreeNAS 12

Have a look at this. I think it’s very close. For this one you may have better luck making a seperate post in the FreeNAS forums.

I’ve reseted the device homekit and same errors. Factory resetted device and same issue.

Have a look at this. I think it’s very close. For this one you may have better luck making a seperate post in the FreeNAS forums.

Already did… no luck… any other ideas not to wait for freebsd 12?

Thanks

Maybe you can trick it using an alias

iocage console homeassistant
echo "alias openssl /usr/local/bin/openssl" >> /.cshrc
logout
iocage restart homeassistant

After following this guide I cant access my frontend even after followig your guide to install it…

I get the following in my log:

2019-11-12 22:37:44 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=97 from 2019-11-12 21:35:57.982509)

I tried to follow the guide two times, but still same result, same error message in log.

EDIT: Found this now: link that solved it

Hi Troy,
Firstly, thanks for your efforts in providing this info - great work. I just followed your scripted install and for me the front end GUI is fully accessible. However, there’s one thing in your instructions that isn’t totally clear to this complete noob. I’m trying to do the USB Z-wave passthrough. I’m stuck at the last step as I have no idea how to point my start-up script to the custom dev file. I can see the custom ruleset file in my root directory, but the Freenas console won’t let me point to it to create the script (“a file is required”). Probably a really noob question but what is the correct file path to this?

Worked perfectly. Thanks for the guide and for keeping it current!

No luck… same issue

2019-11-13 19:56:33 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/homekit_controller/config_flow.py", line 251, in async_step_pair
    return await self._entry_from_accessory(pairing)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/homekit_controller/config_flow.py", line 324, in _entry_from_accessory
    pairing.list_accessories_and_characteristics
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homekit/controller/ip_implementation.py", line 73, in list_accessories_and_characteristics
    self.session = IpSession(self.pairing_data)
  File "/srv/homeassistant/lib/python3.7/site-packages/homekit/controller/ip_implementation.py", line 441, in __init__
    c2a_key, a2c_key = get_session_keys(conn, pairing_data, write_fun)
  File "/srv/homeassistant/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 296, in get_session_keys
    ios_key = x25519.X25519PrivateKey.generate()
  File "/srv/homeassistant/lib/python3.7/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py", line 42, in generate
    _Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
cryptography.exceptions.UnsupportedAlgorithm: X25519 is not supported by this version of OpenSSL.
2019-11-13 19:56:33 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/homekit_controller/config_flow.py", line 278, in async_step_pair
    start_pairing, self.hkid, self.hkid
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homekit/controller/controller.py", line 374, in start_pairing
    raise AlreadyPairedError('Alias "{a}" is already paired.'.format(a=alias))
homekit.exceptions.AlreadyPairedError: Alias "16:FB:9A:AB:25:09" is already paired.

Thanks

hi troy, I’m having issues setting up the mosquitto service. I’m using some led lights through a arduino and the mqtt settings require a username and password. I’ve gotten this to work through vm based hass.io but i can’t figure out how to add usernames and password fields through the mosquitto.conf

Edit: i somehow got it to work by editing the mosquitto.conf and directing it to pull passwords from pwfile.

Please can someone help me fix my issues with adding the Zwave USB stick? HA is running on Freenas, if i SSH into it and use the command ls -ltr /dev/tty*|tail -n 1, it reports the following for my USB stick (it’s from zwave.me):
crw------- 1 root wheel 0x50 Nov 22 12:05 /dev/ttyv0

However, if I try to add the Zwave integration in the HA GUI and replace the default path (/zwaveusbstick) with /dev/ttyv0, it just reports the error “Z-Wave validation failed. Is the path to the USB stick correct?”

Can someone help please?
Thanks.

@axg20202

Two suggestions

  • Actually your z-wave stick is likely /dev/cuau0.
  • I’ve had problems with the automatic z-wave integration in the past

I’m not always a fan of these automatic discovery integrations, sometimes they give me headaches. I usually add thing to my configuration the old way. Everything works much better that way and zwave is no exception. If you remove the automatic integration and setup zwave to your configuration.yaml, you may have better results.

Here’s my zwave entry for configuration.yaml.

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

I don’t know if you already have or even need a network_key but just in case… I used the following command from inside the jail (won’t work from FreeNAS host) to generate my network_key.

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

Troy, you’re a scholar and a gent! I thought I’d just try the USB stick address you mentioned in the automatic integration and it added it no problem and the zwave network appears to be running. Thanks very much for your instant help! Strange that the address isn’t being reported properly from the console.
Regarding auto integration vs manually adding it to the config, not sure how to proceed here. I’ll give the manual setup a try. Thanks again.

1 Like

If the automatic integration is working you can stick with that. If you run into any errors during your initial zwave setup try the manual configuration