haussteuerung:ha_automatisierungen:briefkasten
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| haussteuerung:ha_automatisierungen:briefkasten [2025/10/28 07:47] – removed - external edit (Unknown date) 127.0.0.1 | haussteuerung:ha_automatisierungen:briefkasten [2025/10/28 07:47] (current) – ↷ Links adapted because of a move operation dominik | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Briefkasten ====== | ||
| + | ===== Überblick ===== | ||
| + | Diese Automatisierung nutzt einen Aqara MCCGQ11LM Tür-/ | ||
| + | |||
| + | ===== Voraussetzungen ===== | ||
| + | * Home Assistant mit Zigbee2MQTT-Integration. | ||
| + | * Aqara-Sensor gepairt; Entity-ID: '' | ||
| + | * HA Companion App auf zwei Handys für Benachrichtigungen (Services: '' | ||
| + | * Custom Integration: | ||
| + | * Helpers erstellen (Configuration > Helpers): | ||
| + | * Input Datetime: '' | ||
| + | * Input Boolean: '' | ||
| + | * Input Boolean: '' | ||
| + | * Sensor für Dauer-Tracking (in '' | ||
| + | <code yaml> | ||
| + | sensor: | ||
| + | - platform: history_stats | ||
| + | name: Briefkasten offen Dauer | ||
| + | entity_id: binary_sensor.briefkasten_contact | ||
| + | state: ' | ||
| + | type: time | ||
| + | start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}' | ||
| + | end: '{{ now() }}' | ||
| + | </ | ||
| + | |||
| + | ===== Automatisierungen ===== | ||
| + | Alle in '' | ||
| + | |||
| + | ==== Haupt-Automatisierung: | ||
| + | Diese Automatisierung erkennt das Öffnen des Briefkastens und überprüft, | ||
| + | <code yaml> | ||
| + | automation: | ||
| + | - id: briefkasten_benachrichtigung | ||
| + | alias: Briefkasten geöffnet - Smarte Benachrichtigungen | ||
| + | trigger: | ||
| + | - platform: state | ||
| + | entity_id: binary_sensor.briefkasten_contact | ||
| + | from: ' | ||
| + | to: ' | ||
| + | condition: | ||
| + | - condition: and | ||
| + | conditions: | ||
| + | - condition: time | ||
| + | after: ' | ||
| + | before: ' | ||
| + | - condition: state | ||
| + | entity_id: input_boolean.briefkasten_snooze | ||
| + | state: ' | ||
| + | action: | ||
| + | - wait_for_trigger: | ||
| + | - platform: state | ||
| + | entity_id: binary_sensor.briefkasten_contact | ||
| + | from: ' | ||
| + | to: ' | ||
| + | timeout: | ||
| + | minutes: 5 | ||
| + | continue_on_timeout: | ||
| + | - variables: | ||
| + | open_duration: | ||
| + | - 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: " | ||
| + | - service: notify.mobile_app_dein_handy2 | ||
| + | data: | ||
| + | title: "Post ist da!" | ||
| + | message: " | ||
| + | - service: browser_mod.notification | ||
| + | data: | ||
| + | title: " | ||
| + | message: "Kurze Öffnung ({{ open_duration }} Sek) um {{ now().strftime(' | ||
| + | mode: single | ||
| + | </ | ||
| + | |||
| + | ==== Warnung bei Öffnen außerhalb Postzeit ==== | ||
| + | Diese separate Automatisierung dient als Sicherheitsfeature und triggert speziell bei Öffnungen des Briefkastens außerhalb der üblichen Postzeit (vor 8 Uhr oder nach 17 Uhr). Sie ist nützlich, um ungewöhnliche Aktivitäten zu erkennen, z.B. durch Dritte oder vergessene Öffnungen. Die Bedingung verwendet eine OR-Kombination für die Zeiträume, um den gesamten Tag abzudecken. Benachrichtigungen werden sofort gesendet, ohne Dauer-Überprüfung, | ||
| + | <code yaml> | ||
| + | automation: | ||
| + | - id: briefkasten_ausserhalb_postzeit | ||
| + | alias: Briefkasten außerhalb Postzeit geöffnet | ||
| + | trigger: | ||
| + | - platform: state | ||
| + | entity_id: binary_sensor.briefkasten_contact | ||
| + | from: ' | ||
| + | to: ' | ||
| + | condition: | ||
| + | - condition: or | ||
| + | conditions: | ||
| + | - condition: time | ||
| + | after: ' | ||
| + | before: ' | ||
| + | - condition: time | ||
| + | after: ' | ||
| + | before: ' | ||
| + | - condition: state | ||
| + | entity_id: input_boolean.briefkasten_snooze | ||
| + | state: ' | ||
| + | action: | ||
| + | - service: notify.mobile_app_dein_handy1 | ||
| + | data: | ||
| + | title: " | ||
| + | message: " | ||
| + | - service: notify.mobile_app_dein_handy2 | ||
| + | data: | ||
| + | title: " | ||
| + | message: " | ||
| + | - service: browser_mod.notification | ||
| + | data: | ||
| + | title: " | ||
| + | message: " | ||
| + | duration: 60 | ||
| + | mode: single | ||
| + | </ | ||
| + | |||
| + | ==== Warnung bei langem Offenbleiben ==== | ||
| + | Diese Automatisierung überwacht, ob der Briefkasten länger als 5 Minuten (anpassbar) geöffnet bleibt, was oft auf blockierte Post oder einen nicht richtig geschlossenen Deckel hinweist. Der Trigger wartet explizit auf die Dauer, bevor er auslöst, um kurze Öffnungen zu ignorieren. Die Benachrichtigung enthält die genaue Dauer seit dem Öffnen, berechnet dynamisch. Throttling wird durch den Cooldown-Helper umgesetzt, der nach Auslösung aktiviert wird und Benachrichtigungen für eine Stunde blockiert. Der Modus ' | ||
| + | <code yaml> | ||
| + | automation: | ||
| + | - id: briefkasten_offen_warnung | ||
| + | alias: Briefkasten steht offen - Warnung | ||
| + | trigger: | ||
| + | - platform: state | ||
| + | entity_id: binary_sensor.briefkasten_contact | ||
| + | to: ' | ||
| + | for: | ||
| + | minutes: 5 | ||
| + | condition: | ||
| + | - condition: state | ||
| + | entity_id: input_boolean.briefkasten_offen_cooldown | ||
| + | state: ' | ||
| + | action: | ||
| + | - service: notify.mobile_app_dein_handy1 | ||
| + | data: | ||
| + | title: " | ||
| + | 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(' | ||
| + | - service: notify.mobile_app_dein_handy2 | ||
| + | data: | ||
| + | title: " | ||
| + | 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(' | ||
| + | - service: browser_mod.notification | ||
| + | data: | ||
| + | title: " | ||
| + | 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 | ||
| + | </ | ||
| + | |||
| + | ==== Snooze-Reset ==== | ||
| + | Diese Hilfsautomatisierung setzt den Snooze-Helper automatisch zurück, nachdem er 10 Minuten aktiviert war. Sie triggert auf den ' | ||
| + | <code yaml> | ||
| + | automation: | ||
| + | - id: briefkasten_snooze_reset | ||
| + | alias: Briefkasten Snooze zurücksetzen | ||
| + | trigger: | ||
| + | - platform: state | ||
| + | entity_id: input_boolean.briefkasten_snooze | ||
| + | to: ' | ||
| + | for: | ||
| + | minutes: 10 | ||
| + | action: | ||
| + | - service: input_boolean.turn_off | ||
| + | target: | ||
| + | entity_id: input_boolean.briefkasten_snooze | ||
| + | </ | ||
| + | |||
| + | ==== Cooldown-Reset für Offen-Warnung ==== | ||
| + | Ähnlich wie der Snooze-Reset, | ||
| + | <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: ' | ||
| + | for: | ||
| + | hours: 1 | ||
| + | action: | ||
| + | - service: input_boolean.turn_off | ||
| + | target: | ||
| + | entity_id: input_boolean.briefkasten_offen_cooldown | ||
| + | </ | ||
| + | |||
| + | ===== Dashboard-Integration ===== | ||
| + | * Entities Card für Sensor-Status. | ||
| + | * Markdown Card für Timestamp: '' | ||
| + | * Gauge Card für Dauer: '' | ||
| + | * Button für Snooze: Toggle '' | ||
| + | * Conditional Card für Warnung: '' | ||
| + | |||
| + | ===== Tipps und Anpassungen ===== | ||
| + | * Teste mit Developer Tools > States/ | ||
| + | * Passe Dauern (z.B. 30 Sek, 5 Min) an dein Verhalten an. | ||
| + | * Die Postzeit (8-17 Uhr) ist in den Conditions integriert; bei Bedarf erweitern (z.B. Wochentage mit '' | ||
| + | * Erweiterbar mit Kamera oder Vibration-Sensor für bessere Genauigkeit. | ||
| + | |||
| + | Diese Setup minimiert Fehlalarme und trackt alles Elegante. | ||
