Home Assistant - Docker (Help)

User avatar
parkerc
Easy as a breeze
Posts: 314
Joined: Thu Oct 16, 2014 7:36 am
Location: Near London, England
Contact:

Home Assistant - Docker (Help)

Post by parkerc »

Being a big home automation fan, I really like the look of Home Assistant and as they have a Docker container for their product, I thought I would give it a go..

https://home-assistant.io/getting-started/

However it does not seem as straight forward as I hoped - I've installed their latest docker and it looks to be working, however I can't seem to interact with it via the Console - and it suggest a web UI should be available on port 8123, but if I put my NAS IP in and that port it gives me nothing back and I can't check what IP the Home Assistant container has been given to try the port against that.

Is any using Home Assistant, if so what did you do ? How are you finding it ?
Model Name : QNAP TS-253be (16GB) & TS-453D (16GB)
Firmware Version:: QTS Latest
OS Version : Apple iOS (iPad/Safari Browser)
Number & Type of HDDs : 2 x 3TB WD Reds, Raid 1 & 4 x 4TB WD Reds, Raid 5
Website (When I have time) : http://www.nodecentral.co.uk
vividboarder
New here
Posts: 2
Joined: Wed Feb 24, 2016 2:45 pm

Re: Home Assistant - Docker (Help)

Post by vividboarder »

I haven't tried via the NAS just yet, but that's the port that should be bound inside the container. There should be a port exposed on the host as well. That should show in Container Station.
User avatar
parkerc
Easy as a breeze
Posts: 314
Joined: Thu Oct 16, 2014 7:36 am
Location: Near London, England
Contact:

Re: Home Assistant - Docker (Help)

Post by parkerc »

Hi, thanks, it looks like all containers created in Container Station are assigned a 10.x.x address - I'm not sure how I update the network settings..
Model Name : QNAP TS-253be (16GB) & TS-453D (16GB)
Firmware Version:: QTS Latest
OS Version : Apple iOS (iPad/Safari Browser)
Number & Type of HDDs : 2 x 3TB WD Reds, Raid 1 & 4 x 4TB WD Reds, Raid 5
Website (When I have time) : http://www.nodecentral.co.uk
yd9ekl
Starting out
Posts: 12
Joined: Sun Feb 21, 2016 3:33 am

Re: Home Assistant - Docker (Help)

Post by yd9ekl »

On the container's status page, there should be a list of internal ports and their mapped external ports (under the heading URL). If one of them is running an HTTP server, it should be a clickable link. If you did not map the ports when you created the initial container, you'll have to rebuild it and forward them in the network section of the advanced options of the creation window.
User avatar
parkerc
Easy as a breeze
Posts: 314
Joined: Thu Oct 16, 2014 7:36 am
Location: Near London, England
Contact:

Re: Home Assistant - Docker (Help)

Post by parkerc »

Sorry to ask this, but I'm really struggling to get my head around mapping the ports and how I would access it from a PC/pad on my normal home network.

The link in the first post suggests you need to have access to http://localhost:8123/
Model Name : QNAP TS-253be (16GB) & TS-453D (16GB)
Firmware Version:: QTS Latest
OS Version : Apple iOS (iPad/Safari Browser)
Number & Type of HDDs : 2 x 3TB WD Reds, Raid 1 & 4 x 4TB WD Reds, Raid 5
Website (When I have time) : http://www.nodecentral.co.uk
User avatar
nwofearless
Know my way around
Posts: 103
Joined: Mon Nov 01, 2010 3:06 am
Location: Ireland
Contact:

Re: Home Assistant - Docker (Help)

Post by nwofearless »

http://localhost:8123/ - probably from within the NAS it is local to that, but you need to specify the NAS ip server if connected via a web browser on your pc. So if your NAS is located at 192.168.1.2 you would try to connect to http://192.168.1.2:8123
QNAP TS-453A (5.0.0.1932) | QNAP TS-219P (4.5.4)
User avatar
parkerc
Easy as a breeze
Posts: 314
Joined: Thu Oct 16, 2014 7:36 am
Location: Near London, England
Contact:

Re: Home Assistant - Docker (Help)

Post by parkerc »

Hi, many thanks,

