diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 66703bd..4827f7c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -2,7 +2,7 @@ ## Project Selbst gehosteter Tile-Server (rd13) – stellt Karten-Tiles (OSM Vektor + Satelliten-Raster) -für interne Dienste bereit: MediaWiki (Kartographer), Nextcloud Maps und weitere Web-Apps. +für interne Dienste bereit: MediaWiki (Kartographer), Nextcloud Maps, Home Assistant und weitere Web-Apps. ## Stack - Language: Shell (Bash/Fish), JSON, Nginx config @@ -29,7 +29,7 @@ für interne Dienste bereit: MediaWiki (Kartographer), Nextcloud Maps und weiter ``` config/ TileServer-GL config.json data/ MBTiles, Fonts, Sprites, Styles (nicht im Git) - docs/ Integrations-Anleitungen (MediaWiki, Nextcloud, API) + docs/ Integrations-Anleitungen (MediaWiki, Nextcloud, Home Assistant, API) nginx/ nginx.conf, cors.conf prompts/ GitHub Copilot Prompt-Templates scripts/ Daten-Download, Deploy-Hilfen diff --git a/docs/api-endpoints.md b/docs/api-endpoints.md index 40853a2..f9ae706 100644 --- a/docs/api-endpoints.md +++ b/docs/api-endpoints.md @@ -32,3 +32,13 @@ # style: 'http://SERVER:PORT/styles/osm-bright.json', # container: 'map' # }); +# +# Home Assistant – configuration.yaml: +# map: +# lovelace card (custom:map-card oder built-in): +# tile_layer_url: 'http://SERVER:PORT/styles/osm-bright/{z}/{x}/{y}.png' +# tile_layer_attribution: '© OpenMapTiles © OpenStreetMap contributors' +# +# Für Home Assistant custom:map-card (HACS): +# tile_layer_url: 'http://SERVER:PORT/styles/osm-bright/{z}/{x}/{y}.png' +# tile_layer_max_zoom: 19 diff --git a/docs/homeassistant-config.md b/docs/homeassistant-config.md new file mode 100644 index 0000000..88c8c44 --- /dev/null +++ b/docs/homeassistant-config.md @@ -0,0 +1,52 @@ +# Home Assistant – eigenen Tile-Server verwenden +# +# Home Assistant kann über mehrere Wege eigene Karten-Tiles nutzen. +# +# ------------------------------------------------------------------------- +# Option 1: Map Card (Standard Lovelace) +# ------------------------------------------------------------------------- +# In einer Lovelace-Dashboard-Karte (type: map) wird der Tile-Server über +# ein custom Frontend-Modul eingebunden. Die eingebaute Map-Card unterstützt +# ab HA 2024.x direkt eigene Tile-Layer: +# +# Lovelace YAML (Dashboard → Karte bearbeiten → YAML-Modus): +# +# type: map +# entities: +# - person.YOUR_PERSON +# default_zoom: 12 +# # Tile Layer Override (ab HA 2024.6+): +# tile_layer: http://TILE_SERVER_URL:8080/styles/osm-bright/{z}/{x}/{y}.png +# tile_layer_attribution: "© OpenMapTiles © OpenStreetMap contributors" + +# ------------------------------------------------------------------------- +# Option 2: custom:map-card (HACS) +# ------------------------------------------------------------------------- +# https://github.com/nathan-gs/ha-map-card +# +# type: custom:map-card +# x: 48.137 +# y: 11.576 +# zoom: 12 +# tile_layer_url: "http://TILE_SERVER_URL:8080/styles/osm-bright/{z}/{x}/{y}.png" +# tile_layer_attribution: "© OpenMapTiles © OpenStreetMap contributors" +# tile_layer_max_zoom: 19 +# entities: +# - entity: person.YOUR_PERSON + +# ------------------------------------------------------------------------- +# Option 3: Satellitenkarte als alternativer Layer +# ------------------------------------------------------------------------- +# type: custom:map-card +# tile_layer_url: "http://TILE_SERVER_URL:8080/styles/satellite-hybrid/{z}/{x}/{y}.png" +# tile_layer_attribution: "© OpenMapTiles © Sentinel-2" + +# ------------------------------------------------------------------------- +# Hinweise +# ------------------------------------------------------------------------- +# - TILE_SERVER_URL ersetzen mit der IP/Hostname des Tile-Servers im LAN +# - Port 8080 ist Standard (nginx-Proxy), anpassen falls abweichend +# - CORS ist bereits für das gesamte LAN (Origin: *) konfiguriert +# - Home Assistant muss den Tile-Server über HTTP im LAN erreichen können +# - Für HTTPS-Setups: Tile-Server ebenfalls über HTTPS erreichbar machen +# (z.B. über nginx Reverse Proxy mit SSL-Terminierung) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index e1deec3..7a3759f 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -14,7 +14,7 @@ http { listen 80; server_name _; - # CORS für alle Clients (MediaWiki, Nextcloud, etc.) + # CORS für alle Clients (MediaWiki, Nextcloud, Home Assistant, etc.) include /etc/nginx/cors.conf; location / {