Home Assistant Core -- TrueNAS CORE Community Plugin

I’ve never gotten that much into appdaemon – It’s probably one of the oldest things on my ToDo list, related to Home Assistant – Anyways, you can use the above commands if you need to work in appdaemon venv for whatever reason - Let me know if you need to install more FreeBSD packages as well ( like Rust )

I might throw in a quick workaround so appdaemon install script works again, but I’m not going to add rust to this plugin – I think this is another case for AppDaemon being moved to its own plugin. – BTW, plugin can share the same dataset. I could make appdaemon still use the same setting so when it’s time to switch over, you just stop the service here. Install AppDaeon plugin / mount your (existing Home-Assistant) dataset and go…

Thanks @troy. I’m very much just starting with AppDaemon myself. hass-apps seems to be running well & your earlier psot to check AppDaemon logs is helping to suss out a couple of errors in my schedy config!

tail -f /var/log/appdaemon_daemon.log

The new AppDaemon plugin sounds really interesting. Just trying to walk before I run right now!

1 Like

By any chance, is there anybody using this plugin that knows about / would be willing to help me with some CI for this plugin ? There is some WIP here – which is my first exposure to using any type CI.

Install status

x

I have some ideas but I have no idea which, if any, are possible and where to begin…

If anybody is willing and able to help, please reach out.

Thanks for sharing this - very helpful. I just did this migration. Was actually pretty painless to do. In fact, the most time in the whole process was spent renaming devices, changing lighting groups etc in Alexa. Getting the zwave part up and running was very easy. The increase in speed over the openzwave setup I was running is very noticeable, so it was definitely worth doing.

But, there are other benefits:

  1. Faster zwave startup following a power down. I also changed the jail start priority of the zwaveJS jail to 1 and HA to 2. Makes startup even faster.

  2. Managing zwave devices is so much easier and more reliable in the zwaveJS plugin admin page than it was in the original openzwave integration, which was slow and sometimes had to be really forced hard to update info, get settings to stick etc. The new interface is a dream in comparison.

EDIT: 3) And this is a big one! No need to completely restart your whole Zwave network whenever you restart HA, and even possibly have to reboot the NAS entirely to get Zwave running again after an HA restart. Wow that used to be such a total PITA!

EDIT 2: I had a strange problem today where, after updating Truenas, the JZwave jail started up but wasn’t connecting to the USB Zwave dongle. It turns that out unplugging it, rebooting Truenas and replugging sorted this out - just in case anyone runs into this. I found that simply rebooting didn’t work.

2 Likes

Troy just to let you and anyone else who may encounter the same problem know:

This problem was solved by moving my jails to an SSD I recently installed in my system. I’ve got one virtual device of 6x 10tb WD red drives which hosts all my files and previously had all my plugins as well. But since moving the plugins to the SSD the problem has completely disappeared.

This makes sense as other plugins I have (eg freenas, Transmission) were sluggish as well and sometimes would just simply stop working. I am not totally sure but I’m guessing the large virtual device I have setup is great for storage but access speed is perhaps a bit slow for certain hardware requirements.

1 Like

Hi all,

I made a fresh install of the Homeassistant Plugin and now I got the same issue as in this Github issue.

The suggested solutions somehow don’t work for me and I don’t now what else I can do to resolve this.

Thanks in advance for any help and ideas!

Hi @zarathir – sorry for the troubles, It seems I’m chasing my tail on this one…

Can you please show a screenshot of post install notes

image

Also what is the out from the following

iocage console $JAIL_NAME
# Press 0 to exit menu 
sysrc -a | grep homeassistant

No worries. Everything else works fine. I just can’t connect with the phone app.
Screenshot_20210303_204121

Here’s my grep output. It’s after trying you’re fix. I’ve also tried reinstalling before changing the homeassistant_path.

homeassistant_config_dir: /home/homeassistant/homeassistant
homeassistant_enable: YES
homeassistant_group: homeassistant
homeassistant_path: /sbin:/bin:/usr/sbin:/usr/bin
homeassistant_python: /usr/local/bin/python3.8
homeassistant_umask: 002
homeassistant_user: homeassistant
homeassistant_venv: /usr/local/share/homeassistant

Thanks for the help

:thinking: – I’ve tried testing a clean install myself, but do not have your errors

There is one thing I can think of… if you are comfortable editing the manifest file manually.

Please try the following from the TrueNAS console

ee /mnt/$ZPOOL/iocage/.plugins/github_com_ix-plugin-hub_iocage-plugin-index_git/homeassistant.json

