MakerAPI Request - add 'type' to device detail response

Hi,

Not sure where/how to make feature requests to the HE devs.. this is for the MakerAPI.

When I fetch " Get All Devices with Full Details" - I get back a 'type' for each device. However, as discussed in other threads, this API request is VERY slow so I'm not using it. Instead, I'm fetching all devices (w/out full info) and then individually fetching each device by ID.

This works MUCH faster, but the data returned isn't the same

1 field which would be helpful in the individual device response would be the device type. This shouldn't break any existing apps as it's a new JSON field.

"type": "BlinkAPI",

Here's an example why it would be helpful to have this field..

This is a snippet of the FULL response showing a Blink system:

  {
    "name": "Blink",
    "label": "Blink",
    "type": "BlinkAPI",
    "id": "357",
    "date": "2020-09-25T00:51:00+0000",
    "model": null,
    "manufacturer": null,
    "capabilities": [
      "Refresh",
      "Sensor",
      "Actuator"
    ],
    "attributes": {
      "ClientID": null,
      "dataType": "STRING",
      "values": null,
      "Driver": null,
      "Updated": "2020-09-24T00:42:59+00:00",
      "Version": "Patch development 0.1.5 version"
    },
    "commands": [
      {
        "command": "ArmSystem"
      },
      {
        "command": "DisableMotionDetection"
      },
      {
        "command": "DisarmSystem"
      },
      {
        "command": "EnableMotionDetection"
      },
      {
        "command": "GetCameraInfo"
      },
      {
        "command": "GetCameraUsage"
      },
      {
        "command": "GetHomescreen"
      },
      {
        "command": "GetNetworks"
      },
      {
        "command": "GetNotifications"
      },
      {
        "command": "GetVideoEvents"
      },
      {
        "command": "RequestPIN"
      },
      {
        "command": "VerifyPIN"
      },
      {
        "command": "refresh"
      }
    ]
  },

This is the same device returned in the 'by ID' response.. without the 'type' I can't easily determine what type of device this is as there's no special attributes

{
  "id": "357",
  "name": "Blink",
  "label": "Blink",
  "attributes": [
    {
      "name": "ClientID",
      "currentValue": null,
      "dataType": "STRING"
    },
    {
      "name": "Driver",
      "currentValue": null,
      "dataType": "STRING"
    },
    {
      "name": "Updated",
      "currentValue": "2020-09-24T00:42:59+00:00",
      "dataType": "STRING"
    },
    {
      "name": "Version",
      "currentValue": "Patch development 0.1.5 version",
      "dataType": "STRING"
    }
  ],
  "capabilities": [
    "Refresh",
    "Sensor",
    "Actuator"
  ],
  "commands": [
    "ArmSystem",
    "DisableMotionDetection",
    "DisarmSystem",
    "EnableMotionDetection",
    "GetCameraInfo",
    "GetCameraUsage",
    "GetHomescreen",
    "GetNetworks",
    "GetNotifications",
    "GetVideoEvents",
    "RequestPIN",
    "VerifyPIN",
    "refresh"
  ]
}

instead of doing devices/all try using devices/*

devices/all actually has multiple problems (and always has - this isn't new) - it reports back mangled json in some cases, and omits data in other cases. I would avoid using devices/all whenever possible.

oh, and devices/* returns data MUCH faster too.

2 Likes

Holy cr*p.. I missed this reply somehow but just tried it and it does seem a lot faster.. wow, that's crazy how/why this works.. I really wish I found it a long time ago too since I had to deal with all of that mangled JSON data in my app :frowning: .. yuck!

thanks for that huge tip!! Any other MakerAPI hacks that you know of?

joe

1 Like

Not off the top of my head... I messed around with devices/all quirks for a long time until Bruce asked me - Why don't you just do devices/*?

So I really can't even take credit for that one. lol