Installing Home-Assistant on Asustor NAS using "docker-ce" and "portainer"

Hi!

New to home automation and I was thinking about buying a Philips Hue light for my bedroom to begin with and I am going to invest in a “Conbee II” zigbee-stick from Dresden Electronics to control it (and other zigbee devices) with.

Instead of buying and using a RPi I was thinking about using my NAS (Asustor AS5004T) and run “docker-ce” and “portainer”.

My current steps:

  1. Install “portainer” which also will download “docker-ce” if not already installed
    (did not enable port forwarding)
  2. Opened a private browsing window (got a cache issue with “No response” otherwise) and browsed to:
    my_nas_ip:9000
  3. Created default user
  4. Connected to my “Local” Docker environment / Clicked “Local” (in the portainer setup wizard)
  5. Selected “Endpoints” > “local” and under “Public IP” entered “my_nas_ip” > “Update endpoint”
  6. “Home” > “local” > “Images” > under “Image” entered “homeassistant/home-assistant” w. “Registry” set to “DockerHub” > “Pull the image”
    (took a while to pull)
  7. “Containers” > “Add container” >
    under “Name” entered “home-assistant”
    under “Image” entered “home-assistant” and selected the image from the list
    “Publish all exposed ports” = TOGGLE
    “Deploy the container”
  8. Clicked the “console”-icon next to the container and then “Connect” (using “root”)
  9. When connected to the container;
    “python3 -m pip install homeassistant”

Relevant output:

Installing collected packages: homeassistant
Successfully installed homeassistant-0.92.2

hass --open-ui

Relevant output:

[homeassistant.components.device_tracker] Unable to load /root/.homeassistant/known_devices.yaml: Config file not found: /root/.homeassistant/known_devices.yaml
[homeassistant.components.http] Failed to create HTTP server at port 8123: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 8123): address already in use
[homeassistant.components.discovery] Unknown service discovered: home_assistant {‘host’: ‘my_container_ip’, ‘port’: 8123, ‘hostname’: ‘Home._home-assistant._tcp.local.’, ‘properties’: {‘version’: ‘0.92.2’, ‘base_url’: my_container_ip:8123’, ‘requires_api_password’: True}}

///

Unable to access Home Assistant through my_nas_ip:8123
Disconnected from the shell
Connected again >
“top” > “hass” is running
“netstat -plant” > python is using port 8123

cd /config/
cat configuration.yaml

apt-get update
apt-get install nano

uncommented “http”

added:
server_port: 8124

Still get the same error:

2019-05-09 18:31:29 ERROR (MainThread) [homeassistant.components.http] Failed to create HTTP server at port 8123: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 8123): address already in use
2019-05-09 18:31:42 INFO (MainThread) [homeassistant.components.discovery] Unknown service discovered: home_assistant {‘host’: ‘my_container_ip’, ‘port’: 8123, ‘hostname’: ‘Home._home-assistant._tcp.local.’, ‘properties’: {‘version’: ‘0.92.2’, ‘base_url’: ‘my_container_ip:8123’, ‘requires_api_password’: True}}

Restarted the container, same issue

Am I missing something?
python seems to have been bound to 8123 which hass is trying to use and therefore I get an empty response when trying to connect to my_nas_ip:8123

Thanks for your time / TheSwede86

apologies, not an expert, but why dont you just follow the official docker installation

You are correct, however I get the same error that port 8123 is already in use even though I run it manually through docker-ce when using SSH and executing the command on my NAS but now it works anyway :slight_smile: Just weird that I couldnt get it to work with portainer, guessing I did something wrong there.

WHY?

The docker image already includes home assistant. You don’t do this in Docker.

When you use this option in Portainer, it publishes a RANDOM port tied to the correct port.
image
What you want is NETWORK MODE = HOST, which are down below in the network options.

Thanks for your reply, thats also what I thought was weird since I actually installed a docker for home-assistant and then needed to install it when pulling the image.

I am new to docker so I read this;

To get started:
python3 -m pip install homeassistant
hass --open-ui

from here:
https://hub.docker.com/r/homeassistant/home-assistant

Which lead me to believe that command was needed.

That documentation on the docker hub page is incorrect. It looks like it was pulled straight from an old version of the official getting started page. A docker image contains everything it needs to run the application. You don’t install things in a Docker container.

Thanks, the documentation there made me a bit confused.
Anyway I mapped 8123 > 8123 in portainer and that did the trick, it works now :slight_smile:

Thanks for all replies!

discovery will not work unless you use network mode: host.

Cheers!
Saw that, when I launched it with docker manually it found my Kodi but when I ran it with “bridge” and only did a portforward it didn’t (ofc since its on a different network then my host-network).

:smiley:

forgive me for being kind of noob ish. i attempted to follow these directions using a Western Digital my cloud EX2 Ultra. everything per the initial post worked out great, following the follow up instructions to change the network to host. all that was great… however, once it’s running, whether i refresh the containers or click in to connect, the container then stops running. any suggestions as to what i might be missing?

the following steps are what i did:

  1. Install “portainer” which also will download “docker-ce” if not already installed
    (did not enable port forwarding)
  2. Opened a private browsing window to: my_nas_ip:9000
  3. Created default user
  4. Connected to my “Local” Docker environment / Clicked “Local” (in the portainer setup wizard)
  5. Selected “Endpoints” > “local” and under “Public IP” entered “my_nas_ip” > “Update endpoint”
  6. “Home” > “local” > “Images” > under “Image” entered “homeassistant/home-assistant” w. “Registry” set to “DockerHub” > “Pull the image”
    (took a while to pull)
  7. “Containers” > “Add container” >
    under “Name” entered “home-assistant”
    under “Image” entered “home-assistant” and selected the image from the list
    “Publish all exposed ports” = TOGGLE
    i replaced the above commands with manually assigning host 8123 to container 8123
    enabled access control and set to admin
    Advanced container settings > Network > Network to host (no other changes)
    “Deploy the container”

when it initially deploys. it is running, but as stated above, upon refreshing and/or clicking anything else, the container stops running

I am trying to find out how I could have a docker with a zigbee2mqtt broker and link that to Home Assistant on a Asustor NAS.
HA is working beautifully using a ConBee II coordinator together with a ZHA integration. But I would like to learn about zigbee2mqtt and if that would benefit me.

I ordered the nice stick with the koenkk firmware for this.

The plan is to let go of the Asustor because it is just a Core version of HA and so you cannot use Add-ons and do more stuff. But due to hardware shortage and long delivery times something that I would prefer to have like the Home Assistant Yellow is still out of the question for now.

Any advice how?

I am installing Home Assistant in a MyCloudEx2Ultra, and impossible. Do you install it?