From e1ce545912a29cb565026acab5731b455b1d5306 Mon Sep 17 00:00:00 2001
From: Christian Elberfeld <elberfeld@web.de>
Date: Sun, 28 May 2023 02:56:06 +0200
Subject: [PATCH] add homematic ccu2

---
 .../templates/config/configuration.yaml       | 27 +++++++++++++++++++
 .../templates/docker-compose.yml              |  2 ++
 site.yml                                      |  3 ++-
 .../etc/icinga/conf.d/hosts_manual.conf       |  8 ++++++
 4 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/intern/docker_homeassistant/templates/config/configuration.yaml b/intern/docker_homeassistant/templates/config/configuration.yaml
index 8b3fe2c9..47b826aa 100644
--- a/intern/docker_homeassistant/templates/config/configuration.yaml
+++ b/intern/docker_homeassistant/templates/config/configuration.yaml
@@ -54,6 +54,33 @@ influxdb:
   token: {{ influxdb_token }}
   default_measurement: units
 
+# Homematic CCU2
+# https://www.home-assistant.io/integrations/homematic/
+homematic:
+  local_port: {{ homematic_callback_port }}
+  interfaces:
+    rf:
+      host: 192.168.0.15
+      resolvenames: json
+      callback_ip: {{ int_ip4 }}
+      callback_port: {{ homematic_callback_port }}
+    ip:
+      host: 192.168.0.15
+      port: 2010
+      callback_ip: {{ int_ip4 }}
+      callback_port: {{ homematic_callback_port }}
+    groups:
+      host: 192.168.0.15
+      port: 9292
+      resolvenames: json
+      path: /groups
+      callback_ip: {{ int_ip4 }}
+      callback_port: {{ homematic_callback_port }}
+  hosts:
+    ccu2:
+      host: 192.168.0.15
+
+
 # zonenstatus wird vom hauptschalter gesteuert, switch02 ping ist nicht mehr notwendig
 # https://www.home-assistant.io/integrations/ping/
 #binary_sensor:
diff --git a/intern/docker_homeassistant/templates/docker-compose.yml b/intern/docker_homeassistant/templates/docker-compose.yml
index 1a63ce4e..979b285c 100644
--- a/intern/docker_homeassistant/templates/docker-compose.yml
+++ b/intern/docker_homeassistant/templates/docker-compose.yml
@@ -7,6 +7,8 @@ services:
 
     image: homeassistant/home-assistant:2023.3
     restart: always
+    ports:
+      - "{{ int_ip4 }}:{{ homematic_callback_port }}:{{ homematic_callback_port }}"
     volumes:
       - "/etc/localtime:/etc/localtime:ro"
       - "{{ basedir }}/config:/config"
diff --git a/site.yml b/site.yml
index 10363b65..065db8aa 100644
--- a/site.yml
+++ b/site.yml
@@ -92,7 +92,8 @@
         servicename: homeassistant, 
         basedir: /srv/homeassistant,
         domain: "ha.warpzone.lan",
-        influxdb_port: 38086
+        homematic_callback_port: 8060,
+        influxdb_port: 38086       
       }
     - { 
         role: intern/docker_mqtt, tags: mqtt, 
diff --git a/webserver/docker_icinga/templates/etc/icinga/conf.d/hosts_manual.conf b/webserver/docker_icinga/templates/etc/icinga/conf.d/hosts_manual.conf
index eba63847..fbac38f7 100644
--- a/webserver/docker_icinga/templates/etc/icinga/conf.d/hosts_manual.conf
+++ b/webserver/docker_icinga/templates/etc/icinga/conf.d/hosts_manual.conf
@@ -73,3 +73,11 @@ object Host "wz-ap-werkstatt" {
 
   groups = [ "network" ]
 }
+
+object Host "homematic-ccu2" {
+  import "generic-host"
+
+  address = "192.168.0.15"
+
+  groups = [ "network" ]
+}
-- 
GitLab