FIWARE IoT代理:如何将位置属性发送到contextBroker实体?

FIWARE IoT代理:如何将位置属性发送到contextBroker实体?,fiware,iot,fiware-orion,Fiware,Iot,Fiware Orion,我想使用MQTT IoT代理将位置信息添加到contextBroker中的实体中。 我按照这个链接这样做 我的问题是属性“location”作为字符串发送给contextBroker,而不是作为“coords” 以下是我发送给MQTT IoT代理的内容: int qos = 1; boolean retain = false; String topic = "myKey/sensorId/location"; String payload= "12.5/14.5"; this.dataSer

我想使用MQTT IoT代理将位置信息添加到contextBroker中的实体中。 我按照这个链接这样做

我的问题是属性“location”作为字符串发送给contextBroker,而不是作为“coords”

以下是我发送给MQTT IoT代理的内容:

int qos = 1;
boolean retain = false;

String topic = "myKey/sensorId/location";
String payload= "12.5/14.5";

this.dataService.publish(topic, position.getBytes(), qos, retain, 2);
我假设contextBroker中的location属性的类型为“coords”,类似于:

{
    "name":"position",
    "type":"coords",
    "value":"33.000,-3.234234",
    "metadatas":[
    {
        "name":"location",
        "type":"string",
        "value":"WGS84"
    }]
}
但我在contextBroker中得到的是:

"location" : {
        "value" : "12.5/14.5",
        "type" : "string",
        "md" : [
            {
                "name" : "TimeInstant",
                "type" : "ISO8601",
                "value" : "2015-11-24T16:26:09.530507"
            }
        ],
        "creDate" : 1448382369,
        "modDate" : 1448382369
    }

我错过了什么?提前感谢您的帮助

我明白了,在开始使用之前,我必须在IoT代理中使用属性“location”注册设备

"attributes": [
        {  "object_id":"location",
           "type": "coords",
           "name":"position"
        } ]

确切地说,您在“MQTT”和“Ultralight”部分的“转换到位置实体…”小节中有完整的描述:

感谢您使用FIWARE