Files
HomeAssistantVS/.session_nest_snapshot_20260729.md
T

32 lines
1.5 KiB
Markdown

# Nest Snapshot Session — July 29, 2026
## Goal
Capture still images from Nest cameras (Google Nest SDM API) for AI (Ollama) analysis.
## What Was Built (Previous Session)
Custom integration `nest_snapshot` at `/homeassistant/custom_components/nest_snapshot/`:
- `manifest.json`, `services.yaml`, `__init__.py`
- Uses WebRTC (`aiortc`) to grab one video frame → saves as JPEG
- Test automation `automation.test_nest_snapshot_capture`
## What Was Fixed (This Session)
### Bug: `Nest integration data not available for camera.front_door_front_door`
**Root cause:** The integration was written for an older Nest SDM API. In HA 2026.7:
1. Nest stores runtime data in `entry.runtime_data` (a `NestData` dataclass), **not** in `hass.data["nest"]`
2. Camera entity `unique_id` has a `-camera` suffix, but `device_manager.devices` is keyed by the raw Google device name
**Changes in `__init__.py`:**
- Line 69: Replaced `hass.data.get(NEST_DOMAIN, {}).get(config_entry_id)` with `config_entry.runtime_data`
- Lines 78-81: Added `-camera` suffix stripping before device_manager lookup
## SDP candidate fix (round 3)
- Added `re` import
- Added `_sanitize_sdp()` — inserts missing `1` component ID before `udp` in ICE candidate lines
- Applied `_sanitize_sdp()` to `stream.answer_sdp` before `setRemoteDescription`
- Still pending: restart + test
## To Resume Testing
1. Trigger automation `automation.test_nest_snapshot_capture` or call `nest_snapshot.capture` on `camera.front_door_front_door`
2. Check `/media/` for output file (>10 KB = success, ~1-2 KB = placeholder)