Home Assistant current state on CORE.

powermi

Cadet
Joined
Feb 25, 2023
Messages
3
Hi there. I'm looking forward to use a home assistant on my Truenas server, for years I've run CORE and would like to stick with it as long as I can't, but recently I've read that the FreeBSD port of Home Assistant is no longer supported, so I'm wondering if I better go with SCALE? I would like to hear from users running it on CORE using other protocols like mqtt, Zigbee or Zwave dongles and so on.
Thanks.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
It depends on much time and effort you want to spend keeping everything working - the amount of effort and your success will depend on which / how many integrations you plan to use in Home Assistant. On FreeBSD, not every integration will work as expected, and Bluetooth, for example, will never work. What's challenging, any request for help will likely be shut down with "FreeBSD is not supported."

Mosquitto is maintained in the standard FreeBSD package repo, so that one is easy.

ESPHome (you did not mention, but it's common) is almost impossible on FreeBSD unless you know to compile custom ports.

I used ZigBee / Z-Wave with the HUSBZB-1 a few years ago - My experience with ZigBee was short, and I only tried HA's built-in ZHA. I eventually settled on Z-Wave and switched to the Aeotec GEN 5 Z-Stick (I've used both Gen 1 and Gen 2 versions in jails) - In my final year of using TrueNAS CORE, there was a plugin for zwavejs2mqtt (now zwave-js-ui) and zigbee2mqtt. Plugins are not highly recommended, but one advantage they offered was automatic USB passthrough.

As far as I know, home assistant, zwave-js-ui, zigbee2mqtt, tasmoadmin, and node-red should all work if installed in a regular jail.


I can't say that you should switch to Scale just because of Home Assistant, but you will likely have a better experience if you do. I'm not much of a fan of the Scale apps for Home Assistant, but that is because of my lack of knowledge regarding Kubernetes and how to configure HA the way I want.

I was against HAOS for many years but decided to give it another try when Scale 22.12.0 added (easier) USB passthrough to the VMs. It took a little getting used to, but I don't see any reason to switch away now. While I don't mind the more hands-on approach of other installation methods, I've grown to love the appliance nature of HAOS - especially when I'm busy working and don't have time or energy to maintain things myself.
 

powermi

Cadet
Joined
Feb 25, 2023
Messages
3
Thanks for the reply. For the moment I'm gonna stick with Zigbee and was considering after reading some post to move to SCALE anyway. But what makes you use the VM instead the container? just the HACS?
On the container you can also pass the USB ports as needed.
BTW even if I'm late.. your work maintaining the it on FreeBSD was amazing,
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
We run a Ubuntu VM with Home Assistant on CORE. Only WiFi/LAN based connections, though. No Bluetooth. Factory new Shelly products present their own access point to connect to the UI. Then you enter and apply the proper WiFi parameters for your IoT network. Done.
 

powermi

Cadet
Joined
Feb 25, 2023
Messages
3
We run a Ubuntu VM with Home Assistant on CORE. Only WiFi/LAN based connections, though. No Bluetooth. Factory new Shelly products present their own access point to connect to the UI. Then you enter and apply the proper WiFi parameters for your IoT network. Done.
Thanks for the suggestion, also looks as a great way to stay on CORE.
 

ding0k

Cadet
Joined
Mar 8, 2022
Messages
2
We run a Ubuntu VM with Home Assistant on CORE. Only WiFi/LAN based connections, though. No Bluetooth. Factory new Shelly products present their own access point to connect to the UI. Then you enter and apply the proper WiFi parameters for your IoT network. Done.
I do this as well. But, recently have been experiencing a weird lockup. When it happens, bhyve runs over 4 cores and turns my box into a jet engine. Do you have this issue?

I've been hacking around trying to get it running in a jail this week, reading all @tprelog 's work, and trying to decide whether to move to scale. Yuergh.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
I have zero experience using bhyve - hopefully, someone knowledgeable can help get your current setup back in check without reinstalling.

It's been almost a year since I last tried creating a Home Assistant jail, but if you have questions about the installation process, I may still be able to help.

If you ultimately decided on switching to HAOS on SCALE - This post might be helpful. The biggest issue I know of is USB passthrough, specifically for the ConBee II ZigBee USB Stick. It seems hit or miss for most people; solutions to get it working can seem hacky and are not guaranteed. As I understand, the ConBee II needs to be passed into the VM as a serial device. Known solutions are using a script to start the VM or using PCI passthrough of the USB hub to which the ConBee is connected.

I have no experience using the Home Assistant "Apps" also available on TrueNAS Scale
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
We run a Ubuntu VM with Home Assistant on CORE. Only WiFi/LAN based connections, though. No Bluetooth. Factory new Shelly products present their own access point to connect to the UI. Then you enter and apply the proper WiFi parameters for your IoT network. Done.
How did you manage that?

The HAOS files are all for KVM and others, but not bhyve.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Install a stock empty Ubuntu in bhyve, install Docker, then proceed to install Home Assistant.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973

For anyone wanting to run it in Core as a VM, you can follow these instructions up to the last one. The difference is that the commands had to be run from a jail. That way you can install the FreeBSD version of qemu-utils, called qemu-devel

And for the last command I used dd to write the raw image from inside the jail storage to the zvol I created.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
@tprelog

Out of curiosity, could you assist me in answering a few questions? I am working on an automated script to get home assistant installed with caddyserver, but I'm having some issues.

When using your RC Service Script, everything seems to run and install fine, but i cant reach the UI. It says 404: not found. I have gotten it to work using this guide: https://dan.langille.org/2022/08/27/getting-home-assistant-running-in-a-freebsd-13-1-jail/

But as you can see, the last command never stops running. This is supposed to happen BTW. He even says so. He has basically copied your RC script and just modified to not run the install commands and reinstall commands. His commands work though, and i would like to integrate them into the RC script as well.

