diff --git a/homeassistant/configurator-config/settings.conf b/homeassistant/configurator-config/settings.conf new file mode 100644 index 0000000..3ff1b4d --- /dev/null +++ b/homeassistant/configurator-config/settings.conf @@ -0,0 +1,3 @@ +{ + "BASEPATH": "../hass-config" +} \ No newline at end of file diff --git a/homeassistant/docker-compose.yaml b/homeassistant/docker-compose.yaml new file mode 100644 index 0000000..178b0ac --- /dev/null +++ b/homeassistant/docker-compose.yaml @@ -0,0 +1,66 @@ +version: '3' +services: + homeassistant: + container_name: hass + image: homeassistant/home-assistant + volumes: + - ./hass-config:/config + - /etc/localtime:/etc/localtime:ro + restart: unless-stopped + network_mode: host + depends_on: + - mariadb + - mosquitto + mariadb: + image: linuxserver/mariadb + container_name: mariadb + restart: unless-stopped + environment: + MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}" + MYSQL_DATABASE: ha_db + MYSQL_USER: homeassistant + MYSQL_PASSWORD: "${HA_MYSQL_PASSWORD}" + PUID: 1000 + PGID: 1000 + volumes: + - ./mariadb:/config + ports: + - "3306:3306" + nodered: + container_name: nodered + image: nodered/node-red + ports: + - "1880:1880" + volumes: + - ./nodered:/data + depends_on: + - homeassistant + - mosquitto + environment: + TZ: "Europe/Madrid" + restart: unless-stopped + mosquitto: + image: eclipse-mosquitto + container_name: mosquitto + restart: unless-stopped + ports: + - "1883:1883" + volumes: + - "./mosquitto/config:/mosquitto/config" + - "./mosquitto/data:/mosquitto/data" + - "./mosquitto/log:/mosquitto/log" + environment: + - TZ=Europe/Madrid + user: "${PUID}:${PGID}" + hass-configurator: + image: "causticlab/hass-configurator-docker:arm" + container_name: hass-configurator + restart: unless-stopped + ports: + - "3218:3218/tcp" + depends_on: + - homeassistant + volumes: + - "./configurator-config:/config" + - "./hass-config:/hass-config" + user: "${PUID}:${PGID}" \ No newline at end of file diff --git a/homeassistant/hass-config/configuration.yaml b/homeassistant/hass-config/configuration.yaml new file mode 100644 index 0000000..a840e23 --- /dev/null +++ b/homeassistant/hass-config/configuration.yaml @@ -0,0 +1,23 @@ +default_config: +# For homeassistant v2021.7.0 and above add this http block +http: + use_x_forwarded_for: true + trusted_proxies: + - 192.168.0.171 # Add the IP address of the proxy server +panel_iframe: + configurator: + title: Configurator + icon: mdi:wrench + url: http://192.168.0.171:3218/ + require_admin: true + nodered: + title: Node-Red + icon: mdi:shuffle-variant + url: http://192.168.0.171:1880/ + require_admin: true +mqtt: + broker: 192.168.0.171 + +recorder: + db_url: mysql://homeassistant:ha_dbdatabasepassword@192.168.0.171/ha_db?charset=utf8 + purge_keep_days: 30 \ No newline at end of file diff --git a/homeassistant/mosquitto/config/mosquitto.conf b/homeassistant/mosquitto/config/mosquitto.conf new file mode 100644 index 0000000..e451820 --- /dev/null +++ b/homeassistant/mosquitto/config/mosquitto.conf @@ -0,0 +1,5 @@ +persistence true +persistence_location /mosquitto/data/ +log_dest file /mosquitto/log/mosquitto.log +listener 1883 +allow_anonymous true \ No newline at end of file diff --git a/homeassistant/sample.env b/homeassistant/sample.env new file mode 100644 index 0000000..73b9945 --- /dev/null +++ b/homeassistant/sample.env @@ -0,0 +1,4 @@ +MYSQL_ROOT_PASSWORD=mariadbrootpassword +HA_MYSQL_PASSWORD=ha_dbdatabasepassword +PUID=1000 +PGID=1000 \ No newline at end of file