I've tried the NAS Ip and the suggested port 8123 but nothing happened ?
I'd originally assumed there would be an issue, as I'm on 192.168.1.34 as the docker/container itself is on a 10.x.x.x address

Also the container does not show much of anything, and sadly not a web URL to clock on.
You do not have the required permissions to view the files attached to this post.
Model Name : QNAP TS-253be (16GB) & TS-453D (16GB)
Firmware Version:: QTS Latest
OS Version : Apple iOS (iPad/Safari Browser)
Number & Type of HDDs : 2 x 3TB WD Reds, Raid 1 & 4 x 4TB WD Reds, Raid 5
Website (When I have time) : http://www.nodecentral.co.uk
User avatar
nwofearless
Know my way around
Posts: 103
Joined: Mon Nov 01, 2010 3:06 am
Location: Ireland
Contact:

Re: Home Assistant - Docker (Help)

Post by nwofearless »

I used WinSCP and PuTTY to log into my nas using ssh (192.168.1.2)

Once i was at the shell prompt i typed the following:

Code: Select all

docker run -d --name="home-assistant" -v /share/Public/ha:/config -v /etc/localtime:/etc/localtime:ro --net=host balloob/home-assistant
I created the ha folder inside my Public share just before running that command. It said it couldnt find image locally, but proceeded to fetch it remotely.
Image

I left it to download and came back to it noting that it has added a few files to the ha folder:
Image

Logged into web ui of the nas, and ran container station:
Image

It didnt show any url in the container image when i selected it.
Image

But i figured id try connecting via firefox anyhow, typed in the address bar 192.168.1.2:8132 and it opend this web page:
Image

Not sure if its an issue with the virtual network switch not being available or some other issue with docker (im running Container Station v1.4.1047 - only updated a few days ago from what i remember)
QNAP TS-453A (5.0.0.1932) | QNAP TS-219P (4.5.4)
User avatar
parkerc
Easy as a breeze
Posts: 314
Joined: Thu Oct 16, 2014 7:36 am
Location: Near London, England
Contact:

Re: Home Assistant - Docker (Help)

Post by parkerc »

Thanks for helping @nwofearless.

Please could you help me understand what that command line entry does, I'm not sure I follow why having a folder in /public/ helps? (Sorry to have to ask, what might be obvious to others)

Also it looks like you have a 453A, which seems to be the only one that has the Virtual Switch, as I think that is part of 4.2.1, which has not been released for my 453Pro yet.
Model Name : QNAP TS-253be (16GB) & TS-453D (16GB)
Firmware Version:: QTS Latest
OS Version : Apple iOS (iPad/Safari Browser)
Number & Type of HDDs : 2 x 3TB WD Reds, Raid 1 & 4 x 4TB WD Reds, Raid 5
Website (When I have time) : http://www.nodecentral.co.uk
User avatar
nwofearless
Know my way around
Posts: 103
Joined: Mon Nov 01, 2010 3:06 am
Location: Ireland
Contact:

Re: Home Assistant - Docker (Help)

Post by nwofearless »

I just chose Public as an example, could be on any share - and any folder as well - i just wanted to quickly check that it was going to do something with that folder, as in output some config settings in it.
As for the command line, i just took the example command line from the installation instructions and ran it (changing the path to config to point to my Public\ha folder): https://home-assistant.io/getting-started/ (docker tab)
Installation with Docker is straightforward. Adjust the following command so that /path/to/your/config/ points at the folder where you want to store your config and run it:

Code: Select all

$ docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host balloob/home-assistant
This will launch Home Assistant and serve the web interface from port 8123 on your Docker host.
from running it, it fetches the docker image, installs it and then runs it - not sure about the specifics of what its doing tbh.
QNAP TS-453A (5.0.0.1932) | QNAP TS-219P (4.5.4)
User avatar
parkerc
Easy as a breeze
Posts: 314
Joined: Thu Oct 16, 2014 7:36 am
Location: Near London, England
Contact:

Re: Home Assistant - Docker (Help)

Post by parkerc »

Thanks

Ok, I followed your steps and then tried to access the Web UI, but it would not connect.