There are two lines to edit – These are changes I have tested with, but I am still waiting on ix-system merge them to the correct branch so they are not generally available yet

On line 3, to the 12.2-RELEASE

  "release": "12.2-RELEASE",

On line 39, change to the latest packagesite

  "packagesite": "http://pkg.FreeBSD.org/${ABI}/latest",
  • press escape then enter twice to save and exit

After editing the file, please use the following to ensure the latest release is downloaded

iocage fetch 12.2-RELEASE

Finally, after making the above changes, please test another clean install and kindly say if you still have the error. Thanks!

This worked!!

Thank you so much and thank you for maintaining this plugin!!!

1 Like

This post contained information regarding an available Plugin UPGRADE

This post has been removed to avoid confusion with the re-release below

Pretty Neat? I’d say more fantastic work from you for this version of HA.
I just updated/upgraded and panicked when HA would not connect, but waited, as you said, and all good.

1 Like

Plugin UPDATE UPGRADE Available

  • This is a re-release of the previous UPGRADE (2 days ago)
  • This re-release is to fix some issue while attempting to upgrade from version 4

This includes both a Jail UPGRADE and a Plugin UPDATE

Part 1: Jail UPGRADE – FreeBSD 12.2-RELEASE

  • The 12.1-RELEASE reached EOL in January
  • The plugin’s manifest has been switched to the 12.2-RELEASE
  • The packagesite has also been switched from quarterly to latest

Part 2: Plugin UPDATE – Version 6 2021.03.07

  • globally disabled pip-version-check and cache-directory
  • use requirements and constraints during pip install
  • Home Assistant Core will be reinstalled during this Plugin UPDATE

You will need to allow extra time before the Home Assistant UI is reachable after the update is finished


Jail UPGRADE and Plugin UPDATE

In most cases, the following steps hopefully provide a smooth Jail UPGRADE / Plugin UPDATE

Refresh INDEX for community plugins
image

Run Plugin UPDATE from the TrueNAS UI
image

Please allow extra time for the Home Assistant UI to become reachable after the update is finished

Hi @troy

I followed your upgrade steps. But I have some issues with PyNaCl==1.3.0

I get a load of error in HA Log. But this is the error from TrueNas Jail.

