diff --git a/README.md b/README.md index 67e1293b..2175f6e6 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Ansible config and a bunch of Docker containers. * [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution * [Nextcloud](https://nextcloud.com/) - A self-hosted Dropbox alternative * [NZBget](https://nzbget.net/) - The most efficient usenet downloader +* [openHAB](https://www.openhab.org/) - A vendor and technology agnostic open source automation software for your home * [Plex](https://www.plex.tv/) - Plex Media Server * [Portainer](https://portainer.io/) - for managing Docker and running custom images * [pyLoad](https://pyload.net/) - A download manager with a friendly web-interface diff --git a/docs/applications/openhab.md b/docs/applications/openhab.md new file mode 100644 index 00000000..aee723ef --- /dev/null +++ b/docs/applications/openhab.md @@ -0,0 +1,15 @@ +# openHAB + +Homepage: [https://www.openhab.org/](https://www.openhab.org/) + +OpenHab is a vendor and technology agnostic open source automation software for your home. +It allows you to connect many different IoT-Devices (which in this case means "Intranet of Things") using custom bindings made by the community. + +## Usage + +Set `openhab_enabled: true` in your `group_vars/all.yml` file. + +## Specific Configuration + +The openHAB Webinterface is available at port 7777 (HTTP) and 7778 (HTTPS). +Visit the webinterface and follow the setup instructions found in the [openHAB Documentation](https://www.openhab.org/docs/tutorial/1sttimesetup.html) diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index 8f5fd452..06cff99b 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -30,6 +30,8 @@ By default, applications can be found on the ports listed below. | Netdata | 19999 | | | Nextcloud | 8080 | | | NZBGet | 6789 | | +| openHAB | 7777 | HTTP | +| openHAB | 7778 | HTTPS | | Plex | 32400 | | | Portainer | 9000 | | | pyload | 8000 | | diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 1bf8356b..ba27ed5b 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -83,6 +83,9 @@ mosquitto_enabled: false # Calibre calibre_enabled: false +# Smarthome +openhab_enabled: false + ### ### General ### @@ -614,7 +617,15 @@ 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" +### ### Home Assistant ### homeassistant_available_externally: "false" homeassistant_data_directory: "{{ docker_home }}/homeassistant" + +### +### openHAB +### +openhab_available_externally: "false" +openhab_docker_image: openhab/openhab:latest +openhab_data_directory: "{{ docker_home }}/openhab" diff --git a/nas.yml b/nas.yml index a86ffdef..a99bf217 100644 --- a/nas.yml +++ b/nas.yml @@ -183,4 +183,9 @@ - import_tasks: tasks/bazarr.yml when: (bazarr_enabled | default(False)) tags: bazarr + + - import_tasks: tasks/openhab.yml + when: (openhab_enabled | default(False)) + tags: openhab + diff --git a/tasks/openhab.yml b/tasks/openhab.yml new file mode 100644 index 00000000..312f60c8 --- /dev/null +++ b/tasks/openhab.yml @@ -0,0 +1,51 @@ +--- +- name: Create openHAB group + group: + name: openhab + gid: 9001 + state: present + +- name: Create openHAB user + user: + name: openhab + uid: 9001 + state: present + system: yes + update_password: on_create + create_home: no + group: openhab + +- name: Create openHAB Directories + file: + path: "{{ item }}" + state: directory + owner: openhab + group: openhab + with_items: + - "{{ openhab_data_directory }}" + - "{{ openhab_data_directory }}/conf" + - "{{ openhab_data_directory }}/userdata" + - "{{ openhab_data_directory }}/addons" + +- name: Create openHAB container + docker_container: + name: openHAB + image: "{{ openhab_docker_image }}" + pull: true + network_mode: "host" + volumes: + - "{{ openhab_data_directory }}/conf:/openhab/conf:rw" + - "{{ openhab_data_directory }}/userdata:/openhab/userdata:rw" + - "{{ openhab_data_directory }}/addons:/openhab/addons:rw" + - "/etc/localtime:/etc/localtime:ro" + - "/etc/timezone:/etc/timezone:ro" + env: + OPENHAB_HTTP_PORT: "7777" + OPENHAB_HTTPS_PORT: "7778" + restart_policy: unless-stopped + memory: 1g + labels: + traefik.backend: "openhab" + traefik.frontend.rule: "Host:openhab.{{ ansible_nas_domain }}" + traefik.enable: "{{ openhab_available_externally }}" + traefik.port: "80" diff --git a/templates/traefik/traefik.toml b/templates/traefik/traefik.toml index 39b09ab6..aa33b2dc 100644 --- a/templates/traefik/traefik.toml +++ b/templates/traefik/traefik.toml @@ -198,6 +198,7 @@ onDemand = false # create certificate when container is created "netdata.{{ ansible_nas_domain }}", "nextcloud.{{ ansible_nas_domain }}", "nzbget.{{ ansible_nas_domain }}", + "openhab.{{ ansible_nas_domain }}", "plex.{{ ansible_nas_domain }}", "portainer.{{ ansible_nas_domain }}", "pyload.{{ ansible_nas_domain }}",