智能家居技能,模拟测试环境,发现设备失败,有请求响应
易康智能科技 发布于2018-10-21 21:45 浏览:1116 回复:8
0
收藏

小度可以正常请求到我的业务服务器,业务服务器也返回了响应的数据,数据如下:

{
    "header": {
        "namespace": "DuerOS.ConnectedHome.Discovery",
        "name": "DiscoverAppliancesRequest",
        "messageId": "87c463814b4b43e0a15477782d73e0bd_0#1_0_Smarthome_5bcc77bcdf4082.07185162",
        "payLoadVersion": 1
    },
    "payload": {
        "discoveredAppliances": [{
                "applianceTypes": ["LIGHT"],
                "applianceId": "0675FF515754727567172642|SPL|47",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "灯",
                "friendlyDescription": "会客室的灯",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState"],
                "manufacturerName": ""
            }, {
                "applianceTypes": ["AIR_CONDITION"],
                "applianceId": "0675FF515754727567172642|AC|77",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "格力空调",
                "friendlyDescription": "会客室的格力空调",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState", "setTemperature", "incrementTemperature", "decrementTemperature", "setFanSpeed", "setMode"],
                "manufacturerName": ""
            }, {
                "applianceTypes": ["TV_SET"],
                "applianceId": "0675FF515754727567172642|TV|78",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "电视机",
                "friendlyDescription": "会客室的电视机",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState", "setTVChannel", "incrementVolume", "decrementVolume", "setVolumeMute"],
                "manufacturerName": ""
            }
        ]
    }
}

看数据格式应该是对的啊,为啥小度提示没有发现设备呢

 

这是测试的场景,顺便吐槽一下,上传图片的时候居然提示这个张图片包含色情,于是我只好把那只天鹅给涂抹了,天鹅已经性感到色情的地步了吗

收藏
点赞
0
个赞
共8条回复 最后由默默注视yzb回复于2019-05-11 17:24
#2DuerOS-河徒回复于2018-10-23

您好,感谢您对DuerOS的关注与支持

DiscoverAppliancesRequest的返回应该是DiscoverAppliancesResponse

返回消息的header.name不对,可以去参考一下资源中心的文档。

祝您开发愉快!

了解最新资讯,请关注微信公众账号:度客俱乐部

参与同行探讨,马上加入QQ交流群:310427350

更多资源获取

常见问题答疑:https://dueros.baidu.com/forum/topic/show/248181

技术文档指南:https://dueros.baidu.com/didp/doc/index

技术视频教程:https://dueros.baidu.com/didp/news/technicalclass

如有商务合作,请发送邮件至邮箱dueros-bd@baidu.com与我们联系。

0
#3137*****108回复于2018-11-06

我也遇到同样的问题了,现在我已经找到问题所在了,是header里面的name写错了,应该是这个 "DiscoverAppliancesResponse"

0
#4易康智能科技回复于2019-02-10

现在我改正确了,还是提示没有发现新设备,麻烦再帮我看看我的响应是否有问题

{
    "header": {
        "namespace": "DuerOS.ConnectedHome.Discovery",
        "name": "DiscoverAppliancesResponse",
        "messageId": "b010b2aa-1c19-49a8-aefe-35452702560d",
        "payloadVersion": 1
    },
    "payload": {
        "discoveredAppliances": [{
                "applianceTypes": ["LIGHT"],
                "applianceId": "0666FF515754727567172626_SPL_18",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "31",
                "friendlyDescription": "ROOM的31",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState"],
                "additionalApplianceDetails": {},
                "manufacturerName": "eKong科技",
                "attributes": []
            }, {
                "applianceTypes": ["LIGHT"],
                "applianceId": "0666FF515754727567172626_SPL_19",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "32",
                "friendlyDescription": "ROOM的32",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState"],
                "additionalApplianceDetails": {},
                "manufacturerName": "eKong科技",
                "attributes": []
            }, {
                "applianceTypes": ["LIGHT"],
                "applianceId": "0666FF515754727567172626_SPL_20",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "33",
                "friendlyDescription": "ROOM的33",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState"],
                "additionalApplianceDetails": {},
                "manufacturerName": "eKong科技",
                "attributes": []
            }, {
                "applianceTypes": ["LIGHT"],
                "applianceId": "0666FF515754727567172626_SPL_21",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "21",
                "friendlyDescription": "ROOM的21",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState"],
                "additionalApplianceDetails": {},
                "manufacturerName": "eKong科技",
                "attributes": []
            }, {
                "applianceTypes": ["LIGHT"],
                "applianceId": "0666FF515754727567172626_SPL_22",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "22",
                "friendlyDescription": "ROOM的22",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState"],
                "additionalApplianceDetails": {},
                "manufacturerName": "eKong科技",
                "attributes": []
            }, {
                "applianceTypes": ["LIGHT"],
                "applianceId": "0666FF515754727567172626_SPL_48",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "主卫照明灯",
                "friendlyDescription": "ROOM的主卫照明灯",
                "isReachable": true,
                "actions": ["turnOn", "turnOff", "getTurnOnState"],
                "additionalApplianceDetails": {},
                "manufacturerName": "eKong科技",
                "attributes": []
            }
        ],
        "discoveredGroups": [{
                "groupName": "ROOM",
                "applianceIds": ["0666FF515754727567172626_SPL_18", "0666FF515754727567172626_SPL_19", "0666FF515754727567172626_SPL_20", "0666FF515754727567172626_SPL_21", "0666FF515754727567172626_SPL_22", "0666FF515754727567172626_SPL_48"],
                "groupNotes": "1楼的ROOM",
                "additionalGroupDetails": {}
            }
        ]
    }
}
0
#5qq3081234197回复于2019-02-11

你好,这是我挂出的一个事例,http://xe.5iu.top,我把回复给dueros的json直接挂里面了,我也不懂没写错怎么识别不了

0
#6易康智能科技回复于2019-02-11

这样也不行,到底哪里错了,要抓狂了,什么破烂的api,有问题也不给出具体的错误,就提示没有发现设备,我明明返回设备了

{
    "header": {
        "namespace": "DuerOS.ConnectedHome.Discovery",
        "name": "DiscoverAppliancesResponse",
        "messageId": "b010b2aa-1c19-49a8-aefe-35452702560d",
        "payloadVersion": 1
    },
    "payload": {
        "discoveredAppliances": [{
                "applianceTypes": ["LIGHT"],
                "applianceId": "0666FF515754727567172626_SPL_18",
                "modelName": "",
                "version": "1.0.0",
                "friendlyName": "测试灯",
                "friendlyDescription": "卧室的测试灯",
                "isReachable": true,
                "actions": [
                    "turnOn",
                    "turnOff",
                    "getTurnOnState"],
                "additionalApplianceDetails": {},
                "manufacturerName": "智能科技",
                "attributes": [
                ]
            }
        ],
        "discoveredGroups": [{
                "groupName": "卧室",
                "applianceIds": [
                    "0666FF515754727567172626_SPL_18"],
                "groupNotes": "卧室",
                "additionalGroupDetails": {}
            }
        ]
    }
}

 

0
#7张龙山4回复于2019-04-11

楼主解决了吗?  我也遇到这问题了。。。。。。。。

0
#8默默注视yzb回复于2019-05-11

楼主messageid跟请求中的对上了吗

楼主可以吧请求也一起贴出来呀

0
#9默默注视yzb回复于2019-05-11

楼主"payloadVersion" 后面的value是这样: "1"

不是: 1

0
TOP