Skip to content

Home Assistant QNAP

mttstt edited this page Feb 5, 2019 · 63 revisions

Todo

  • Docker-compose HA
  • Docker-compose MQTT
  • Disable redirect port 80 on Qnap
  • Caddy configuration

Docker-compose HA+MQTT+... to be tested

version: '3'
services:
  mqtt:
    container_name: MQTT
    restart: unless-stopped
    image: eclipse-mosquitto
    volumes:
      - /Public/home-container/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
      - /Public/home-container/mosquitto/config/log:/mosquitto/log
      - /Public/home-container/mosquitto/data:/mosquitto/data
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "1883:1883"
      - "9001:9001"
   homeassistant:
    container_name: home-assistant
    restart: unless-stopped
    image: homeassistant/home-assistant    
    devices:
      - /dev/ttyACM0:/dev/ttyACM0
    volumes:
      - /Public/VM/home-container/hass-config:/config
    network_mode: host
    privileged: true

Disable redirect port 80 on Qnap

Enable QNAP web server service and change the port (e-g- 80 -->81). Now TCP 80 port is not more redirected.

Caddy Server reverse proxy

Edit /etc/Caddyfile:

smatteo.dlinkddns.com {
    proxy / localhost:8123 {
        websocket
        transparent
    }
}

Clone this wiki locally