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

Hi @troy

I have no clue what I am doing wrong, but I will try again. maybe my entire jail is set up wrong. I will contact you via message, to prevent flooding this threat with unnecessary replys.

But to respond to your question:

Did you have to do this inside the jail or on FreeNAS?

It was on the FreeNAS itself, not inside a jail.

Cheers

@Koen is this the line you had an issue with

sudo iocage fstab -a homeassistant "/mnt/tank/user/hass /home/hass nullfs rw 0 0"

if so then you had the same issue I had

either way I’d say trouble shooting the scripted install is much easier then attempting the manual one. I ran through the scripted version 3 or 4 times and @troy was very helpful in getting me through it.

@troy and @Skeletor

Hi, I just tried to do it again, after deleting the whole iocage dataset (meanwhile installed nextcould before retrying) It worked like a charm. Now I had no issue at all.

Thanks for your time and your effort of making a manual like this!!

Cheers!

1 Like

Hi,

I just want to say that I did use another totally different approach. I saw, when I installed this build, that it is not like Hass.io which I really like. It was very convenient to use and setup additional services like Mosquitto, Samba share, DuckDNS with Let’s Encrypt for access from outside.

An excessive search led me to this post which uses a Virtual Machine inside Freenas. It was just like a Raspberrypi and in 4 hours I had everything working. (From no VM to a hassio VM and ported everything from my in-use RPI to the new VM).

Maybe this is also more suitable for other people.

Cheers,
Koen

Is anyone else using the Neato integration. It broke after 0.96.5 due to locale issues. I skipped updating until the bugs were closed.

I just tried updating again to 0.100.2 and the same neato locale issue is still present. The locale in the hassassistant jail was “C” and for user hass was “C”. It is easy enough to set root with setenv LANG en_US.UTF-8. I may end up trying this

for the hass user. I’m not sure if that will survive upgrades though. There has to be a better solution to fix this issue. It has not gone away.

I posted the main message in another thread:

Thought I would ask the FreeNAS people here. I posted the whole error in the other thread, but provide a small portion below.

I did my install using the instructions here:

I had an error trying to setup zwave.
Running HA Version: 0.100.1

ERROR: Command errored out with exit status 1: /usr/local/share/homeassistant/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ox3vb57p/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/share/homeassistant/include/site/python3.7/homeassistant-pyozw Check the logs for full command output.
Failed config
  General Errors:
    - Component error: zwave - Requirements for zwave not found: ['homeassistant-pyozw==0.1.4'].

Thanks

Just for record I got it working posted what I did in the other thread, since I was getting some responses there.

Followed all the steps of “iocage standard-jail – Scripted Install” to detail and after everything completed i can get port :8123 to come up. Rest of the ports (5050, 3218) work no problem but i can’t get 8123 to come online.

Any assistance will be highly appreciated.

Thanks

I’m not sure what you mean when you say you can get port 8123 to come up but not come online.

I assume this is a clean install? Did you use the “example” configuration offered by the script? or are you trying to use a pre-existing configuration directory?

Can you try this. ssh into your FreeNAS or however you get to it’s console. Then:

iocage console homeassistant
service homeassistant stop
mv /home/hass/homeassistant /home/hass/homeassistant.old
service homeassistant start

This will basically factory reset HA and cause it to load it’s own default configuration. All previous configuration will be kept safe in the homeassistant.old directory. Curious if you can start and access HA with clean default settings.

Hello @troy

This is what I’m getting.

image

I followed your instructions and still get that. Below you have a copy of the logs. Any idea?

Thanks

2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Error during setup of component lovelace
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 172, in _async_setup_component
    hass, processed_config
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/lovelace/__init__.py", line 66, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py", line 223, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/srv/homeassistant/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/frontend/__init__.py", line 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Error during setup of component config
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 172, in _async_setup_component
    hass, processed_config
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/config/__init__.py", line 34, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py", line 223, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/srv/homeassistant/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/frontend/__init__.py", line 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Error during setup of component history
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 172, in _async_setup_component
    hass, processed_config
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/history/__init__.py", line 283, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py", line 223, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/srv/homeassistant/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/frontend/__init__.py", line 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: lovelace
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: frontend
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of map. Setup failed for dependencies: frontend
2019-10-31 16:31:28 ERROR (MainThread) [homeassistant.setup] Setup failed for map: Could not set up all dependencies.
2019-10-31 16:32:05 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: Unable to import component
2019-10-31 16:32:05 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: config, frontend, history, logbook, map, mobile_app
2019-10-31 16:32:05 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.
2019-10-31 16:32:05 WARNING (MainThread) [homeassistant.bootstrap] Python 3.6 support is deprecated and will be removed in the first release after December 15, 2019. Please upgrade Python to 3.7.0 or higher.
2019-10-31 16:32:06 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:11 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:16 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:21 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:26 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:31 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:36 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:41 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:46 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:51 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:32:56 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:01 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:06 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:11 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:16 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:21 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:26 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:32 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:37 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:42 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:47 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:52 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:33:57 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:34:02 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:34:07 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:34:12 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:34:17 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:34:22 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1
2019-10-31 16:34:27 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1

