Missing presets via 'Get Device records' request

In Progress

Comments

2 comments

  • Avatar
    Andrey Terentyev

    Hello,

    Could you please share curl or other code example for both cases, you've described?

    I.e. for the one "with the strange preset behavior" and for the one with "with the expected preset behavior."

    Upon analysis, it has come to my attention that this problem is specific to cameras that possess their own unique identifier, even when creating them with a specific GUID.

    Frankly, I did not get your point.

    However, pay your attention, you should not create camera ID by your own. The camera ID is generate by the Server. You can get all the IDs via the /rest/v1/device endpoint. In the API requests you can pass either id or mac or logicalId, where applicable. For example, in the /rest/v1/devices/{id}

     

    0
    Comment actions Permalink
  • Avatar
    Yuval Avishid

    Hi,

    Thanks for the quick replay.
    Sorry for the confusion. I meant camera presets.

     

    In the end,
    There are two issues:

    1. Creating a preset with specific Guid results in a different ID.
    2. Get Device record doesn't include ptzPresets.

     

     

    Bad case (PTZ cameras with strange preset behaviors):

    I have followed the example in the API /api/ptz/command=CreatePresetPtzCommand
    I pass the desired GUID via presetId, which results in an ID that contains "presetposno".

    API document:

    For those with strange preset behavior when I use /rest/v1/devices/{id}
    The ptzPresets under parameters is missing.

    Please notice,
    I do get the list of the presets via /api/ptz?command=GetPresetsPtzCommand
    But I also want to get them via /rest/v1/devices/{id}

    For example:

    https://127.0.0.1:7001/rest/v1/devices/21651f3a-1c3b-7256-5afc-a6a72cf1f304?_with=parameters.ptzPresets
    {}

     

    But I do have presets,

    https://127.0.0.1:7001/api/ptz?cameraId=21651f3a-1c3b-7256-5afc-a6a72cf1f304&command=GetPresetsPtzCommand
    {
      "error": "0",
      "errorId": "ok",
      "errorString": "",
      "reply": [
        {
          "id": "presetposno1",
          "name": "Home"
        },
        {
          "id": "presetposno2",
          "name": "Saved Position 1k"
        },
        {
          "id": "presetposno3",
          "name": "Saved Position 1"
        },
        {
          "id": "presetposno4",
          "name": "Saved Position 2"
        }
      ]
    }

     

     

    Good case (PTZ cameras with expected preset behaviors):

    Presets are created with a specific GUID I requested. Moreover, I can see the list of ptzPresets via /rest/v1/devices/{id} as desired.

    For example:

    https://127.0.0.1:7001/rest/v1/devices/75ef8f11-5e2f-929c-7e56-e7b6ebf594c2?_with=parameters.ptzPresets
    {
      "parameters": {
        "ptzPresets": {
          "4f0a469d-d037-405d-a57e-7ed98a546173": {
            "data": {
              "position": {
                "pan": -115.59995770454407,
                "tilt": 12.666683495044708,
                "zoom": 53.13010235415598
              },
              "space": "LogicalPtzCoordinateSpace"
            },
            "preset": {
              "id": "4f0a469d-d037-405d-a57e-7ed98a546173",
              "name": "Saved Position 1"
            }
          },
          "c475aee8-a65b-4a26-a190-aa1498181e7d": {
            "data": {
              "position": {
                "pan": -168.10001492500305,
                "tilt": 12.666683495044708,
                "zoom": 53.13010235415598
              },
              "space": "LogicalPtzCoordinateSpace"
            },
            "preset": {
              "id": "c475aee8-a65b-4a26-a190-aa1498181e7d",
              "name": "Saved Position 2"
            }
          }
        }
      }
    }

     

    Thanks,
    Yuval.

    0
    Comment actions Permalink

Please sign in to leave a comment.