Missing namespace in capability 'carbonDioxideMeasurement'"

I’m learning the platform now and I’m trying to create simple device returning carbon dioxide concentration. However, recently the device stopped to return any value.

My response for state refresh looks like the following:

{
  "headers": {
    "schema": "st-schema",
    "version": "1.0",
    "interactionType": "stateRefreshResponse",
    "requestId": "812a2101-ae7c-486c-8359-8d8fae520df9"
  },
  "deviceState": [
    {
      "externalDeviceId": "external-device-1",
      "states": [
        {
          "component": "main",
          "capability": "carbonDioxideMeasurement",
          "attribute": "carbonDioxide",
          "value": 526
        }
      ]
    }
  ]
}

After that I get the following:

{
  "headers": {
    "schema": "st-schema",
    "version": "1.0",
    "interactionType": "interactionResult",
    "requestId": "812a2101-ae7c-486c-8359-8d8fae520df9"
  },
  "authentication": {
    "tokenType": "Bearer",
    "token": "It's strange you can't see it here. I promise I posted real token"
  },
  "deviceState": [
    {
      "externalDeviceId": "external-device-1",
      "deviceError": [
        {
          "errorEnum": "BAD-RESPONSE",
          "detail": "Missing namespace in capability 'carbonDioxideMeasurement'"
        }
      ]
    }
  ],
  "originatingInteractionType": "stateRefreshResponse"
}

The documentation on this capability does not state any namespace. What am I doing wrong?

Response from refresh using the Groovy IDE? if so, you’re looking at the documentation for the new app, not for the Groovy IDE. So, you’re mixing and matching things together.

No, I’m simply following the documentation for Cloud Connected Devices with webhook. The same code worked few weeks ago.

I’m experiencing the same problem. Seems to be some new namespace requirement but documentation samples not updated?

After a few hours of testing, I could figure it out. The following code worked for me:

device.addState('co2', 'st.carbonDioxideMeasurement', 'carbonDioxide', co2_level);

Apparently, one needs to add “st.” to the beginning of the string.

2 Likes

Hey thanks for this. Updated my code and working now as well. Onward!

1 Like