Hi,
I am trying to make C code for an ESP32 which contains an air quality sensor. I am trying to use the capability airQualitySensor.
My st-device-sdk-c-ref repo is in master branch:
6ec0fe5 (HEAD → master, origin/master, origin/HEAD) doc: getting_started: update smartthings docs link
The iot-core library is in master branch as well:
03bdb61 (HEAD, origin/master_rel_1_7_5) Update CHANGELOG.md until v1.7.5
The error only happens on the air quality sensor, since the other capabilities are ok and are displayed on my Smartthings APP. Here is a good example:
[IoT]: st_cap_send_attr(613) > publish event, topic : /v1/deviceEvents/d559d1a6-d73f-49a0-b5f1-5d9b28c92d41, payload :
{“deviceEvents”:[{“component”:“main”,“capability”:“relativeHumidityMeasurement”,“attribute”:“humidity”,“value”:48.65,“unit”:“%”,“providerData”:{“sequenceNumber”:5,“timestamp”:“1675893682182”}}]}e[0m
Here is the example with the airQualitySensor and the error:
[IoT]: st_cap_send_attr(613) > publish event, topic : /v1/deviceEvents/d559d1a6-d73f-49a0-b5f1-5d9b28c92d41, payload :
{“deviceEvents”:[{“component”:“main”,“capability”:“airQualitySensor”,“attribute”:“airQuality”,“value”:60,“unit”:“I”,“providerData”:{“sequenceNumber”:13,“timestamp”:“1675893802509”}}]}e[0m
[IoT]: _iot_parse_noti_data(649) > payload : {“error”:{“requestId”:“ca56f6ef-7e40-4583-86df-0c121345db5b”,“error”:{“code”:“ConstraintViolationError”,“message”:“The request is malformed.”,“details”:[{“code”:“NotValidValue”,“target”:“deviceEvents[0].capability”,“message”:“airQualitySensor is not a valid value.”}]}},“target”:“d559d1a6-d73f-49a0-b5f1-5d9b28c92d41”,“event”:“error”,“source”:“device-backend”,“category”:“platform”}e[0m
My device config file has the following content:
{
“mnmn”: ,
“vid”: ,
“version”: “0.0.1”,
“type”: “profile”,
“dashboard”: {
“states”: ,
“actions”: [
{
“component”: “main”,
“capability”: “switch”,
“version”: 1,
“idx”: 0,
“group”: “main”
}
]
},
“detailView”: [
{
“component”: “main”,
“capability”: “healthCheck”,
“version”: 1,
“values”: ,
“patch”:
},
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”:
},
{
“component”: “main”,
“capability”: “relativeHumidityMeasurement”,
“version”: 1,
“values”: ,
“patch”:
},
{
“component”: “main”,
“capability”: “airQualitySensor”,
“version”: 1,
“values”: ,
“patch”:
},
{
“component”: “main”,
“capability”: “switch”,
“version”: 1,
“values”: ,
“patch”:
},
{
“component”: “main”,
“capability”: “firmwareUpdate”,
“version”: 1,
“values”: ,
“patch”:
}
],
“automation”: {
“conditions”: [
{
“component”: “main”,
“capability”: “healthCheck”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
},
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
},
{
“component”: “main”,
“capability”: “relativeHumidityMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
},
{
“component”: “main”,
“capability”: “airQualitySensor”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
},
{
“component”: “main”,
“capability”: “switch”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
},
{
“component”: “main”,
“capability”: “firmwareUpdate”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
}
],
“actions”: [
{
“component”: “main”,
“capability”: “healthCheck”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
},
{
“component”: “main”,
“capability”: “switch”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
},
{
“component”: “main”,
“capability”: “firmwareUpdate”,
“version”: 1,
“values”: ,
“patch”: ,
“exclusion”:
}
]
},
“migration”: true
}
Dear ST developers, may I please have some help on finding the cause of this error please ?