I built a camera device connected via backend to Google Smart home. The camera supports two traits: StartStop and CameraStream. Everything works fine. Then I added Secondary User Verification by a PIN as described in the doc.
To my surprise, the PIN verification flow works well for StartStop trait, but not for CameraStream trait. Here is the flow for CameraStream trait:
User: "Ok Google, start streaming my camera on Chromcast."
Request at background server:
{"inputs":[{"context":{"locale_country":"US","locale_language":"en"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"5Nj7kxkKtKvafh9vIIrh"}],"execution":[{"command":"action.devices.commands.GetCameraStream","params":{"StreamToChromecast":true,"SupportedStreamProtocols":["progressive_mp4","hls","dash","smooth_stream"]}}]}]}}],"requestId":"3521441653474018354"}
Response from backgroud server:
{"requestId":"3521441653474018354","payload":{"commands":[{"ids":["5Nj7kxkKtKvafh9vIIrh"],"status":"ERROR","errorCode":"challengeNeeded","challengeNeeded":{"type":"pinNeeded"}}]}}
Google assistant: "Sorry, it seems that the stream is currently unavailable from XY".
The same sequence works perfectly for trait StartStop: Assistant asks for the PIN and then performs the start/stop action. When I remove PIN verification from the CameraStream trait, it also works fine. The docs claims that
Secondary user verification is supported for all device traits
but it seems to me that PIN verification doesn't work for CameraStream trait. Any ideas? Thank you.
Edit: I am adding the SYNC response:
{"requestId":"418316574813841981","payload":{"agentUserId":"X0ylRhM6yrOG1rVJ9RoPEz12FOR2","devices":[{"id":"5Nj7kxkKtKvafh9vIIrh","type":"action.devices.types.CAMERA","traits":["action.devices.traits.StartStop","action.devices.traits.CameraStream"],"name":{"name":"Camera1"},"willReportState":false,"attributes":{"pausable":false,"cameraStreamSupportedProtocols":["hls"],"cameraStreamNeedAuthToken":false},"deviceInfo":{"manufacturer":"ALIGATOR","model":"S4090","hwVersion":"8.1.0","swVersion":"2.4.3"}}]}}
I use the generic Cast receiver.
The secondary user verification for CameraStream trait is up and running now. Currently secondary user verification is available on all devices and traits compatible with Google Assistant. More information on how to work around enabling the Secondary user verification can be found here.