Azure-iot-sdk-csharp: Twin: Provided json is not a valid 'tags' or 'properties' object: arrays are not supported.

Created on 5 Mar 2017  路  4Comments  路  Source: Azure/azure-iot-sdk-csharp

It appears that it arrays are not accommodated on desired properties.
Is this on the roadmap?

-John

question

Most helpful comment

We have similar use cases to the above. As a workaround, we can change how we're storing data in our code, but there are some operations that are vastly easier and cleaner with lists. It's disappointing that this still isn't (never will be?) supported.

All 4 comments

Hi @JohnKozell
Arrays are not supported in Device Twins (you can find details here) and we don't have it in the roadmap yet.
Can you please let us know if that is a blocking issue for you and what scenario you have in mind for the feature.
Thanks

Hi Olivier, sorry for the delay.

My goal would be to minimize the amount of configuration information in the actual device, to provide least cost and maximum agility when reconfiguring devices.
In my case, the device (Raspberry Pi) connects to multiple microcontrollers, each having several sensors. Each of these microcontrollers and sensors are associated with names, hardware addresses, etc. This leads to hierarchical and repeating groups of configuration data.

Here is an simplified example of my configuration data:

{
  "Name": "boiler",
  "Collectors": [
    {
      "Name": "zones",
      "Address": 8,
      "MaxDevices": 8,
      "Devices": [
        {
          "Address": 0,
          "Name": "hotwater",
          "Type": "Valve"
        },
        {
          "Address": 1,
          "Name": "mastbath",
          "Type": "Valve"
        },
        {
          "Address": 2,
          "Name": "attic",
          "Type": "Valve"
        }
      ]
    },
    {
      "Name": "pumps",
      "Address": 9,
      "MaxDevices": 8,
      "Devices": [
        {
          "Address": 0,
          "Name": "pump1",
          "Type": "Pump"
        },
        {
          "Address": 1,
          "Name": "pump2",
          "Type": "Pump"
        },
        {
          "Address": 2,
          "Name": "pump3",
          "Type": "Pump"
        }
      ]
    }
  ]
}

We are facing a similar issue to @JohnKozell .
Essentially, we need to represent a list of units accessible from a module on the edge. Creating a unique setting for each device does not make sense as devices may or may not be available. For the time being, we are considering stringifiying a List to represent a collection and parsing that value out on the edge into a collection.

We have similar use cases to the above. As a workaround, we can change how we're storing data in our code, but there are some operations that are vastly easier and cleaner with lists. It's disappointing that this still isn't (never will be?) supported.

Was this page helpful?
0 / 5 - 0 ratings