From ceddf3266f8a40bd40dd82d63b49fdec2b593ba8 Mon Sep 17 00:00:00 2001
From: matt <matthiashermeling@gmail.com>
Date: Wed, 22 Feb 2023 19:28:44 +0100
Subject: [PATCH] hauptschalter steuert zonenstatus

---
 .../templates/config/esphome_status.yaml      |  2 +-
 .../templates/config/configuration.yaml       | 23 ++++++++++---------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/intern/docker_esphome/templates/config/esphome_status.yaml b/intern/docker_esphome/templates/config/esphome_status.yaml
index 65d4c397..5cdd195e 100644
--- a/intern/docker_esphome/templates/config/esphome_status.yaml
+++ b/intern/docker_esphome/templates/config/esphome_status.yaml
@@ -47,5 +47,5 @@ binary_sensor:
       inverted: true
     filters:
       - delayed_on_off: 500ms
-    name: "warpzone Status"
+    name: "esphome_status_Hauptschalter"
     device_class: presence
diff --git a/intern/docker_homeassistant/templates/config/configuration.yaml b/intern/docker_homeassistant/templates/config/configuration.yaml
index ac8797aa..8b3fe2c9 100644
--- a/intern/docker_homeassistant/templates/config/configuration.yaml
+++ b/intern/docker_homeassistant/templates/config/configuration.yaml
@@ -54,13 +54,14 @@ influxdb:
   token: {{ influxdb_token }}
   default_measurement: units
 
+# zonenstatus wird vom hauptschalter gesteuert, switch02 ping ist nicht mehr notwendig
 # https://www.home-assistant.io/integrations/ping/
-binary_sensor:
-  - platform: ping
-    host: TL-SG3452X
-    name: "Switch02"
-    count: 3
-    scan_interval: 20 
+#binary_sensor:
+#  - platform: ping
+#    host: TL-SG3452X
+#    name: "Switch02"
+#    count: 3
+#    scan_interval: 20 
 
 # https://www.home-assistant.io/integrations/rest_command/
 rest_command: 
@@ -109,15 +110,16 @@ automation ansible:
   # set zonenstatus
   - alias: ANSIBLE_zonenstatus_set
     description: Speichert Zonenstatus in einem Helper
+    mode: restart
     trigger:
       - platform: state
         entity_id:
-          - binary_sensor.switch02
+          - binary_sensor.esphome_status_hauptschalter
         from: "off"
         to: "on"
       - platform: state
         entity_id:
-          - binary_sensor.switch02
+          - binary_sensor.esphome_status_hauptschalter
         from: "on"
         to: "off"
     condition: []
@@ -125,7 +127,7 @@ automation ansible:
       - choose:
           - conditions:
               - condition: state
-                entity_id: binary_sensor.switch02
+                entity_id: binary_sensor.esphome_status_hauptschalter
                 state: "on"
             sequence:
               - service: input_select.select_option
@@ -135,7 +137,7 @@ automation ansible:
                   entity_id: input_select.zonenstatus
           - conditions:
               - condition: state
-                entity_id: binary_sensor.switch02
+                entity_id: binary_sensor.esphome_status_hauptschalter
                 state: "off"
             sequence:
               - service: input_select.select_option
@@ -143,7 +145,6 @@ automation ansible:
                   option: closed
                 target:
                   entity_id: input_select.zonenstatus
-    mode: restart
 
   # send zonenstatus to MQTT, REST
   - alias: ANSIBLE_zonenstatus_send_MQTT_REST
-- 
GitLab