Home Assistant Community

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

#1

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

#2

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

#3

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.

#4

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.

#5

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.

#6

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.

#7

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!

#8

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

#9

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: