fix: presence_light v2.1.0 — „Licht geht einfach aus" behoben (Türkontakt-Hold, robuste Tür-Trigger, Timer-Refresh) - #5
Merged
Conversation
…mer-Refresh, Modus "Deaktiviert" Behebt "Licht geht manchmal einfach aus": - Modus "Deaktiviert" ignoriert Bewegungsmelder jetzt vollständig (vorher: einschalten ja, halten nein -> Aus trotz Bewegung) - Timer-Refresh läuft bei brennendem Licht immer; Dunkelheitsprüfung gated nur noch das Einschalten (Lux-Rückkopplung blockierte den Refresh, Timer-Ablauf traf Präsenz-Aussetzer -> Licht aus) - Tür-Trigger nur noch bei echten offen/zu-Übergängen (from/to); unavailable/unknown und Attribut-Updates lösen nichts mehr aus - Neu (Opt-in, default aus): Türkontakt-Hold — offene Tür (Modus "Offen") bzw. geschlossene Tür (Modus "Zu") hält das Licht; endet der Hold, startet der Ausschalt-Timer neu - Ausschalten nur noch, wenn mind. ein Ziel-Licht an ist - source_url + Versionsheader (Re-Import-Updates), Doku-Hinweise (dedizierter Timer + restore, Sperr-Schalter als Override) - Keine Input-Keys geändert; Bestandsautomationen laufen unverändert Verifikation: yamllint relaxed, CI-Schema-Check, Jinja2-Simulation der echten Templates (9216 Fälle, Invarianten I1-I10, 4 Regressionsstories) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PatLMopfrgXcUDYtp4j8gk
magicx78
marked this pull request as ready for review
July 18, 2026 06:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Beim Blueprint Presence & Light v2 (
blueprints/automation/presence_light.yaml) ging das Licht manchmal unerwartet aus, obwohl jemand anwesend war. Die Logik-Analyse (plus unabhängiges Zweit-Review) hat mehrere konkrete Ursachen im Code bestätigt.Ursachen & Fixes
v_activation_eventignoriert Motion-Events bei Modusoffvollständigv_contact_activewar toter Code)door_contact_hold(defaultfalse= Alt-Verhalten): Modus „Offen" hält bei offener, „Zu" bei geschlossener Tür (Bad); „Beides"/„Aus" halten nie. Endet der Hold, re-armt FALL 2 den Ausschalt-Timer→ unavailable/unknownund Attribut-Updatesdoor_open(off→on) /door_closed(on→off) filtern schon im Triggerv_any_light_on or v_is_dark: Refresh läuft bei brennendem Licht immer, Einschalten bleibt dunkel-gatedv_any_light_on(fremde/verwaiste Timer-Events = No-Op) + Doku (dedizierter Timer, restore, Sperr-Schalter)source_url, keine Versionsource_url+ Versionsheader + Changelog → Re-Import-Updates jetzt möglichKompatibilität
min_versionbleibt2024.6.0, Legacy-Syntax beibehaltenmotion_on/presence_on/door_open/…) — nur in Traces sichtbarVERSION1.5.0 → 1.6.0 (Release-Workflow feuert beim Merge)Verifikation
yamllint -d relaxed+ CI-Schema-Check lokal grünunavailable) gegen 10 Invarianten — u. a. „Modusoff+ Motion-Event ⇒ No-Op", „turn_onnur dunkel + Licht aus", „Hold aktiv ⇒ kein Ausschalten", „ohne Hold exakt Alt-Timing"🤖 Generated with Claude Code
https://claude.ai/code/session_01PatLMopfrgXcUDYtp4j8gk
Generated by Claude Code