From f4b940cfb8a09db4223d5d5afd856678398b7219 Mon Sep 17 00:00:00 2001 From: Vyacheslav Scherbinin Date: Wed, 7 May 2025 14:09:48 +0700 Subject: [PATCH] Home Assistant template (#81) * feat: homeassistant * absolute path * homeassistant port * Mount config files --- blueprints/homeassistant/docker-compose.yml | 20 +++++++++ blueprints/homeassistant/homeassistant.svg | 4 ++ blueprints/homeassistant/template.toml | 49 +++++++++++++++++++++ meta.json | 19 ++++++++ 4 files changed, 92 insertions(+) create mode 100644 blueprints/homeassistant/docker-compose.yml create mode 100644 blueprints/homeassistant/homeassistant.svg create mode 100644 blueprints/homeassistant/template.toml diff --git a/blueprints/homeassistant/docker-compose.yml b/blueprints/homeassistant/docker-compose.yml new file mode 100644 index 0000000..61d2dee --- /dev/null +++ b/blueprints/homeassistant/docker-compose.yml @@ -0,0 +1,20 @@ +services: + homeassistant: + image: ghcr.io/home-assistant/home-assistant:stable + restart: unless-stopped + ports: + - 8123 + volumes: + - ../files/configuration.yaml:/config/configuration.yaml + - ../files/automations.yaml:/config/automations.yaml + - ../files/scripts.yaml:/config/scripts.yaml + - ../files/scenes.yaml:/config/scenes.yaml + - /opt/homeassistant:/config + - /etc/localtime:/etc/localtime:ro + - /run/dbus:/run/dbus:ro + healthcheck: + test: ["CMD", "curl", "-f", "http://homeassistant:8123/"] + interval: 60s + retries: 5 + start_period: 300s + timeout: 2s diff --git a/blueprints/homeassistant/homeassistant.svg b/blueprints/homeassistant/homeassistant.svg new file mode 100644 index 0000000..7bce628 --- /dev/null +++ b/blueprints/homeassistant/homeassistant.svg @@ -0,0 +1,4 @@ + + + + diff --git a/blueprints/homeassistant/template.toml b/blueprints/homeassistant/template.toml new file mode 100644 index 0000000..2c02220 --- /dev/null +++ b/blueprints/homeassistant/template.toml @@ -0,0 +1,49 @@ +[variables] +main_domain = "${domain}" + +[config] + +[[config.domains]] +serviceName = "homeassistant" +port = 8123 +host = "${main_domain}" + +env = [] + +[[config.mounts]] +filePath = "configuration.yaml" +content = """ + +# Loads default set of integrations. Do not remove. +default_config: + +# Load frontend themes from the themes folder +frontend: + themes: !include_dir_merge_named themes + +automation: !include automations.yaml +script: !include scripts.yaml +scene: !include scenes.yaml + +http: + use_x_forwarded_for: true + trusted_proxies: + - 192.168.0.0/16 # Local LAN Subnet + - 172.0.0.0/8 # Docker Subnet + - 10.0.0.0/16 # Docker Swarm Subnet +""" + +[[config.mounts]] +filePath = "automations.yaml" +content = """ +""" + +[[config.mounts]] +filePath = "scripts.yaml" +content = """ +""" + +[[config.mounts]] +filePath = "scenes.yaml" +content = """ +""" diff --git a/meta.json b/meta.json index 9447a7d..2adf2e1 100644 --- a/meta.json +++ b/meta.json @@ -2234,6 +2234,25 @@ "server" ] }, + { + "id": "homeassistant", + "name": "Home Assistant", + "version": "stable", + "description": "Open source home automation that puts local control and privacy first.", + "logo": "homeassistant.svg", + "links": { + "github": "https://github.com/home-assistant/core", + "website": "https://www.home-assistant.io/", + "docs": "https://www.home-assistant.io/getting-started/onboarding/" + }, + "tags": [ + "iot", + "home-automation", + "internet-of-things", + "self-hosted", + "server" + ] + }, { "id": "tooljet", "name": "Tooljet",