Is this where port forwarding comes in ? I need my NAS IP (192.168.1.5) to forward that request to the Home Assistant docker container 10.0.3.4) ? Is that how you did it?
Model Name : QNAP TS-253be (16GB) & TS-453D (16GB)
Firmware Version:: QTS Latest
OS Version : Apple iOS (iPad/Safari Browser)
Number & Type of HDDs : 2 x 3TB WD Reds, Raid 1 & 4 x 4TB WD Reds, Raid 5
Website (When I have time) : http://www.nodecentral.co.uk
User avatar
nwofearless
Know my way around
Posts: 103
Joined: Mon Nov 01, 2010 3:06 am
Location: Ireland
Contact:

Re: Home Assistant - Docker (Help)

Post by nwofearless »

I didnt have to do anything else, if its not working im guessing its due to the ommission of the virtual network switch in your version of the firmware, which probably handles that internal routing. I literally just done the steps as listed above, without any additional configuration.

Is there a beta version of 4.2.1 available for your model? not sure if its worth taking the risk and doing a beta firmware update, could be worth checking the other forum threads about the beta firmware releases just to see if there are any issues, and in particular with your model of nas - that way you can weight up the risks of possible doing the update - but, i cant say for sure that an update will solve everything. So my best advice is dont be hasty, check some topics, maybe someone else will know if a beta update will help resolve your issue with the docker home automation.
QNAP TS-453A (5.0.0.1932) | QNAP TS-219P (4.5.4)
yd9ekl
Starting out
Posts: 12
Joined: Sun Feb 21, 2016 3:33 am

Re: Home Assistant - Docker (Help)

Post by yd9ekl »

nwofearless wrote:

Code: Select all

docker run -d --name="home-assistant" -v /share/Public/ha:/config -v /etc/localtime:/etc/localtime:ro --net=host balloob/home-assistant
Note that in this setup, you use the non-isolated network mode, which poses a (possible) security risk to the host, but doesn't require port forwarding or mapping and allows the container direct access to your network.
From my experience, the Container Station UI keeps track of the ports it creates, and containers created from the command-line don't show their port mappings in the UI.
monkmartinez
First post
Posts: 1
Joined: Sat Jul 04, 2015 11:09 am

Re: Home Assistant - Docker (Help)

Post by monkmartinez »

I got this working this morning...

The trick for me was using the correct port with the IP of the NAS itself. The port is 8123. I have two ethernet ports connected so I had to try both.

Also, leave the Command and Entrypoint blank on the settings page. The only thing you really need to configure is the volume (Directory) on your NAS, where you intend to store your configuration file and your Timezone in the environment tab.
sonybansi
Starting out
Posts: 24
Joined: Fri Dec 18, 2015 4:53 pm

Re: Home Assistant - Docker (Help)

Post by sonybansi »

nwofearless wrote:I used WinSCP and PuTTY to log into my nas using ssh (192.168.1.2)

Once i was at the shell prompt i typed the following:

Code: Select all

docker run -d --name="home-assistant" -v /share/Public/ha:/config -v /etc/localtime:/etc/localtime:ro --net=host balloob/home-assistant
I created the ha folder inside my Public share just before running that command. It said it couldnt find image locally, but proceeded to fetch it remotely.
Image

I left it to download and came back to it noting that it has added a few files to the ha folder:
Image

Logged into web ui of the nas, and ran container station:
Image

It didnt show any url in the container image when i selected it.
Image

But i figured id try connecting via firefox anyhow, typed in the address bar 192.168.1.2:8132 and it opend this web page:
Image

Not sure if its an issue with the virtual network switch not being available or some other issue with docker (im running Container Station v1.4.1047 - only updated a few days ago from what i remember)

Where you give path (share/Public/ha) in container.

thanks
QNAP TVS-671, CPU Intel(R) Core(TM) i7-4790S CPU @ 3.20GHz (4 cores, 8 threads) 16GB RAM and 3x3TB of WD Red disks(64MB 5400RPM) RAID5 , Current firmware version:5.0.0.1986
Router: AsusRT-AC66U Firmware Version:9.0.0.4.382_52503
Macbook Pro: Intel Core i5 2,3 GHz 16GB, macOS Sierra 10.13.6
Post Reply

Return to “Container Station”