『瀚思彼岸』» 智能家居技术论坛
标题:
奥克斯A+ app 空调抓包数据接口
[打印本页]
作者:
liuxiaobo
时间:
2024-8-23 14:30
标题:
奥克斯A+ app 空调抓包数据接口
本帖最后由 liuxiaobo 于 2024-8-25 22:24 编辑
家中使用的奥克斯空调,论坛的MQTT方案不适用,无奈手动抓包,小黄鸟抓包接口数据如下:
1.登录为短信验证,短信请求接口如下:
https://smthomeav.aux-home.com/app/login_sms_code
方法为 POST,请求体为 phone:13xxxxx 手机号
2.短信验证请求接口:
https://smthomeav.aux-home.com/app/wechatMini/loginBySms
方法为 POST,请求体为 phone:13xxxxx 手机号;code:xxxx 验证码
3.登录后获取到Authorization 参数=token值 并包含到请求头中,expireAt应为token有效期时间参数:
"openApiToken": {
"token": "bc18c3b217a34c7b9dfXXXXXXXXXXXXXXXXX",
"expireAt": 1726762443
}
4.获取设备列表接口,确保请求头中包含 Authorization 参数值
https://smthomeav.aux-home.com/app/device_bindings?getStatus=true
获取到的设备列表JSON数据如下(部分私人参数和谐):
{
"code": 200,
"message": "OK",
"data": [
{
"deviceId": "f57cb83f-e9c5-4251-b98e-a81fXXXXXXXXXXX",
"source": 1,
"productKey": "000100XXXXX",
"mac": "E8165XXXXXXXX",
"did": "d500010001XXXXXXX",
"alias": "主卧空调",
"type": null,
"deviceKey": null,
"deviceLock": null,
"password": "b7beXXXXXXXX",
"terminalId": 1,
"subDevice": 0,
"dataOne": "42",
"dataTwo": "90",
"dataThree": "06",
"city": null,
"cityCode": null,
"sn": "",
"longitude": "113.XXXXX",
"latitude": "30.XXXXX",
"modelId": "ea47d0fc-e9f1-4589-8f9d-4XXXXXXXXXXX",
"suitType": 0,
"useType": 0,
"feature": "{\"coolType\":[\"1\",\"0\"],\"frenquency\":[\"1\",\"0\"],\"tempInterval\":[\"0\",\"0\"],\"roomTempDisplay\":[\"1\",\"0\"],\"screen\":[\"2\",\"0\"],\"windSpeed\":[\"2\",\"0\"],\"faultSupport\":[\"0\",\"0\"],\"timing\":[\"0\",\"0\"],\"mode\":[\"0,1,2,3,4\",\"1\"],\"deviceSupport\":[\"0,1,2,3,4,5,6,7,9,10\",\"1\"],\"appSupport\":[\"0,1,2,3,4,5\",\"1\"]}",
"deviceMainUri": "https://smart-home-saas.oss-cn-hangzhou.aliyuncs.com/20181108/img/a2f1873e-c7a8-49ea-bd2c-7005ccf921e3.png",
"entityUri": null,
"userTag": 0,
"wash": true,
"deviceKind": null,
"mcuType": 0,
"sftype": false,
"zeroWindFeel": false,
"address": null,
"transport": null,
"customerFuncs": null,
"thirdDid": null,
"online": true,
"data": {
"wind_child": 0,
"ventilate": 0,
"half": 0,
"wind_speed_1": 6,
"air_con_func": 1,
"power_limit_percent": 0,
"support_heat": 1,
"type": "control_status",
"auto_screen": 0,
"eco": 0,
"temperature_decimal": 0,
"up_down_swing": 7,
"power_limit": 0,
"electric_lock": 0,
"anti_fungus": 0,
"temperature": 29,
"left_right_swing": 1,
"wind_smart": 0,
"ventilate_heap_notify": 0,
"fahrenheit": 0,
"addr": 1,
"wind_far": 0,
"sleep_mode": 0,
"ver": 0,
"electric_heating": 0,
"src": 1,
"comfort_wind": 0,
"freshing": 0,
"wind_ring": 0,
"on_off": 1,
"clean": 0,
"zero_wind_feeling": 0,
"sleep_diy": 0,
"ventilate_auxiliary": 0,
"auto_following_code": 0,
"human_detection": 0,
"screen_on_off": 0,
"healthy": 0,
"following": 0,
"wind_light": 0,
"turbo_silence": 0,
"air_q_light": 0,
"hanging": 1
},
"wifi_hard_version": "2C007100",
"wifi_soft_version": "00071061",
"passcode": "b7beXXXXXX"
}
]
}
5.控制接口和部分控制代码值(请确保请求头中包含 Authorization 参数值):
https://smthomeav.aux-home.com/app/wechatMini/new_device_control
例,空调调整到29.5度:
{
"did": "d500010001e816566b4b98",
"uart": "bb00068000010f000101af2080a0002000002000000000de9b",
"pk": "00010001",
"action": {
"temperature": 295
}
}
作者:
bhc1365
时间:
2024-8-23 18:31
我也是奥克斯空调,有没有接入到hass?接入的话具体怎样做?
作者:
dengxiao
时间:
2024-8-23 21:32
伸手党表示有nodered流程就完美了
作者:
dengxiao
时间:
2024-8-23 21:33
虽然我用空调伴侣,但是APP可以控制到0.5度,更适合实际感受
作者:
liuxiaobo
时间:
2024-8-25 16:34
dengxiao 发表于 2024-8-23 21:32
伸手党表示有nodered流程就完美了
抛砖引玉,留给大神们发挥,看哪位大神心情好直接改写程插件~
作者:
goldstep
时间:
2025-1-23 22:52
同样的是奥克斯A+ app 有大佬写好了吗?
作者:
liuxiaobo
时间:
2025-2-4 21:24
本帖最后由 liuxiaobo 于 2025-2-4 21:25 编辑
dengxiao 发表于 2024-8-23 21:32
伸手党表示有nodered流程就完美了
JSON 代码,可直接导入到 Node - RED 中。请确保在实际使用时,将占位的手机号、验证码、设备 `did` 和 `pk` 等信息替换为真实有效的值。
```json
[
{
"id": "c29c1697.56e9e8",
"type": "inject",
"z": "2797f4c1.8b059e",
"name": "发送短信验证码",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{"phone":"13xxxxx"}",
"payloadType": "json",
"x": 110,
"y": 140,
"wires": [
[
"56c98c0f.d009d4"
]
]
},
{
"id": "56c98c0f.d009d4",
"type": "http request",
"z": "2797f4c1.8b059e",
"name": "",
"method": "POST",
"ret": "txt",
"paytoqs": false,
"url": "https://smthomeav.aux-home.com/app/login_sms_code",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"headers": {},
"x": 300,
"y": 140,
"wires": [
[
"7c9c0f01.15c28c"
]
]
},
{
"id": "7c9c0f01.15c28c",
"type": "debug",
"z": "2797f4c1.8b059e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 480,
"y": 140,
"wires": []
},
{
"id": "f0e75b33.8d0798",
"type": "inject",
"z": "2797f4c1.8b059e",
"name": "登录",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{"phone":"13xxxxx","code":"xxxx"}",
"payloadType": "json",
"x": 110,
"y": 200,
"wires": [
[
"6c978c13.16c99c"
]
]
},
{
"id": "6c978c13.16c99c",
"type": "http request",
"z": "2797f4c1.8b059e",
"name": "",
"method": "POST",
"ret": "json",
"paytoqs": false,
"url": "https://smthomeav.aux-home.com/app/wechatMini/loginBySms",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"headers": {},
"x": 300,
"y": 200,
"wires": [
[
"a58d9725.5c102"
]
]
},
{
"id": "a58d9725.5c102",
"type": "function",
"z": "2797f4c1.8b059e",
"name": "提取并存储token",
"func": "global.set("aux_token", msg.payload.openApiToken.token);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 480,
"y": 200,
"wires": [
[
"d1b4a72d.75529"
]
]
},
{
"id": "d1b4a72d.75529",
"type": "debug",
"z": "2797f4c1.8b059e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 200,
"wires": []
},
{
"id": "d806b960.10c92",
"type": "inject",
"z": "2797f4c1.8b059e",
"name": "获取设备列表",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 260,
"wires": [
[
"c0700d94.9b2768"
]
]
},
{
"id": "c0700d94.9b2768",
"type": "http request",
"z": "2797f4c1.8b059e",
"name": "",
"method": "GET",
"ret": "json",
"paytoqs": false,
"url": "https://smthomeav.aux-home.com/app/device_bindings?getStatus=true",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"headers": {
"Authorization": "{{global.aux_token}}"
},
"x": 300,
"y": 260,
"wires": [
[
"e9d7c00d.7c4918"
]
]
},
{
"id": "e9d7c00d.7c4918",
"type": "debug",
"z": "2797f4c1.8b059e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 480,
"y": 260,
"wires": []
},
{
"id": "a59c9b99.99962",
"type": "inject",
"z": "2797f4c1.8b059e",
"name": "控制设备",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 320,
"wires": [
[
"b37c9d02.990988"
]
]
},
{
"id": "b37c9d02.990988",
"type": "function",
"z": "2797f4c1.8b059e",
"name": "构建控制请求",
"func": "let did = "d500010001e816566b4b98";\nlet pk = "00010001";\nlet action = {"temperature":295};\nmsg.payload = {\n "did": did,\n "uart": "bb00068000010f000101af2080a0002000002000000000de9b",\n "pk": pk,\n "action": action\n};\nmsg.headers = {\n "Authorization": global.get("aux_token")\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 300,
"y": 320,
"wires": [
[
"c17c9e14.99311"
]
]
},
{
"id": "c17c9e14.99311",
"type": "http request",
"z": "2797f4c1.8b059e",
"name": "",
"method": "POST",
"ret": "txt",
"paytoqs": false,
"url": "https://smthomeav.aux-home.com/app/wechatMini/new_device_control",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"headers": {},
"x": 480,
"y": 320,
"wires": [
[
"7c9c0f01.15c28c1"
]
]
},
{
"id": "7c9c0f01.15c28c1",
"type": "debug",
"z": "2797f4c1.8b059e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 320,
"wires": []
}
]
```
**导入流程**:
- 在 Node - RED 界面中,点击菜单中的 `Import` -> `Clipboard`。
- 将上述 JSON 代码粘贴到弹出的对话框中,然后点击 `Import` 按钮,即可导入该流程。
请记住,在实际使用中要根据你的奥克斯账号和设备信息正确配置手机号、验证码、设备 `did` 和 `pk` 等参数,以确保流程能够正常运行。
复制代码
作者:
goldstep
时间:
2025-6-6 14:12
liuxiaobo 发表于 2025-2-4 21:24
多谢大佬,但是这个流导入报错,能否直接给文件,伸手党再次感谢
作者:
xsleaf
时间:
2025-7-4 10:27
官方给我换了新模块,没办法接入这个HA了
作者:
秋雨轩
时间:
2025-9-3 15:55
你的这个API还能用吗?我刚试了第一步短信验证码的请求就回复"code":400,"message":"Bad Request!",是不是官方修改了API?
欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/)
Powered by Discuz! X3.5