0

I plan to implement cameraStream base on webRTC. below is the sync response

{
    "requestId": "3436995274582895851",
    "payload": {
        "agentUserId": "9662437",
        "devices": [
                     {
            "id": "1234567",
            "willReportState": true,
            "name": {
                "defaultNames": ["device"],
                "name": "google",
                "nicknames": ["google"]
            },
            "deviceInfo": {
                "manufacturer": "test",
                "model": "test model",
                "hwVersion": "3.2",
                "swVersion": "1.0"
            },
            "type": "action.devices.types.CAMERA",
            "traits": ["action.devices.traits.CameraStream", "action.devices.traits.OnOff", "action.devices.traits.Toggles"],
            "attributes": {
                "cameraStreamSupportedProtocols": ["webrtc"],
                "cameraStreamNeedAuthToken": "true",
                "cameraStreamNeedDrmEncryption": "false"
            }
        }
                 ]
}

When I click on [Home Control] -> [Cameras] -> [google] in Nest Hub, the execute command [action.devices.commands.GetCameraStream] request body is:

{
    "inputs": [{
        "context": {
            "locale_country": "US",
            "locale_language": "en"
        },
        "intent": "action.devices.EXECUTE",
        "payload": {
            "commands": [{
                "devices": [{
                    "id": "1234567"
                }],
                "execution": [{
                    "command": "action.devices.commands.GetCameraStream",
                    "params": {
                        "StreamToChromecast": false,
                        "SupportedStreamProtocols": ["progressive_mp4", "hls", "dash", "smooth_stream"]
                    }
                }]
            }]
        }
    }],
    "requestId": "4201636922257945448"
}

What I want to know is, what's wrong with this process

1 Answers1

0

I’m unable to reproduce your issue via the SYNC response below:

{
   "requestId": "...",
   "payload": {
     "agentUserId": "USER_ID",
     "devices": [
       {
         "id": "camera",
         "type": "action.devices.types.CAMERA",
         "traits": [
           "action.devices.traits.StartStop",
           "action.devices.traits.CameraStream"
         ],
         "name": {
           "name": "My camera"
         },
         "willReportState": false,
         "attributes": {
           "pausable": false,
           "cameraStreamSupportedProtocols": [
             "hls",
             "webrtc",
             "progressive_mp4"
           ],
           "cameraStreamNeedAuthToken": false
         }
       }
     ]
   }
 }

Based on your SYNC response, could you confirm whether it is valid JSON?

Here are two issues:

  • The type of ​​cameraStreamNeedAuthToken, cameraStreamNeedDrmEncryption is boolean, please remove quotes.
  • If you’d like to use OnOff and Toggles traits, please follow our DevSite and add required attributes.

Let me know if it works for you. Thanks!