From 7b7d2deb6074b2cade0bd7800ad1111ec0eb996e Mon Sep 17 00:00:00 2001
From: jabertwo <git@jabertwo.de>
Date: Thu, 6 Jul 2023 23:12:57 +0200
Subject: [PATCH] homeassistant automationen per ansible

---
 .../templates/config/configuration.yaml       | 53 ++++++++++++++++++-
 1 file changed, 51 insertions(+), 2 deletions(-)

diff --git a/intern/docker_homeassistant/templates/config/configuration.yaml b/intern/docker_homeassistant/templates/config/configuration.yaml
index e7080259..1bc6d44b 100644
--- a/intern/docker_homeassistant/templates/config/configuration.yaml
+++ b/intern/docker_homeassistant/templates/config/configuration.yaml
@@ -248,10 +248,59 @@ automation ansible:
                   timeout: 30
                   message: Die warpzone ist seit {{ '{{' }} states('sensor.time') {{ '}}' }} geschlossen!
     mode: restart
+  
+  # Stromverbrauch auf Telegram senden
+  - alias: ANSIBLE_stromverbrauch_send_telegram
+    description: Sendet alle 10 Minuten den Stromverbrauch per Telegram
+    trigger:
+      - platform: time_platform
+        minutes: /10
+    condition: []
+    action:
+      - if:
+        - condition: state
+          entity_id: automation.ansible_zonenstatus_send_telegram
+          attribute: current
+          state: "1"
+        then:
+          - wait_for_trigger:
+            - platform: state
+              entity_id:
+                - automation.ansible_zonenstatus_send_telegram
+              attribute: current
+              to: "0"
+      - service: telegram_bot.send_message
+        data:
+          target: -1001341516106
+          timeout: 30
+          message: >-
+            {{ states('sensor.esphome_status_power') }} kW bei angenehmen {{ states('sensor.temp') }}°C
+    mode: restart
+
+  # Licht im Hackcenter dimmen
+  - alias: ANSIBLE_dali_licht_hackcenter
+    description: Ruft den Helper aus um per MQTT das Licht zu dimmen
+    trigger:
+      - platform: state
+        entity_id:
+          - input_number.dali_licht_hackcenter
+        for:
+          hours: 0
+          minutes: 0
+          seconds: 0
+    condition: []
+    action:
+      - service: mqtt.publish
+        data:
+          topic: light/dali
+          payload_template: "{{ states('input_number.dali_licht_hackcenter') | int }}"
+    mode: restart
+
+
 
-  #turn off all radiators
+  # turn off all radiators
   - alias: ANSIBLE_heizung_aus
-    description: "Schaltet alle Heizungen aus"
+    description: Schaltet alle Heizungen aus
     trigger: []
     condition: []
     action:
-- 
GitLab