Skip to content

Commit 511c316

Browse files
mosandltclaude
andcommitted
raise max_stream_errors — 5 indoor / 10 outdoor
With v10.5.4 self-heal in place a false fallback recovers automatically, so the gradual-counter path can give LOCAL a fairer chance before giving up. Indoor cams get default=5, outdoor cams override to 10 to absorb real WLAN flap + slower encoder init. Watchdog's hard 120s "no healthy HLS output" escalation is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 748a0c8 commit 511c316

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ versions see this file or the [GitHub Releases page](https://github.com/mosandlt
2020
- The status-loop's TCP-ping fast-path actively clears the fallback flag the moment LAN becomes reachable again — the next stream-on attempts LOCAL first instead of going straight to REMOTE. Only fires when `stream_connection_type == "auto"` and a fallback was actually in effect.
2121
- During a *currently running* REMOTE-fallback stream, the same trigger additionally schedules a `try_live_connection(is_renewal=True)` so the live HLS session migrates Cloud → LAN via `Stream.update_source()` without waiting for a re-toggle. Brief (~2-3 s) re-buffer during the swap; LAN failure simply lands back on REMOTE. 5-minute cooldown prevents ping-pong if LAN flaps.
2222

23+
**`max_stream_errors` raised — per-model thresholds.** With self-heal in place a false fallback now recovers automatically, so the gradual-counter path can give LOCAL a fairer chance before giving up. Default bumped from 3 → 5 (indoor / `INDOOR`, `HOME_Eyes_Indoor`, default unknown), explicit override 10 for outdoor models (`OUTDOOR` / `CAMERA_EYES`, `HOME_Eyes_Outdoor` / `CAMERA_OUTDOOR_GEN2`) where real WLAN flap + slower encoder init produce more transient bursts. The watchdog's hard 120 s "no healthy HLS output" path is unchanged — it still forces REMOTE fallback regardless of this counter.
24+
2325
---
2426

2527
## v10.5.3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ stateDiagram-v2
290290
Idle --> REMOTE: ON · mode = remote
291291
Idle --> REMOTE_fallback: ON · auto + LAN down
292292
293-
LOCAL --> REMOTE_fallback: 3 stream errors
293+
LOCAL --> REMOTE_fallback: 5 (indoor) / 10 (outdoor)\nconsecutive stream errors
294294
REMOTE_fallback --> LOCAL: LAN ok · active promotion
295295
296296
LOCAL --> Idle: OFF

custom_components/bosch_shc_camera/models.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ class CameraModelConfig:
4747
# Bosch app uses ~1s. Outdoor needs more aggressive keepalive.
4848

4949
# ── Fallback / error recovery ────────────────────────────────────────
50-
max_stream_errors: int = 3 # After this many consecutive FFmpeg errors, fall back to REMOTE
50+
# Consecutive FFmpeg errors before AUTO mode falls back to REMOTE.
51+
# Bumped from a flat 3 to per-model values in v10.5.4: with the active-
52+
# promotion + counter-decay self-heal in place, false fallbacks recover
53+
# automatically, so the gradual-counter path can be more tolerant before
54+
# giving up on LOCAL. Indoor cameras are stable on a wired-equivalent
55+
# WLAN and rarely produce real bursts; outdoor cameras see real WLAN
56+
# flakiness + slower encoder init and benefit from a higher tolerance.
57+
# The watchdog's hard 120 s "no healthy HLS output" path is unaffected
58+
# — it still forces fallback regardless of this counter.
59+
max_stream_errors: int = 5
5160
min_wifi_for_local: int = 40 # Minimum WiFi signal % to attempt LOCAL (below → use REMOTE)
5261

5362
# ── Snapshots ────────────────────────────────────────────────────────
@@ -99,6 +108,7 @@ class CameraModelConfig:
99108
max_session_duration=3600,
100109
heartbeat_interval=10,
101110
snapshot_warmup=5,
111+
max_stream_errors=10, # outdoor: real WLAN flap + slower encoder
102112
),
103113
}
104114

@@ -139,6 +149,7 @@ class CameraModelConfig:
139149
max_session_duration=3600,
140150
heartbeat_interval=3600,
141151
snapshot_warmup=5,
152+
max_stream_errors=10, # outdoor: real WLAN flap + slower encoder
142153
)
143154
MODELS["CAMERA_OUTDOOR_GEN2"] = MODELS["HOME_Eyes_Outdoor"]
144155

0 commit comments

Comments
 (0)