tuzhao2 liu
tuzhao2 liu

Reputation: 1

How to implement CameraStream traits through Google local home sdk

We tried the local sdk and handled the SYNC response with otherDeviceIds. The scan config should be ok because our local app already received the IDENTITY request with with expected udp payload. The IDENTITY response should be ok, because the local platform should already passed check the "verificationId", becasuse if I set the verificationId to some string else it says not passed verification.

The problem is when I tried "show the camera", the local fulfilment execute callback function not triggered. In this situation, my firebase cloud funtion still received the "action.devices.commands.GetCameraStream" command.

I tried the lamp straits sample, it looks like it works well. Anyone knowns if the Google local Home sdk support CameraStream traits or NOT.

The following log is the object returned by SYNC in our firebase cloud function, we add "otherDeviceIds": [{"deviceId": "789"}] field, in order to complete the local sdk.

SYNC JSON object:

{ "requestId": "465812xxx029114126", "payload": { "agentUserId": "023XXXXd4d850c01cd16ebb636eb8418", "devices": [{ "id": "123", "traits": ["action.devices.traits.CameraStream"], "name": { "defaultNames": ["xxx CAMERA"], "nicknames": ["Front door"], "name": "Camera" }, "customData": { "fooValue": 88, "barValue": true, "bazValue": "string" }, "attributes": { "cameraStreamSupportedProtocols": ["hls"], "cameraStreamNeedAuthToken": false, "cameraStreamNeedDrmEncryption": false }, "otherDeviceIds": [{ "deviceId": "789" }], "type": "action.devices.types.CAMERA", "willReportState": false }] } } The IDENTITY response should be ok, because the local platform should already passed check the "verificationId".

IDENTIFY request object(Local SDK):

{ "requestId": "XXXXXA5FB895B0CD58C022BDC", "inputs": [{ "intent": "action.devices.IDENTIFY", "payload": { "device": { "udpScanData": { "data": "A562696463373839656D6F64656C6966616B6563616E64796668775F726576656576742D316666775F7265766776312D62657461686368616E6E656C738101" } }, "structureData": {} } }], "devices": [{ "id": "123", "customData": { "barValue": true, "bazValue": "string", "fooValue": 88 } }] } IDENTIFY response object(Local SDK):

{ "intent": "action.devices.IDENTIFY", "requestId": "XXXXX8D0A4A5FB895B0CD58C022BDC", "payload": { "device": { "id": "", "verificationId": "789" } } }

But when I tried "show the camera", the local fulfilment execute callback function not triggered. In this situation,my firebase cloud funtion still received the "action.devices.commands.GetCameraStream" command.

Below is the log when I say "show the camera" my firebase cloud funtion.

{ "inputs": [{ "context": { "locale_country": "US", "locale_language": "en" }, "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "customData": { "barValue": true, "bazValue": "string", "fooValue": 88 }, "id": "123" }], "execution": [{ "command": "action.devices.commands.GetCameraStream", "params": { "StreamToChromecast": true, "SupportedStreamProtocols": ["progressive_mp4", "hls", "dash", "smooth_stream"] } }] }] } }], "requestId": "xxxx366353358387" }

Upvotes: 0

Views: 221

Answers (1)

ToniCorinne
ToniCorinne

Reputation: 538

CameraStream is not currently supported by local fulfillment.

Upvotes: 1

Related Questions