When the last command has basically finished running, I can add the RC script to rc.d, and use service homeassistant start to start the service.

I understand if you haven't got the time or interest to help, since freebsd is not a supported installation method.
Thanks.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Hi @victort - I would try to help if I can, but I'm unsure what you're asking.

Do you need help installing Home Assistant?
Are you looking for another RC script to run Home Assistant?

I'm not sure what you need exactly, but I had some time this afternoon, so I tried installing Home Assistant in a 13.1-RELEASE jail. I no longer recommend this, but I've updated the following guide if you're determined to try maintaining an installation like this. Remember, you'll need to reinstall Home Assistant yearly as the required Python version increases.



After I started the service, it was 3-4 minutes before I could reach the UI and begin onboarding. It took another 10 minutes for everything to finish installing and for discovered devices to all show up.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hi @victort - I would try to help if I can, but I'm unsure what you're asking.

Do you need help installing Home Assistant?
Are you looking for another RC script to run Home Assistant?
Great, thanks. I have done a bit of searching about python, pip, etc… and will try this.
I'm not sure what you need exactly, but I had some time this afternoon, so I tried installing Home Assistant in a 13.1-RELEASE jail. I no longer recommend this, but I've updated the following guide if you're determined to try maintaining an installation like this. Remember, you'll need to reinstall Home Assistant yearly as the required Python version increases.
Thanks for the reminder.


After I started the service, it was 3-4 minutes before I could reach the UI and begin onboarding. It took another 10 minutes for everything to finish installing and for discovered devices to all show up.
I don’t mind the reinstall. I’d just like to have an instance without the overhead of a VM. Eventually I might move to that, but for now I don’t need much.
 

SaltyCoffee

Dabbler
Joined
Nov 6, 2021
Messages
46

For anyone wanting to run it in Core as a VM, you can follow these instructions up to the last one. The difference is that the commands had to be run from a jail. That way you can install the FreeBSD version of qemu-utils, called qemu-devel

And for the last command I used dd to write the raw image from inside the jail storage to the zvol I created.
Hey thanks for the tip. Would you be able to share the dd command you used? I'm having trouble spinning up the VM after dd'ing it over to the zvol (won't start). I can only guess that simply using the base if and of inputs isn't enough? If it matters I'm running dd from the main TN shell, cuz the jail had no access to the zvol.

Here are the commands I used. From within the jail:
Code:
qemu-img convert -O raw haos_ova-10.5.qcow2 ./HAOS

From the main TN shell:
Code:
dd if=/mnt/Tank/iocage/jails/HAOS/root/root/HAOS of=/dev/zvol/Tank/HAOS
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hey thanks for the tip. Would you be able to share the dd command you used? I'm having trouble spinning up the VM after dd'ing it over to the zvol (won't start). I can only guess that simply using the base if and of inputs isn't enough? If it matters I'm running dd from the main TN shell, cuz the jail had no access to the zvol.

Here are the commands I used. From within the jail:
Code:
qemu-img convert -O raw haos_ova-10.5.qcow2 ./HAOS

From the main TN shell:
Code:
dd if=/mnt/Tank/iocage/jails/HAOS/root/root/HAOS of=/dev/zvol/Tank/HAOS
You have two ‘root’ in there.

I recently did this again, and here are the commands I used. They differ slightly...

Code:
wget https://github.com/home-assistant/operating-system/releases/download/10.5/haos_ova-10.5.qcow2.xz
unxz haos_ova-10.5.qcow2.xz
pkg install qemu-devel
qemu-img convert haos_ova-10.5.qcow2 haos.raw
dd if=</mnt/pool/iocage/jails/haosjail/path/to/raw/file.raw> of=</dev/zvol/pool/path/to/zvol>


It might take 5-10 minutes to write the file using dd
 

SaltyCoffee

Dabbler
Joined
Nov 6, 2021
Messages
46
You have two ‘root’ in there.
One's the root of the jail, and the other is the root home folder where I wget'd the image

I recently did this again, and here are the commands I used. They differ slightly...
Thanks for confirming that for me. I'm thinking now it's a problem with virtualization in general now cuz a fresh blank one won't start either.

It might take 5-10 minutes to write the file sing dd
Yeah it does haha

Anyway thanks for the input!
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
One's the root of the jail, and the other is the root home folder where I wget'd the image
There should only be one root in the path is what I mean.
Thanks for confirming that for me. I'm thinking now it's a problem with virtualization in general now cuz a fresh blank one won't start either.
I don’t think so. It’s working fine for me.
Yeah it does haha

Anyway thanks for the input!
Does the command finish running? What is the output?
 

SaltyCoffee

Dabbler
Joined
Nov 6, 2021
Messages
46
There should only be one root in the path is what I mean.
If you're in the home folder for the root user of a jail from the main shell, you'll see 2 roots...

1693168988913.png


I don’t think so. It’s working fine for me.
Yeah something's gone sideways in my server regarding virtualization. Not seeing anything useful in the messages log either

Does the command finish running? What is the output?
Yeah all of the stuff relating to the guide works fine (without error). Just can't start the VM after. The weird thing is empty VMs worked fine before I dd'd the image over the first time. Probably a coincidence but damn.....
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
If you're in the home folder for the root user of a jail from the main shell, you'll see 2 roots...

View attachment 69734


Yeah something's gone sideways in my server regarding virtualization. Not seeing anything useful in the messages log either


Yeah all of the stuff relating to the guide works fine (without error). Just can't start the VM after. The weird thing is empty VMs worked fine before I dd'd the image over the first time. Probably a coincidence but damn.....
Maybe try first just copying the .raw image out of the jail first, the doing the dd from there.
 
Top