Home Assistant Core -- TrueNAS CORE Community Plugin

I’d like to only include one version of Python with the plugin but I can’t really ensure that configurator and appdaemon will always be compatible with Home Assistant python requirement.

It’s been over a year since I’ve used it last so I don’t have anything to test 3.10 functionality.

Any chance you’ve updated the virtualenv for appdaemon as well ?

Not yet, I’ll try to do it when I find some free time. Appdaemon is not maintained at fast pace so I had no pressure for that.
Btw, I’ve just checked the documentation and it says it works with python from 3.7 to 3.9 So it might not actually work with 3.10 (yet)

I might have something different in mind now anyways… I think I’m gonna just take python off the plugin manifest all together. Instead I’ll install it from the post_install.sh script. And I’ll just install a needed versions for Appdaemon and Configurator only if they’re getting installed. For those having luck with the Plugin Updates, I’ll check for enabled services and reinstall whatever version of python is set in the respective rcvar during the post_update.sh

1 Like

Small update. Cloning a jails is a nice idea but there is one caveat: the clone is dependent on the source jail (the file system is a writable snapshot) which means that if the source is destroyed the clone as well… I’ve just learned it the hard way… It can be worked around by demoting the source and promoting the clone to become the master after which the source can be safely deleted.
https://iocage.readthedocs.io/en/latest/advanced-use.html
Good I have the config directory in a separate dataset… And I’m now testing installation of the updated plugin :slight_smile:
So far installation went fine, waiting for the first start of ha:

Testing virtualenv...
  /usr/local/share/homeassistant
  Python 3.10.5
  Home Assistant 2022.7.7
1 Like

Speaking of updated plugins…

Nothing groundbreaking here really just FYI for those who follow along… I made my PRs straight to the release branch for each TrueNAS version so the changes went live immediately upon merge.

Oh and my plugins on TN 13 should now be using the 13.1-RELEASE

Yes, HA does. Installation went smothly and now my HA is back without loosing anything. What a relief :slight_smile:
@troy many thanks for your continued support for an unsupported plugin!

1 Like

Looks like we have first component coming with 2022.8 release not compatible with FreeBSD. Bluetooth is based on some libraries requiring Linux. Not sure if there is a way to have some FreeBSD port.

2022-08-03 16:13:52.220 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component homeassistant.components.bluetooth
Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 638, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/share/homeassistant/lib/python3.10/site-packages/homeassistant/components/bluetooth/__init__.py", line 14, in <module>
    from bleak import BleakError
  File "/usr/local/share/homeassistant/lib/python3.10/site-packages/bleak/__init__.py", line 81, in <module>
    raise BleakError(f"Unsupported platform: {platform.system()}")
bleak.exc.BleakError: Unsupported platform: FreeBSD

Personally I’m not using it so I have replaced the default_config: entry from configuration.yaml with listing all needed integrations explicitly (without the bluetooth).

Well this is an unfortunate turn of events…

I never thought I’d be disappointed to see an integration added to Home Assistant. It’s unfortunate the devs decided to block a feature request that would have allowed us to just disable Bluetooth.

I’ll try to have a look after work and see if there is anything we can do on FreeBSD side of things. Maybe install a new dependency or something but honestly I’m not very optimistic. I’m pretty sure a few people have tried to get Bluetooth working with this plugin in the past but had no success.

I don’t know if there is going to be a feasible work around for this one… I don’t think I can realistically maintain an updated configuration to work around the default config :frowning_face:

EDIT: A quick search on the TrueNAS forums seems to indicate this is not going to be possible. Most post are fairly old, this being the most recent.

Blah… This is stupid but it’s the best I can do for now.

You’ll need to make these changes manually to your existing configuration.yaml

1 Like

Many thanks, that’s probably the best way to address it.
As expected, at some point in time there will be something that will cause HA not to work on TrueNAS anymore… Hope I’ll move to Scale or to a different platform with HA by that time :slight_smile:

I don’t know if this is going to work like we thought…

