Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xdien opened this issue Feb 22, 2024 · 2 comments

Comments

@xdien
Copy link

xdien commented Feb 22, 2024

Info

  • Device
{
  "device": {
    "defaultMetadata": {},
    "measures": [
      {
        "name": "Heating1",
        "type": "heating"
      },
      {
        "name": "Heating2",
        "type": "heating"
      },
      {
        "name": "Heating3",
        "type": "heating"
      },
      {
        "name": "PowerComsumption",
        "type": "power"
      },
      {
        "name": "WaterTemperature",
        "type": "temperature"
      },
      {
        "name": "OilTemperature",
        "type": "temperature"
      },
      {
        "name": "WaterPumps",
        "type": "active"
      }
    ],
    "metadataMappings": {},
    "model": "DistillSensePro"
  },
  "type": "device"
}
  • Asset
{
  "asset": {
    "defaultMetadata": {},
    "measures": [
      {
        "name": "Heating1",
        "type": "temperature"
      },
      {
        "name": "Heating2",
        "type": "temperature"
      },
      {
        "name": "PowerComsumption",
        "type": "power"
      }
    ],
    "metadataMappings": {},
    "model": "Distillery"
  },
  "engineGroup": "heat-stability",
  "type": "asset"
}

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
Copy link
Contributor

rolljee commented Feb 22, 2024

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.

@rolljee rolljee closed this as completed Feb 22, 2024
@xdien
Copy link
Author

xdien commented Mar 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants