Skip to content

Release v2.0.0-rc6

Pre-release
Pre-release

Choose a tag to compare

@thekoma thekoma released this 20 Apr 11:57

v2.0.0-rc6 — WebSocket Reconnect Fix, Orphan Cleanup, Blueprints

Critical Fix: WebSocket Push Connection on Integration Reload

The WebSocket push connection — responsible for real-time doorbell ring notifications — would silently die after an integration reload and never reconnect. This meant incoming calls from the intercom were not detected in real time, with no indication that anything was wrong.

Root cause: The WebSocket manager task was started during async_setup_entry() while entry.state was still SETUP_IN_PROGRESS. The manager's while loop condition required ConfigEntryState.LOADED, which was never true at that point, so the task exited immediately without establishing any connection. With Python 3.14's eager task execution model, the background task ran synchronously before async_setup_entry() returned, making the timing window impossible to avoid with simple polling.

Fix: On reload (hass.state == CoreState.running), the WebSocket manager start is now deferred via _deferred_start_websocket(), which polls entry.state until it reaches LOADED before creating the manager task. The fresh boot path (EVENT_HOMEASSISTANT_START listener) is unaffected and continues to work as before.

Impact: After this fix, the push WebSocket will correctly reconnect after integration reloads, HA restarts, and network disruptions. The stale-connection detection (10-minute silence threshold) now has a functioning manager to act on its findings.

Orphaned Entity Cleanup

Added a cleanup_orphaned_entities() utility that automatically removes stale entity registry entries when entities are removed between versions. This is called from all platform setup functions (camera, event, light, lock, sensor) before async_add_entities.

For example, the BticinoVignetteCamera entity was removed in this release (see below). Without orphan cleanup, the old entity would remain in the registry as "unavailable" forever, confusing users. Now it is automatically cleaned up on the next reload.

Camera Improvements

  • Removed BticinoVignetteCamera: The vignette (thumbnail) camera was redundant — the snapshot camera already provides the full-resolution last event image. The vignette entity is automatically removed from the registry via the orphan cleanup mechanism.
  • WebRTC poster images: WebRTC camera entities now display the last call event snapshot as a poster image instead of a blank black frame when idle. The poster is cached by event ID and only updated when a new call event arrives.

Automation Blueprints

Added four ready-to-use Home Assistant automation blueprints:

Blueprint Description
Doorbell Notification Urgent push notification with live snapshot preview and actionable buttons: Answer, Open Door, Reject. Supports Android alarm stream and iOS time-sensitive interruption levels.
Doorbell Auto-Open Automatically opens the door on ring during configurable time windows (e.g., expecting a delivery).
Doorbell Snapshot to Service Forwards the doorbell snapshot to an external service (e.g., Telegram, email) when a ring is detected.
Missed Call Log Logs missed calls to a Home Assistant helper entity for later review.

Documentation

  • CLAUDE.md: Added Call History architecture and Debug Service documentation.
  • README.md: Updated feature list.

Tests

  • Extended media_source tests for HTTP view edge cases.
  • Updated test fixtures for camera entity changes.
  • Added new history store tests.

Full Changelog: v2.0.0-rc4...v2.0.0-rc6