diff --git a/README.md b/README.md index 3181ae72..78008f7b 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Ansible config and a bunch of Docker containers. * [Grafana](https://github.com/grafana/grafana) - Dashboarding tool * [Guacamole](https://guacamole.apache.org/) - Web based remote desktop gateway, supports VNC, RDP and SSH * [Heimdall](https://heimdall.site/) - Home server dashboard +* [Home Assistant](https://www.home-assistant.io) - Open source home automation * [InfluxDB](https://github.com/influxdata/influxdb) - Time series database used for stats collection * [Jackett](https://github.com/Jackett/Jackett) - API Support for your favorite torrent trackers * [MiniDlna](https://sourceforge.net/projects/minidlna/) - simple media server which is fully compliant with DLNA/UPnP-AV clients diff --git a/docs/applications/homeassistant.md b/docs/applications/homeassistant.md new file mode 100644 index 00000000..29983c2e --- /dev/null +++ b/docs/applications/homeassistant.md @@ -0,0 +1,12 @@ +# Home Assistant + +Homepage: [https://www.home-assistant.io/](https://www.home-assistant.io/) + + +## Usage + +Set `homeassistant_enabled: true` in your `group_vars/all.yml` file. + +If you want to access Home Assistant externally, don't forget to set `homeassistant_available_externally: "true"` in your `group_vars/all.yml` file. + +The Home Assistant web interface can be found at http://ansible_nas_host_or_ip:8123. diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index a03a9978..9159c9db 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -19,6 +19,7 @@ By default, applications can be found on the ports listed below. | Grafana | 3000 | | | Guacamole | 8090 | | | Heimdall | 10080 | | +| Home Assistant | 8123 | | | Jackett | 9117 | | | MiniDLNA | 8201 | | | Miniflux | 8070 | | diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index fd10f9ff..857774df 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -74,7 +74,8 @@ firefly_enabled: false # Wallabag wallabag_enabled: false -# MQTT +# Home Automation +homeassistant_enabled: true mosquitto_enabled: false # Calibre @@ -599,4 +600,9 @@ calibre_data_directory: "{{ docker_home }}/calibre" calibre_user_id: "0" calibre_group_id: "0" # To disable ebook conversion set calibre_ebook_conversion to "". To enable it set it to "linuxserver/calibre-web:calibre" -calibre_ebook_conversion: "linuxserver/calibre-web:calibre" \ No newline at end of file +calibre_ebook_conversion: "linuxserver/calibre-web:calibre" + +### Home Assistant +### +homeassistant_available_externally: "false" +homeassistant_data_directory: "{{ docker_home }}/homeassistant" diff --git a/nas.yml b/nas.yml index b570e5d5..934dd074 100644 --- a/nas.yml +++ b/nas.yml @@ -174,4 +174,8 @@ - import_tasks: tasks/calibre.yml when: (calibre_enabled | default(False)) - tags: calibre \ No newline at end of file + tags: calibre + + - import_tasks: tasks/homeassistant.yml + when: (homeassistant_enabled | default(False)) + tags: homeassistant diff --git a/tasks/homeassistant.yml b/tasks/homeassistant.yml new file mode 100644 index 00000000..5b249991 --- /dev/null +++ b/tasks/homeassistant.yml @@ -0,0 +1,25 @@ +- name: Create Home Assistant Directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ homeassistant_data_directory }}/config" + +- name: Home Assistant Docker Container + docker_container: + name: homeassistant + image: homeassistant/home-assistant + pull: true + volumes: + - "{{ homeassistant_data_directory }}/config:/config:rw" + ports: + - "8123:8123" + network_mode: "host" + restart_policy: unless-stopped + labels: + traefik.backend: "homeassistant" + traefik.frontend.rule: "Host:homeassistant.{{ ansible_nas_domain }}" + traefik.enable: "{{ homeassistant_available_externally }}" + traefik.port: "80" + traefik.frontend.headers.SSLRedirect: "true" + memory: 1g diff --git a/templates/traefik/traefik.toml b/templates/traefik/traefik.toml index a099df99..1ddec423 100644 --- a/templates/traefik/traefik.toml +++ b/templates/traefik/traefik.toml @@ -191,6 +191,7 @@ onDemand = false # create certificate when container is created "grafana.{{ ansible_nas_domain }}", "guacamole.{{ ansible_nas_domain }}", "heimdall.{{ ansible_nas_domain }}", + "homeassistant.{{ ansible_nas_domain }}", "jackett.{{ ansible_nas_domain }}", "miniflux.{{ ansible_nas_domain }}", "netdata.{{ ansible_nas_domain }}",