kuzzleio / kuzzle-device-manager

IoT Devices & Assets Management providing digital twins, payload decoding, normalized measures, provisioning. Multi-Tenant ready for white labelled and B2B2C applications.
https://docs.kuzzle.io/official-plugins/device-manager/1
Apache License 2.0
14 stars 6 forks source link

mapping set to strict, dynamic introduction of [value] within [asset.measures.Heating1.values] is not allowed #331

Closed xdien closed 6 months ago

xdien commented 6 months ago

Info

I have created the device/asset and linked together successfully When I try sending payload data

POST http://localhost:7512/_/device-manager/payload/distill-sense-pro
Authorization: Bearer kauth-XXXXX

{
     "deviceEUI": "1",
     "uuid": "XX111",
     "timestamp": "{{$timestamp}}",
     "heating1": "true",
     "heating2": "true",
     "heating3": "false",
     "powerConsumption": "0.5"
}
"errors": [
      {
        "document": {
          "_source": {
            "_kuzzle_info": {
              "author": null,
              "createdAt": 1708609400956,
              "updatedAt": null,
              "updater": null
            },
            "asset": {
              "linkedDevices": [
                {
                  "_id": "DistillSensePro-1",
                  "measureNames": [
                    {
                      "asset": "Heating1",
                      "type": "heating",
                      "device": "Heating1"
                    },
                    {
                      "asset": "Heating2",
                      "type": "heating",
                      "device": "Heating2"
                    },
                    {
                      "asset": "PowerComsumption",
                      "type": "power",
                      "device": "PowerComsumption"
                    }
                  ]
                }
              ],
              "measures": {
                "Heating1": {
                  "measuredAt": 1708609400000,
                  "name": "Heating1",
                  "originId": "DistillSensePro-1",
                  "payloadUuids": [
                    "50a9257b-7596-4d14-b71e-ea98d2975900"
                  ],
                  "type": "heating",
                  "values": {
                    "value": "true"
                  }
                },
                "Heating2": {
                  "measuredAt": 1708609400000,
                  "name": "Heating2",
                  "originId": "DistillSensePro-1",
                  "payloadUuids": [
                    "50a9257b-7596-4d14-b71e-ea98d2975900"
                  ],
                  "type": "heating",
                  "values": {
                    "value": "true"
                  }
                },
                "PowerComsumption": {
                  "measuredAt": 1708609400000,
                  "name": "PowerComsumption",
                  "originId": "DistillSensePro-1",
                  "payloadUuids": [
                    "50a9257b-7596-4d14-b71e-ea98d2975900"
                  ],
                  "type": "power",
                  "values": {
                    "value": "0.5"
                  }
                }
              },
              "metadata": {},
              "model": "Distillery",
              "reference": "1",
              "_kuzzle_info": {
                "author": "kuid-red-andersen-7557",
                "createdAt": 1708608465763,
                "updatedAt": 1708608672561,
                "updater": null
              },
              "lastMeasuredAt": 1708608672000
            },
            "event": {
              "measure": {
                "names": [
                  "Heating1",
                  "Heating2",
                  "PowerComsumption"
                ]
              },
              "name": "measure"
            },
            "id": "Distillery-1",
            "timestamp": 1708609400000
          }
        },
        "reason": "mapping set to strict, dynamic introduction of [value] within [asset.measures.Heating1.values] is not allowed",
        "status": 400
      }

I get the above error but don't know how to resolve it. Thank you

rolljee commented 6 months ago

Hello, rather than create an issue to get help around the usage of the device manager, I suggest you go to our discord server

http://join.discord.kuzzle.io

And ask for help here 😄. Also you could have a look at our documentation https://docs.kuzzle.io/official-plugins/v2.html

Issue here should report only bug, new feature or improvements.

xdien commented 6 months ago

The reason is the measures type in device and asset is different from heating and temperature