INFO:homeassistant.util.package:Attempting install of PyNaCl==1.3.0
ERROR:homeassistant.util.package:Unable to install package PyNaCl==1.3.0: ERROR: Command errored out with exit status 1:
   command: /usr/local/share/homeassistant/bin/python3.8 /usr/local/share/homeassistant/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp3nef5h_m
       cwd: /tmp/pip-install-ntld0152/pynacl
  Complete output (112 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8
  creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/signing.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/__init__.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/secret.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/utils.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/public.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/exceptions.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/hashlib.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/encoding.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  copying src/nacl/hash.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl
  creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/pwhash
  copying src/nacl/pwhash/__init__.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/pwhash
  copying src/nacl/pwhash/scrypt.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/pwhash
  copying src/nacl/pwhash/_argon2.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/pwhash
  copying src/nacl/pwhash/argon2i.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/pwhash
  copying src/nacl/pwhash/argon2id.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/pwhash
  creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_shorthash.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/randombytes.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_sign.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_secretstream.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/__init__.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_generichash.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_hash.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_aead.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_kx.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_secretbox.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_pwhash.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/utils.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_scalarmult.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/sodium_core.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  copying src/nacl/bindings/crypto_box.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.8/nacl/bindings
  running build_clib
  checking build system type... x86_64-unknown-freebsd12.2
  checking host system type... x86_64-unknown-freebsd12.2
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether build environment is sane... yes
  checking for a thread-safe mkdir -p... /tmp/pip-install-ntld0152/pynacl/src/libsodium/build-aux/install-sh -c -d
  checking for gawk... no
  checking for mawk... no
  checking for nawk... nawk
  checking whether make sets $(MAKE)... yes
  checking whether make supports nested variables... yes
  checking whether UID '8123' is supported by ustar format... yes
  checking whether GID '8123' is supported by ustar format... yes
  checking how to create a ustar tar archive... gnutar
  checking whether make supports nested variables... (cached) yes
  checking whether to enable maintainer-specific portions of Makefiles... no
  checking for style of include used by make... GNU
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether gcc understands -c and -o together... yes
  checking dependency style of gcc... none
  checking for a sed that does not truncate output... /usr/bin/sed
  checking how to run the C preprocessor... /lib/cpp
  configure: error: in `/tmp/pip-install-ntld0152/pynacl/build/temp.freebsd-12.2-RELEASE-p3-amd64-3.8':
  configure: error: C preprocessor "/lib/cpp" fails sanity check
  See `config.log' for more details
  Traceback (most recent call last):
    File "/usr/local/share/homeassistant/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/usr/local/share/homeassistant/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/share/homeassistant/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-build-env-xrupu5hq/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 216, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/tmp/pip-build-env-xrupu5hq/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-xrupu5hq/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 253, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/tmp/pip-build-env-xrupu5hq/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 145, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 208, in <module>
      setup(
    File "/tmp/pip-build-env-xrupu5hq/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-xrupu5hq/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "setup.py", line 165, in run
      subprocess.check_call(
    File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/tmp/pip-install-ntld0152/pynacl/src/libsodium/configure', '--disable-shared', '--enable-static', '--disable-debug', '--disable-dependency-tracking', '--with-pic', '--prefix', '/tmp/pip-install-ntld0152/pynacl/build/temp.freebsd-12.2-RELEASE-p3-amd64-3.8']' returned non-zeroexit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for PyNaCl
ERROR: Could not build wheels for PyNaCl which use PEP 517 and cannot be installed directly
Failed config
  General Errors:
    - Component error: default_config - Requirements for mobile_app not found: ['PyNaCl==1.3.0'].

Successful config (partial)
Configuration file: True
Starting homeassistant.
homeassistant is running as pid 6911.

Sorry for the trouble @Kai74. Can you please share the out from?

iocage console $JAIL_NAME
#Press 0 to exit menu
sysrc -a

No worries @troy. :slight_smile:



Warning: settings changed through the CLI are not written to
root@HomeAssistant:~ # sysrc -a
appdaemon_config_dir: /home/homeassistant/appdaemon
appdaemon_enable: yes
appdaemon_group: homeassistant
appdaemon_python: /usr/local/bin/python3.8
appdaemon_umask: 002
appdaemon_user: homeassistant
appdaemon_venv: /usr/local/share/appdaemon
configurator_config_dir: /home/homeassistant/configurator
configurator_enable: yes
configurator_group: homeassistant
configurator_python: /usr/local/bin/python3.8
configurator_umask: 002
configurator_user: homeassistant
configurator_venv: /usr/local/share/configurator
cron_flags:  -J 15
homeassistant_config_dir: /home/homeassistant/homeassistant
homeassistant_enable: yes
homeassistant_group: homeassistant
homeassistant_path: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
homeassistant_python: /usr/local/bin/python3.8
homeassistant_umask: 002
homeassistant_user: homeassistant
homeassistant_venv: /usr/local/share/homeassistant
ifconfig_epair0b: SYNCDHCP
ipv6_activate_all_interfaces: YES
plugin_clean_install_service: YES
plugin_ini: v_0.4.0_20

:face_with_raised_eyebrow: plugin_ini: v_0.4.0_20 - I’m not sure I remember this…

Anyways, it looks like your first install was on v4 – I’m thinking that’s the problem. In plugin version 5, I was just blocking this upgrade completely. – In v6 I’m trying to allow it, but obviously having a hard time.

Let’s use the console here… I’ll try to keep this short

First, let’s reset the version so the update will run through all the steps

iocage console $JAIL_NAME
# Press 0 to exit menu
sysrc plugin_ver=v_0.4.0

Now exit from the jail’s console – the reaming commands are run on TrueNAS (not inside the jail)

iocage fetch 12.2-RELEASE
iocage upgrade $JAIL_NAME

It’s easier to see what’s happening this way. After the packages get reinstall, you should Home Assistant getting reinstalled as well. Hopefully, you do not see the PyNaCl error during this try - If this completes, you’ll still need to allow some time for the Home Assistant UI to become available and your integrations to finish reinstalling.

If this fails, can you test a clean install of the plugin and let me know if the PyNaCl error exists there as well. @ymestechwey faced a similar issue with pytradfri refusing to install – However, it works just fine after doing a clean-install. I have still not been able to figure out what I’m missing in the during the upgrade.

2 Likes

Thanks @troy i am waiting now to connect to HA. The only strange thing i could see during the upgrade is a “million” of this messages

pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed

I am not sure what it is. it looks like the Upgrade ended as expected, but i need to wait to see :slight_smile:
I will get back to you. Thanks a million once more. :slight_smile:

1 Like

just ignore this…

pkg: lua script failed
pkg: lua script failed
pkg: lua script failed

That’s upstream TrueNAS issue…

:crossed_fingers: – We’re actually getting somewhere

Yes i hope :slight_smile: But still not ready… :frowning: patience patience :slight_smile: