Press "Enter" to skip to content

Month: May 2019

Home Assistant (docker) on QNAP

I was curious to see if the installation of Home Assistant in my new QNAP was feasible and I have been very surprised by how easy the task has been.

I have only test this procedure in my QNAP TS-453be, with the latest versions of QTS and Container Station (4.3.6.0923 and 2.0.117 respectively), I’m not sure if it would work on different hardware or with different versions of software, although in the newer versions with docker support it should be quite straightforward.

I will show two methods to obtain the same result, one through the CLI and another from the QTS graphic interface. First of all there is a small requirement. We need access to a directory outside the container where we will store the configuration of Home Assistant to not lose it if we update the container, in my case this directory is a share on the nas called ‘/Container/hass_config’. Hands on with the first method, in my opinion the most simple, connect to the nas by ssh as administrator and execute the following command:

docker run --init -d --name="home-assistant" -v /Container/hass_config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant:latest

Neat and easy, isn’t it? After a while, you can access your Home Assistant instance in the url ‘http://xxx.xxx.xxx.xxx:8123’, do not forget to put the ip of your nas instead of the x‘s.

And now the GUI method, using Container Station from your nas, here are the steps to follow:

  • Open ‘Container Station’ and select create.
  • Search for “homeassistant”, find the ‘homeassistant/home-assistant’ image on the Docker Hub results tab and click ‘Create’.
  • Select version, and set the name and resources for the container as per your requirements.
  • Under ‘Advanced Settings -> Environment’ create a variable named tz with your timezone as value (e. Europe/Madrid).
  • Under ‘Advanced Settings -> Network’ select Host as Network Mode.
  • Under ‘Advanced Settings -> Shared Folders’ you should add a directory from your nas (host) as stated before or create a new one, use /config as mount point.

And that’s it, some time after clicking ‘Create’ you should be able to access your Home Assistant instance in the url ‘http://xxx.xxx.xxx.xxx:8123’, replace the ip of your nas with the x‘s.

In order to update your Home Assistant instance, just remove container and image and reinstall it again, configuration should be kept in ‘/Container/hass_config’.

Leave a Comment

Tcpdump over ssh and wireshark

Here you have a very useful command for when you want to analyze traffic remotely over ssh using wireshark.

ssh root@192.168.1.1 tcpdump -i any -U -s0 -w - 'not port 22' | wireshark -k -i -

The idea is to run tcpdump on the remote server over ssh, send that capture in real time through this encrypted connection and view it on our local computer with wireshark, a graphical package inspector with many interesting features.

Leave a Comment