ugh… I just ran through myself. I get the same error… Something is in fact broke. I’ll try to get this tracked down and fixed asap. Was planning to update this soon anyways. (switch to python 3.7 and some small changes) I have a few more weeks of busy work schedule before I can work on that update but I’ll see what I can do to at least get the script working again until then. Sorry for the inconvenience.

So I found a few things going on here. Both issues appear in HA 0.101.

First is breaking change to my “out of the box” configuration for appdaemon and configurator. Since these both rely on the old api password (user were expected to change this anyways) but now this entry will cause config validation to fail.

Second I do not know why the hass_front-end will not load from a clean install to ha 0.101.


HA version 0.100.3 will still work as expected. Here’s what you can do to get up and running.

First log back into your FreeNAS console. Then:

iocage console homeassistant
service homeassistant stop

Now we change to user hass and downgrade to homeassistant 0.100.3

su - hass
source /srv/homeassistant/bin/activate
pip3 install --upgrade homeassistant==0.100.3
deactivate && exit

service homeassistant start

So now you should be able to reach homeassistant on port 8123.

Next (if your using example config I provide) you need to edit configuration.yaml.
You can use the configurator. You need to comment out or remove lines 20 - 25.

## Show links to resources in frontend
#introduction:

# This default password was set so appdaemon/hadashboard can work "out of the box"
#http:       # YOU SHOULD DISABLE THIS OR AT LEAST CHANGE IT TO SOMETHING OF YOUR OWN
# api_password: !secret ha_api_key # CONSIDER USING A LONG LIVE ACCESS TOKEN INSTEAD

You need to use a long-lived access token for appdaemon and the configurator (see links)

After you get appdaemon and configurator set up with long-lived tokens you should restart the jail to confirm everything is working before finally upgrading back to the latest HA.

HA should come back after reboot and you should not see any failed logins from 127.0.1.1. Finally you can upgrade back to latest HA. Since you used the script install you can just call script to upgrade. From your FreeNAS console

sudo iocage exec homeassistant bash update

Sorry for so much extra work but I tested these steps from a clean install and they seem to work. Hopefully this can provide a workaround until I get some time to further investigate

@troy,

Thanks for the directions. It worked perfectly. Please advised once upgrade to python 3.7 is available so we could patch it.

Thanks again for your assistance.

D

After upgarde to 101.2 I cant access my frontend (? the login page) anymore.

I get this error: ERR_CONNECTION_REFUSED

Anyone that has any suggestions? I am running this from LAN, but neither my phone or my laptop can access it with remote either… I was not running any SSL before this upgrade and none after either…

@pomah

Please share you homeassistant log.

Ill have a look.

These are parts of the log, there are some z-wave and hikvision errors too, but they do not seem to be related to this

2019-11-03 11:15:48 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /home/hass/homeassistant/configuration.yaml contains duplicate key "homeassistant". Check lines 0 and 48.
2019-11-03 11:15:48 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: [api_password] is an invalid option for [http]. Check: http->http->api_password. (See /home/hass/homeassistant/configuration.yaml, line 24). Please check the docs at https://home-assistant.io/integrations/http/
2019-11-03 11:15:48 ERROR (MainThread) [homeassistant.setup] Setup failed for http: Invalid config.
2019-11-03 11:15:48 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of system_log. Setup failed for dependencies: http
2019-11-03 11:15:48 ERROR (MainThread) [homeassistant.setup] Setup failed for system_log: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of websocket_api. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for websocket_api: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of auth. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for auth: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of config. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for config: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of tts. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for tts: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of media_player. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for media_player: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of api. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for api: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of webhook. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for webhook: Could not set up all dependencies.
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of system_health. Setup failed for dependencies: http
2019-11-03 11:15:50 ERROR (MainThread) [homeassistant.setup] Setup failed for system_health: Could not set up all dependencies.

Ok, removing the API password from HTTP fixed this. Sorry for not reading the log before posting…

There is a breaking change in the example configuration I provided

You need to use long live access tokens now. API password causes configuration error starting with HA 0.101

Edit: no worries

Hello @troy,

Something i’ve detected after following your directions is some login attempt failed errors

image

I was able to upgrade and everything seems to be working without any issues but still get those on the logs too.

Any idea?

Thanks

@Dario_Lemes_Gonzalez

Im guessing you using appdaemon and/or the configurator with my example config files

Did you create a separate long live access token for each? After you create them, each access token will need to be set in the corresponding configuration files. appdaemon.yaml and configurator.conf. Also only restarting home assistant is not enough. Both appdaemon and the configurator need restarted as well. Easiest way to do that is just restart the jail itself.