I made changes and quickly tested with an existing plugin, everything seemed fine but I noticed the CI test has now failed installation two nights in a row. Today I fired a VM with TN CORE so I could investigate. Looks like the install is missing a bunch of basic python modules now.

Still trying to get something working but things aren’t looking good…

UPDATE 1

OK, seems like this works for reinstalling the virtualenv

 service homeassistant reinstall homeassistant SQLAlchemy fnvhash

I don’t know why the additional modules aren’t installing automagically like before.

UPDATE 2

Plugin clean install is working again… for now.

I think moving forward the additional python modules will need to be included if you reinstall


Yea - Probably best to do this sooner than later

1 Like

Let me know if I could help somehow with testing

Thanks! It’s much appreciated but I think we’re good… at least till the next release :rofl:

1 Like

I may have look at a migration to Scale too, seems my Core (12) setup may have had it’s run.

The other week I tried to update from 2022.7.7 to 2022.8, took a while on orjson I think it was eventually looked like everything finished and I went on my way. Went to update to 2022.8.1 and getting dependency errors and install wouldn’t complete.

I checked the HA info and realised I was still on 2022.7.7. Haven’t had time to look into it but at least it didn’t break my set up.

I don’t think it’s going to get any easier going forward so guess my time would be better spent looking into Scale. Apart from HA, Node-Red, MySQL, Unifi Controller, OpenVPN and reverse proxy jails so hopefully shouldn’t be too hard.

FYI

2 Likes

Thanks for sharing. This is just another proof, that we should be moving to a supported installation. HA is getting more and more complex and they won’t spend any time supporting us.

1 Like

:warning: In light of recent changes to Home Assistant, I’ve decided to have this plugin removed from TrueNAS CORE. As Home Assistant continues to grow and add new features, installation on FreeBSD no longer “just works” as it had for so many years in the past. I will leave the plugin’s artifact repo on GitHub for those who wish to continue trying to use it or add the files to a regular jail. However, I can not leave this so easily accessible when Home Assistant’s own default configuration no longer works as expected.

Removing the “plugin” from TrueNAS CORE simply means it will no longer show up in the community plugin list, effectively removing the install button. Existing plugin installations will continue to work and can be managed as a regular jail.

1 Like

Hi @troy - nightmare! I’ve been putting off the inevitable for quite a while now having used your TrueNAS Core plugin successfully for a number of years. Thank you so much for all of your work. Home Assistant along with your AppDaemon plugin and your guide to running with an external dataset for back-up purposes has give me everything that I needed
What is your preferred way of running Home Assistant within a TrueNAS environment? I’m happy to change to TrueNAS Scale if required, but want to be as ‘future-proof’ as possible whilst having a robust back-up method.
Do you suggest the official Scale plugin, or do you prefer running a Docker instance within a VM (hence giving a Supervised install)? My thoughts are that by having a Supervised install I could add a number of other components (Grafana, InfluxDB, Mosquitto etc) within that installation, hence reducing the need for additional Jails/Plugins/VM’s.
I have a second trial server that I tested Scale with, but I struggled with the networking having Docker containers within a VM.
Unfortunately another complication that I have is that I’m running the old legacy encryption on my hard drive, so there will be a certain amount of pain transferring all of my files off and then back on the the server once the hard drive Datasets are recreated…
I also have additional jails running within Core at the moment (Unifi, Octoprint, Duplicati, ESPhome, TasmoAdmin etc), which I would need to get running too.
What would be your suggestion?

1 Like

If I may, I’ll share my very recent experience. After running HA and all other home automation components (zigbee2mqtt, zwavejs2mqtt, Marian, gardena etc) I have moved HA, appdaemon and esphome (a bit earlier) to docker (compose) running on very lightweight Debian 11 on a low power mini PC. It is one of the two mostly recommended install methods so it should be future proof. Migration was super easy. The pc takes 7W of power on average. For now I kept all other components on TrueNAS Core, so far no urgency to move it out and the DB will benefit from much more powerful hardware.

1 Like

OK. Ideally I was after keeping it all on one PC (the server’s running 24/7 anyway). Out of interest, what are the specs of your mini PC?