User Tools

Site Tools


haussteuerung:todo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
haussteuerung:todo [2025/10/28 07:36] dominikhaussteuerung:todo [2025/10/28 07:45] (current) dominik
Line 17: Line 17:
 </sortable> </sortable>
  
- 
- 
-====== Briefkasten-Automatisierung in Home Assistant ====== 
- 
-===== Überblick ===== 
-Diese Automatisierung nutzt einen Aqara MCCGQ11LM Tür-/Fenstersensor (über Zigbee2MQTT) zur Überwachung eines Briefkastens. Sie benachrichtigt bei Öffnen (z.B. Posteingang) auf zwei Handys, im Dashboard und als Popup. Zusätzlich trackt sie die Öffnungszeit und Dauer, minimiert Fehlalarme durch Self-Öffnungen und warnt bei langem Offenbleiben (z.B. blockierte Post). Throttling verhindert Spam-Benachrichtigungen. 
- 
-===== Voraussetzungen ===== 
-  * Home Assistant mit Zigbee2MQTT-Integration. 
-  * Aqara-Sensor gepairt; Entity-ID: ''binary_sensor.briefkasten_contact'' (State: 'on' = geöffnet, 'off' = geschlossen). 
-  * HA Companion App auf zwei Handys für Benachrichtigungen (Services: ''notify.mobile_app_dein_handy1'' und ''notify.mobile_app_dein_handy2''). 
-  * Custom Integration: Browser Mod (über HACS) für Dashboard-Popups. 
-  * Helpers erstellen (Configuration > Helpers): 
-    * Input Datetime: ''input_datetime.briefkasten_letztes_oeffnen'' (für Timestamp). 
-    * Input Boolean: ''input_boolean.briefkasten_snooze'' (für manuellen Override). 
-    * Input Boolean: ''input_boolean.briefkasten_offen_cooldown'' (für Throttling). 
-  * Sensor für Dauer-Tracking (in ''configuration.yaml''): 
-<code yaml> 
-sensor: 
-  - platform: history_stats 
-    name: Briefkasten offen Dauer 
-    entity_id: binary_sensor.briefkasten_contact 
-    state: 'on' 
-    type: time 
-    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}' 
-    end: '{{ now() }}' 
-</code> 
- 
-===== Automatisierungen ===== 
-Alle in ''automations.yaml'' oder über den visuellen Editor. Ersetze Entity-IDs bei Bedarf. 
- 
-==== Haupt-Automatisierung: Benachrichtigung bei Öffnen ==== 
-Triggert bei kurzer Öffnung (z.B. Postbote), speichert Timestamp und Dauer. 
-<code yaml> 
-automation: 
-  - id: briefkasten_benachrichtigung 
-    alias: Briefkasten geöffnet - Smarte Benachrichtigungen 
-    trigger: 
-      - platform: state 
-        entity_id: binary_sensor.briefkasten_contact 
-        from: 'off' 
-        to: 'on' 
-    condition: 
-      - condition: state 
-        entity_id: input_boolean.briefkasten_snooze 
-        state: 'off' 
-    action: 
-      - wait_for_trigger: 
-          - platform: state 
-            entity_id: binary_sensor.briefkasten_contact 
-            from: 'on' 
-            to: 'off' 
-        timeout: 
-          minutes: 5 
-        continue_on_timeout: false 
-      - variables: 
-          open_duration: "{{ (now() - trigger.to_state.last_changed).total_seconds() }}" 
-      - condition: numeric_state 
-          entity_id: "{{ open_duration }}" 
-          below: 30  # Sekunden; anpassen für kurze Öffnungen 
-      - service: input_datetime.set_datetime 
-        target: 
-          entity_id: input_datetime.briefkasten_letztes_oeffnen 
-        data: 
-          datetime: "{{ now() }}" 
-      - service: notify.mobile_app_dein_handy1 
-        data: 
-          title: "Post ist da!" 
-          message: "Briefkasten geöffnet für {{ open_duration }} Sekunden um {{ now().strftime('%H:%M Uhr am %d.%m.%Y') }}." 
-      - service: notify.mobile_app_dein_handy2 
-        data: 
-          title: "Post ist da!" 
-          message: "Briefkasten geöffnet für {{ open_duration }} Sekunden um {{ now().strftime('%H:%M Uhr am %d.%m.%Y') }}." 
-      - service: browser_mod.notification 
-        data: 
-          title: "Posteingang" 
-          message: "Kurze Öffnung ({{ open_duration }} Sek) um {{ now().strftime('%H:%M Uhr am %d.%m.%Y') }}." 
-    mode: single 
-</code> 
- 
-==== Warnung bei langem Offenbleiben ==== 
-Für blockierte Post (Deckel geht nicht zu). 
-<code yaml> 
-automation: 
-  - id: briefkasten_offen_warnung 
-    alias: Briefkasten steht offen - Warnung 
-    trigger: 
-      - platform: state 
-        entity_id: binary_sensor.briefkasten_contact 
-        to: 'on' 
-        for: 
-          minutes: 5 
-    condition: 
-      - condition: state 
-        entity_id: input_boolean.briefkasten_offen_cooldown 
-        state: 'off' 
-    action: 
-      - service: notify.mobile_app_dein_handy1 
-        data: 
-          title: "Briefkasten steht offen!" 
-          message: "Der Briefkasten ist seit {{ (now() - states.binary_sensor.briefkasten_contact.last_changed).total_seconds() | int // 60 }} Minuten offen. Vielleicht blockiert Post? (Stand: {{ now().strftime('%H:%M Uhr') }})" 
-      - service: notify.mobile_app_dein_handy2 
-        data: 
-          title: "Briefkasten steht offen!" 
-          message: "Der Briefkasten ist seit {{ (now() - states.binary_sensor.briefkasten_contact.last_changed).total_seconds() | int // 60 }} Minuten offen. Vielleicht blockiert Post? (Stand: {{ now().strftime('%H:%M Uhr') }})" 
-      - service: browser_mod.notification 
-        data: 
-          title: "Warnung: Briefkasten offen" 
-          message: "Offen seit {{ (now() - states.binary_sensor.briefkasten_contact.last_changed).total_seconds() | int // 60 }} Min. – Überprüfen?" 
-          duration: 60 
-      - service: input_boolean.turn_on 
-        target: 
-          entity_id: input_boolean.briefkasten_offen_cooldown 
-    mode: restart 
-</code> 
- 
-==== Snooze-Reset ==== 
-Auto-Reset für Snooze nach 10 Min. 
-<code yaml> 
-automation: 
-  - id: briefkasten_snooze_reset 
-    alias: Briefkasten Snooze zurücksetzen 
-    trigger: 
-      - platform: state 
-        entity_id: input_boolean.briefkasten_snooze 
-        to: 'on' 
-        for: 
-          minutes: 10 
-    action: 
-      - service: input_boolean.turn_off 
-        target: 
-          entity_id: input_boolean.briefkasten_snooze 
-</code> 
- 
-==== Cooldown-Reset für Offen-Warnung ==== 
-Throttling: Reset nach 1 Stunde. 
-<code yaml> 
-automation: 
-  - id: briefkasten_offen_cooldown_reset 
-    alias: Offen-Warnung Cooldown zurücksetzen 
-    trigger: 
-      - platform: state 
-        entity_id: input_boolean.briefkasten_offen_cooldown 
-        to: 'on' 
-        for: 
-          hours: 1 
-    action: 
-      - service: input_boolean.turn_off 
-        target: 
-          entity_id: input_boolean.briefkasten_offen_cooldown 
-</code> 
- 
-===== Dashboard-Integration ===== 
-  * Entities Card für Sensor-Status. 
-  * Markdown Card für Timestamp: ''Letztes Öffnen: {{ states('input_datetime.briefkasten_letztes_oeffnen') }}'' 
-  * Gauge Card für Dauer: ''sensor.briefkasten_offen_dauer'' 
-  * Button für Snooze: Toggle ''input_boolean.briefkasten_snooze'' 
-  * Conditional Card für Warnung: ''Briefkasten: {{ 'Offen (blockiert?)' if is_state('binary_sensor.briefkasten_contact', 'on') and (now() - states.binary_sensor.briefkasten_contact.last_changed).total_seconds() > 300 else 'Geschlossen' }}'' 
- 
-===== Tipps und Anpassungen ===== 
-  * Teste mit Developer Tools > States/Services. 
-  * Passe Dauern (z.B. 30 Sek, 5 Min) an dein Verhalten an. 
-  * Optional: Zeitbedingungen hinzufügen (z.B. nur 8-14 Uhr). 
-  * Erweiterbar mit Kamera oder Vibration-Sensor für bessere Genauigkeit. 
- 
-Diese Setup minimiert Fehlalarme und trackt alles Elegante. 
haussteuerung/todo.txt · Last modified: by dominik

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki