protect_subscribe_devices
Subscribe to a WebSocket to detect device state changes like recording status, battery drops, or new adoptions. Collect messages for a specified duration (1-30s) with only fields that changed.
Instructions
Connect to the device update WebSocket and collect messages for a specified duration (1-30s). Returns {messages, duration, error?}; each message has {type: 'add'|'update'|'remove', modelKey: 'camera'|'light'|'sensor'|..., id, payload: partial device fields that changed}. Use to detect state changes like isRecording flipping, battery drops, or new devices being adopted — fields delivered are only those that changed, not the full device object.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| duration | No | Seconds to listen (1-30, default 5) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Connection error, if any | |
| duration | No | Actual listen duration in seconds (number) | |
| messages | No | Captured WebSocket messages (add/update/remove or event envelopes) |