[OUTDATED] FreeNAS Plugin: Demo includes Home Assistant + AppDaemon + Configurator

EDIT: Sorry I just re-read your question… Yes you can run docker on FreeNAS but there is NOT a “docker tab” I think you have would have to configure docker manually.

The short answer I think is yes. I’ve only played with docker a few years ago when it first released. Now getting Hass.io running, for example, might not be so straightforward. I’m sorry I don’t have the knowledge to better speak about this. For my current use case docker is just to much overhead. And there is overlap between what FreeNAS already provides and the add-ons provided with Hass.io. For example Samba and ssh are already available and easily configured through the native FreeNAS GUI. I have only briefly looked at trying to get Hass.io running on FreeNAS but at this time it’s just been much easier to get the components (like AppDaemon, Node Red, Mosquitto…) running by themselves. For me it’s just easier to make a new Jail. I have been slowly working on some other scripts make installing these other “add-ons” easier but work is getting in the way

Right, I had the same overlap issues as well and with the docker containers already ready to go it was a simple 2-3 minute install and setup for my first HomeAssistant install with MQTT running.

@digiblur. I know it’s off topic but FreeNAS 11.2 Beta released this week. Have a look here for some new features in the GUI related to docker http://doc.freenas.org/11.2/vms.html#docker-rancher-vms

Ahh… They have to do VMs, guess that’s due to FresBSD? Makes sense now.

Last question lol how did you install Mosquitto Mqtt?

@fvargasfrank I install mosquitto in a separate plugin/jail.

Try this to install as a plugin

wget https://raw.githubusercontent.com/tprelog/iocage_plugings_freenas/master/mosquitto-mqtt.json
sudo iocage fetch -P dhcp=on vnet=on bpf=yes -n mosquitto-mqtt.json

Or if you prefer this is a great example to create and install in a jail manually. Here’s a link that if your interested

Thank you i did manually need to learn anyway lol, do i need to do anything special for it to auto start in case of a reboot or something ?

If you followed all steps you are already good to go! Just fyi this is the exact command that enables mosquitto to auto start on reboot

sysrc mosquitto_enable=yes

Hello Troy,
So yesterday i had a power outage and I’m unable to get Home assistant running, not able to console in the hass-3io, I cant stop it and start it. It gets an IP but home assistant is not running,
root@freenas:~ # iocage console hass-3io
root@freenas:~ #
root@freenas:~ # iocage stop hass-3io

  • Stopping hass-3io
    • Running prestop OK
    • Stopping services OK
    • Tearing down VNET OK
    • Removing jail process OK
    • Running poststop OK
      root@freenas:~ # iocage start hass-3io
  • Starting hass-3io
    • Started OK
    • Configuring VNET OK
    • DHCP Address: 192.168.1.147/24
    • Starting services OK
      root@freenas:~ # iocage console hass-3io

@fvargasfrank I’m not really sure but hopefully I can help figure it out.

What’s the output if you run iocage list -l

It’s weird you cant even get to the console. Since the console is connecting to the plugin OS. Even if homeassistant was completely corrupted or not even installed you should still be able to get in the hass-3io console.

Have you tried restarting your entire FreeNAS system? This seems like something wrong with jail itself not directly a problem with homeassistant

Also just curious what returns if you run this command?
iocage exec hass-3io service homeassistant status

Here are the output
I restarted several time but not luck
I can always destroy it and start clean i dont have much, but dont know if there is something wrong with the script or my system lol

root@freenas:~ # iocage list -l
±----±---------------±-----±------±---------±-----------------±----------------------±----±---------+
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE |
+=====+================+======+=======+==========+==================+=======================+=====+==========+
| 2 | hass-3io | on | up | pluginv2 | 11.1-RELEASE-p11 | epair0b|192.168.1.147 | - | - |
±----±---------------±-----±------±---------±-----------------±----------------------±----±---------+
| 1 | mosquitto-mqtt | on | up | pluginv2 | 11.1-RELEASE-p11 | epair0b|192.168.1.126 | - | - |
±----±---------------±-----±------±---------±-----------------±----------------------±----±---------+
root@freenas:~ #

root@freenas:~ # iocage exec hass-3io service homeassistant status
homeassistant is not running.
True
root@freenas:~ #
root@freenas:~ # iocage console hass-3io root@freenas:~ # iocage exec hass-3io service homeassistant start
Starting homeassistant.
login class ‘daemon’ non-existent, using default
su: pam_start: system error
/usr/local/etc/rc.d/homeassistant: WARNING: failed to start homeassistant
True

So that definitely looks like the jail is up… When you run iocage console hass-3io Do you get to the hass-3io console?

If not can you test iocage console mosquitto-mqtt to see if that works

When i console to the mosquitto it works fine but the hass one does not it just goes back
root@freenas:~ # iocage console hass-3io
root@freenas:~ #

So right there makes me think its the jail. I also have no idea what this is either.

Honestly it’s probably much quicker (probably about 10 minutes) to just backup you config files you’ve edited in homeassistant and just reinstall rather than troubleshooting a broken jail. I can help you do that. It’s very simple and good to know how anyways. Not the best answer I know… but its probably the easiest. I did figure out how to make a plugin but I’m by no means and expert when it comes to the FreeNAS system itself

OK, i will destroy it, i dont have anything but my wink connected to it so nothing special, Once i delete it i will reboot and see if these happens again and will let you know
THank you

@fvargasfrank
If you do choose to reinstall I think this would be better. It will install the same thing but it will be installed a s a jail… not a plugin. As I mention in the OP I don’t fully understand that difference but what I do understand is that a jail is a standalone unit running its applications.


Create a jail using a pkg-list to install requirements

echo '{"pkgs":["bash","ca_root_nss","git","gmake","python36","py36-sqlite3","screen","wget"]}' > /tmp/pkg.json
sudo iocage create -r 11.1-RELEASE boot=on dhcp=on bpf=yes vnet=on -p /tmp/pkg.json -n homeassistant

Note the end of the second command -n homeassistant this is the jail name. You can change it if you want.
For example -n hass-3io


Git script and install

sudo iocage exec homeassistant git clone https://github.com/tprelog/iocage-homeassistant.git /root/.iocage-homeassistant
sudo iocage exec homeassistant bash /root/.iocage-homeassistant/homeassistant-install.sh

Ok i will try it these way now,
Thank you by the way for all the help

This is brilliant, and worked like a charm! Now just need to migrate some of my configuration from a docker install I have running, although will do that manually and try and understand it a little better this time :wink:

This has been working perfectly for the last 22 days, but for some reason today I can’t access the Configurator section. I did update to FreeNAS 11.1-U6 a couple of days ago, so not sure if that’s related. Everything else seems to be working fine. Any ideas where to start looking? Thanks

@adrianwi Hopefully I can help you get this sorted.

First lets check the Configurator is running by connecting to your FreeNAS console (CLI). Typically I use ssh but you can also use the console in the FreeNas web GUI. From there you should connect to the JAIL (Hass-io3) console using:

sudo iocage console hass-3io

Now we can check if the configurator is running with (sudo not needed since you’ll already be login as root)

service configurator status

If the Configurator is running can you access it directly in your web browser (without using the HA GUI)? The Configurator will have the same IP address as HA but is on port 3218 .

If the Configurator is not running can you start manually? What is any output do you get when trying to start manually?

service configurator start

Also what version of Home Assistant is running in your jail? have you updated it at all?
I’m using HA 0.76.2 but I jumped to the FreeNas 11.2 train. I think there might be some needed changes to the HA configuration if your using Home Assistant > 0.77.0 due to the new authentication system.