Requests: remove device - Ericmas001/Tuya-Api-Tools GitHub Wiki
remove device
- #01: s.m.upgrade.info
- #02: s.m.gw.reset
- #03: tuya.m.device.sub.list
- #04: tuya.m.device.relation.entity.list
- #05: tuya.m.api.batch.invoke
#01: s.m.upgrade.info
POST https://a1.tuyaus.com/api.json?sdkVersion=1.11.11&platform=Galaxy%20Nexus&ttid=sdk_google1@3qp5cfk8c4gyrf3mpmc8&a=s.m.upgrade.info&timeZoneId=America/Atikokan&deviceId=e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff&osSystem=4.4.4&sid=az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75&imei=451746050955683&os=Android&v=2.0&appVersion=2.9.1&lon=-42.4279215&clientId=3qp5cfk8c4gyrf3mpmc8&sign=959f9b803e838cba278ad72408e1f119&lang=en&requestId=7abc756e-a4c5-4100-b3fb-f40eb88433c5&time=1517228725&appRnVersion=2.9&lat=42.4231049&imsi=40895Galaxy75dd HTTP/1.1
I decoded the URL parms into a dictionnary ...
{
"sdkVersion": "1.11.11",
"platform": "Galaxy Nexus",
"ttid": "sdk_google1@3qp5cfk8c4gyrf3mpmc8",
"a": "s.m.upgrade.info",
"timeZoneId": "America/Atikokan",
"deviceId": "e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff",
"osSystem": "4.4.4",
"sid": "az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75",
"imei": "451746050955683",
"os": "Android",
"v": "2.0",
"appVersion": "2.9.1",
"lon": "-42.4279215",
"clientId": "3qp5cfk8c4gyrf3mpmc8",
"sign": "959f9b803e838cba278ad72408e1f119",
"lang": "en",
"requestId": "7abc756e-a4c5-4100-b3fb-f40eb88433c5",
"time": "1517228725",
"appRnVersion": "2.9",
"lat": "42.4231049",
"imsi": "40895Galaxy75dd"
}
User-Agent: TY-UA=APP/Android/2.9.1/SDK/1.11.11
Content-Type: application/x-www-form-urlencoded
Content-Length: 97
Host: a1.tuyaus.com
Connection: Keep-Alive
Accept-Encoding: gzip
REQUEST DATA
postData=%7B%22devId%22%3A%2202200391ecfabc8af177%22%2C%22gwId%22%3A%2202200391ecfabc8af177%22%7D
I applied a URL_DECODE on postData ...
{
"devId": "02200391ecfabc8af177",
"gwId": "02200391ecfabc8af177"
}
RESPONSE
Content-Language: zh-CN
Content-Type: application/json;charset=UTF-8
Date: Mon, 29 Jan 2018 12:25:31 GMT
Server: Apache-Coyote/1.1
Content-Length: 179
Connection: keep-alive
RESPONSE DATA
{
"result": {
"gw": {
"upgradeStatus": 0,
"type": 0,
"currentVersion": "1.0.0"
},
"dev": {
"upgradeStatus": 0,
"type": 9,
"currentVersion": "1.0.0"
}
},
"t": 1517228731780,
"success": true,
"status": "ok"
}
#02: s.m.gw.reset
POST https://a1.tuyaus.com/api.json?sdkVersion=1.11.11&platform=Galaxy%20Nexus&ttid=sdk_google1@3qp5cfk8c4gyrf3mpmc8&a=s.m.gw.reset&timeZoneId=America/Atikokan&deviceId=e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff&osSystem=4.4.4&sid=az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75&imei=451746050955683&os=Android&v=1.0&appVersion=2.9.1&lon=-42.4279215&clientId=3qp5cfk8c4gyrf3mpmc8&sign=059b1a3155a9cdcf69774a134e1f8aa7&lang=en&requestId=6f1a295b-3f1a-4e75-9f03-12da2a434f21&time=1517228782&appRnVersion=2.9&lat=42.4231049&imsi=40895Galaxy75dd HTTP/1.1
I decoded the URL parms into a dictionnary ...
{
"sdkVersion": "1.11.11",
"platform": "Galaxy Nexus",
"ttid": "sdk_google1@3qp5cfk8c4gyrf3mpmc8",
"a": "s.m.gw.reset",
"timeZoneId": "America/Atikokan",
"deviceId": "e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff",
"osSystem": "4.4.4",
"sid": "az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75",
"imei": "451746050955683",
"os": "Android",
"v": "1.0",
"appVersion": "2.9.1",
"lon": "-42.4279215",
"clientId": "3qp5cfk8c4gyrf3mpmc8",
"sign": "059b1a3155a9cdcf69774a134e1f8aa7",
"lang": "en",
"requestId": "6f1a295b-3f1a-4e75-9f03-12da2a434f21",
"time": "1517228782",
"appRnVersion": "2.9",
"lat": "42.4231049",
"imsi": "40895Galaxy75dd"
}
User-Agent: TY-UA=APP/Android/2.9.1/SDK/1.11.11
Content-Type: application/x-www-form-urlencoded
Content-Length: 54
Host: a1.tuyaus.com
Connection: Keep-Alive
Accept-Encoding: gzip
REQUEST DATA
postData=%7B%22gwId%22%3A%2202200391ecfabc8af177%22%7D
I applied a URL_DECODE on postData ...
{
"gwId": "02200391ecfabc8af177"
}
RESPONSE
Content-Language: zh-CN
Content-Type: application/json;charset=UTF-8
Date: Mon, 29 Jan 2018 12:26:27 GMT
Server: Apache-Coyote/1.1
Content-Length: 63
Connection: keep-alive
RESPONSE DATA
{
"result": true,
"t": 1517228787933,
"success": true,
"status": "ok"
}
#03: tuya.m.device.sub.list
POST https://a1.tuyaus.com/api.json?sdkVersion=1.11.11&platform=Galaxy%20Nexus&ttid=sdk_google1@3qp5cfk8c4gyrf3mpmc8&a=tuya.m.device.sub.list&timeZoneId=America/Atikokan&deviceId=e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff&osSystem=4.4.4&sid=az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75&imei=451746050955683&os=Android&v=1.0&appVersion=2.9.1&lon=-42.4279215&clientId=3qp5cfk8c4gyrf3mpmc8&sign=8abffc9ce2a9db5c31ca1f3b2d5899e5&lang=en&requestId=30827d82-ad2c-47f8-9da0-389f498789f7&time=1517228786&appRnVersion=2.9&lat=42.4231049&imsi=40895Galaxy75dd HTTP/1.1
I decoded the URL parms into a dictionnary ...
{
"sdkVersion": "1.11.11",
"platform": "Galaxy Nexus",
"ttid": "sdk_google1@3qp5cfk8c4gyrf3mpmc8",
"a": "tuya.m.device.sub.list",
"timeZoneId": "America/Atikokan",
"deviceId": "e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff",
"osSystem": "4.4.4",
"sid": "az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75",
"imei": "451746050955683",
"os": "Android",
"v": "1.0",
"appVersion": "2.9.1",
"lon": "-42.4279215",
"clientId": "3qp5cfk8c4gyrf3mpmc8",
"sign": "8abffc9ce2a9db5c31ca1f3b2d5899e5",
"lang": "en",
"requestId": "30827d82-ad2c-47f8-9da0-389f498789f7",
"time": "1517228786",
"appRnVersion": "2.9",
"lat": "42.4231049",
"imsi": "40895Galaxy75dd"
}
User-Agent: TY-UA=APP/Android/2.9.1/SDK/1.11.11
Content-Type: application/x-www-form-urlencoded
Content-Length: 58
Host: a1.tuyaus.com
Connection: Keep-Alive
Accept-Encoding: gzip
REQUEST DATA
postData=%7B%22meshId%22%3A%22meebb921f5a09f385811fx%22%7D
I applied a URL_DECODE on postData ...
{
"meshId": "meebb921f5a09f385811fx"
}
RESPONSE
Content-Language: zh-CN
Content-Type: application/json;charset=UTF-8
Date: Mon, 29 Jan 2018 12:26:32 GMT
Server: Apache-Coyote/1.1
Content-Length: 61
Connection: keep-alive
RESPONSE DATA
{
"result": [],
"t": 1517228792543,
"success": true,
"status": "ok"
}
#04: tuya.m.device.relation.entity.list
POST https://a1.tuyaus.com/api.json?sdkVersion=1.11.11&platform=Galaxy%20Nexus&ttid=sdk_google1@3qp5cfk8c4gyrf3mpmc8&a=tuya.m.device.relation.entity.list&timeZoneId=America/Atikokan&deviceId=e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff&osSystem=4.4.4&sid=az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75&imei=451746050955683&os=Android&v=1.0&appVersion=2.9.1&lon=-42.4279215&clientId=3qp5cfk8c4gyrf3mpmc8&sign=ab9831f1991408d5afc67b40fb85fed5&lang=en&requestId=e05b5b7c-32fe-4bdf-bff8-5bbca8d4421e&time=1517228788&appRnVersion=2.9&lat=42.4231049&imsi=40895Galaxy75dd HTTP/1.1
I decoded the URL parms into a dictionnary ...
{
"sdkVersion": "1.11.11",
"platform": "Galaxy Nexus",
"ttid": "sdk_google1@3qp5cfk8c4gyrf3mpmc8",
"a": "tuya.m.device.relation.entity.list",
"timeZoneId": "America/Atikokan",
"deviceId": "e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff",
"osSystem": "4.4.4",
"sid": "az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75",
"imei": "451746050955683",
"os": "Android",
"v": "1.0",
"appVersion": "2.9.1",
"lon": "-42.4279215",
"clientId": "3qp5cfk8c4gyrf3mpmc8",
"sign": "ab9831f1991408d5afc67b40fb85fed5",
"lang": "en",
"requestId": "e05b5b7c-32fe-4bdf-bff8-5bbca8d4421e",
"time": "1517228788",
"appRnVersion": "2.9",
"lat": "42.4231049",
"imsi": "40895Galaxy75dd"
}
User-Agent: TY-UA=APP/Android/2.9.1/SDK/1.11.11
Content-Type: application/x-www-form-urlencoded
Content-Length: 83
Host: a1.tuyaus.com
Connection: Keep-Alive
Accept-Encoding: gzip
REQUEST DATA
postData=%7B%22parentId%22%3A%22meebb921f5a09f385811fx%22%2C%22parentType%22%3A3%7D
I applied a URL_DECODE on postData ...
{
"parentId": "meebb921f5a09f385811fx",
"parentType": 3
}
RESPONSE
Content-Language: zh-CN
Content-Type: application/json;charset=UTF-8
Date: Mon, 29 Jan 2018 12:26:33 GMT
Server: Apache-Coyote/1.1
Content-Length: 61
Connection: keep-alive
RESPONSE DATA
{
"result": {},
"t": 1517228793748,
"success": true,
"status": "ok"
}
#05: tuya.m.api.batch.invoke
POST https://a1.tuyaus.com/api.json?sdkVersion=1.11.11&platform=Galaxy%20Nexus&ttid=sdk_google1@3qp5cfk8c4gyrf3mpmc8&a=tuya.m.api.batch.invoke&timeZoneId=America/Atikokan&deviceId=e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff&osSystem=4.4.4&sid=az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75&imei=451746050955683&os=Android&v=1.0&appVersion=2.9.1&lon=-42.4279215&clientId=3qp5cfk8c4gyrf3mpmc8&sign=feb63a66ad578d449ce24175373868db&lang=en&requestId=60e754cc-0778-46dd-8902-1a5e1d604464&time=1517228790&appRnVersion=2.9&lat=42.4231049&imsi=40895Galaxy75dd HTTP/1.1
I decoded the URL parms into a dictionnary ...
{
"sdkVersion": "1.11.11",
"platform": "Galaxy Nexus",
"ttid": "sdk_google1@3qp5cfk8c4gyrf3mpmc8",
"a": "tuya.m.api.batch.invoke",
"timeZoneId": "America/Atikokan",
"deviceId": "e742886e7bca1f0b6b99d8483ac0003fca13a18b46ff",
"osSystem": "4.4.4",
"sid": "az151693J4610837YCmStUB30c8a1c895d88ec0133b547cc40511b75",
"imei": "451746050955683",
"os": "Android",
"v": "1.0",
"appVersion": "2.9.1",
"lon": "-42.4279215",
"clientId": "3qp5cfk8c4gyrf3mpmc8",
"sign": "feb63a66ad578d449ce24175373868db",
"lang": "en",
"requestId": "60e754cc-0778-46dd-8902-1a5e1d604464",
"time": "1517228790",
"appRnVersion": "2.9",
"lat": "42.4231049",
"imsi": "40895Galaxy75dd"
}
User-Agent: TY-UA=APP/Android/2.9.1/SDK/1.11.11
Content-Type: application/x-www-form-urlencoded
Content-Length: 624
Host: a1.tuyaus.com
Connection: Keep-Alive
Accept-Encoding: gzip
REQUEST DATA
postData=%7B%22apis%22%3A%5B%7B%22a%22%3A%22tuya.m.device.ref.info.my.list%22%2C%22sign%22%3A%222375024a53ae5c4869dd6b6c60f70067%22%2C%22t%22%3A1517228790%2C%22v%22%3A%221.0%22%7D%2C%7B%22a%22%3A%22tuya.m.device.my.list%22%2C%22sign%22%3A%22315f0271e501c27ce7883e372dc41c57%22%2C%22t%22%3A1517228790%2C%22v%22%3A%221.0%22%7D%2C%7B%22a%22%3A%22tuya.m.mesh.my.list%22%2C%22sign%22%3A%221ddea4bc4a3dd7ae2891963ec8ecc98c%22%2C%22t%22%3A1517228790%2C%22v%22%3A%221.0%22%7D%2C%7B%22a%22%3A%22tuya.m.device.group.my.list%22%2C%22sign%22%3A%2217b450908db78b4b742c0e048077bc51%22%2C%22t%22%3A1517228790%2C%22v%22%3A%221.0%22%7D%5D%7D
I applied a URL_DECODE on postData ...
{
"apis": [
{
"a": "tuya.m.device.ref.info.my.list",
"sign": "2375024a53ae5c4869dd6b6c60f70067",
"t": 1517228790,
"v": "1.0"
},
{
"a": "tuya.m.device.my.list",
"sign": "315f0271e501c27ce7883e372dc41c57",
"t": 1517228790,
"v": "1.0"
},
{
"a": "tuya.m.mesh.my.list",
"sign": "1ddea4bc4a3dd7ae2891963ec8ecc98c",
"t": 1517228790,
"v": "1.0"
},
{
"a": "tuya.m.device.group.my.list",
"sign": "17b450908db78b4b742c0e048077bc51",
"t": 1517228790,
"v": "1.0"
}
]
}
RESPONSE
Content-Language: zh-CN
Content-Type: application/json;charset=UTF-8
Date: Mon, 29 Jan 2018 12:26:35 GMT
Server: Apache-Coyote/1.1
Content-Length: 4467
Connection: keep-alive
RESPONSE DATA
{
"result": [
{
"result": [
{
"schemaInfo": {
"schema": "[{\"mode\":\"rw\",\"code\":\"switch_1\",\"name\":\"开关\",\"property\":{\"type\":\"bool\"},\"iconname\":\"icon-dp_power2\",\"id\":1,\"type\":\"obj\",\"desc\":\"\"},{\"mode\":\"rw\",\"code\":\"countdown\",\"name\":\"倒计时\",\"property\":{\"unit\":\"秒\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1,\"type\":\"value\"},\"iconname\":\"icon-dp_time2\",\"id\":11,\"type\":\"obj\",\"desc\":\"可根据产品实际倒计时功能修改。\"},{\"mode\":\"rw\",\"code\":\"randomTime\",\"name\":\"随机定时\",\"property\":{\"type\":\"string\",\"maxlen\":255},\"id\":101,\"type\":\"obj\",\"desc\":\"每6个字节代表 #1开关/#2星期/#3#4起始时间(min)/#5#6结束时间(min),最大42组\"},{\"mode\":\"rw\",\"code\":\"cycleTime\",\"name\":\"循环定时\",\"property\":{\"type\":\"string\",\"maxlen\":255},\"id\":102,\"type\":\"obj\",\"desc\":\"每10个字节代表 #1开关/#2星期/#3#4起始时间(min)/#5#6结束时间(min)/#7#8开启时间(min)/#9#10关闭时间(min)\\n星期:00(单次)01(周日)02(周一)04(周二)08(周三)10(周四)20(周五)40(周六)\"},{\"mode\":\"rw\",\"code\":\"normalTime\",\"name\":\"普通定时\",\"property\":{\"type\":\"string\",\"maxlen\":255},\"id\":103,\"type\":\"obj\",\"desc\":\"每6个字节代表 #1开关/#2星期/#3#4开启时间(min)/#5#6关闭时间(min),最大42组\"}]",
"schemaExt": "[]"
},
"capability": 1,
"uiInfo": {
"phase": "release",
"rnFind": true,
"ui": "00000001uc_0.1.2",
"id": 433338,
"type": "RN"
},
"panelConfig": {
"bic": [
{
"code": "timer",
"selected": true
},
{
"code": "jump_url",
"selected": false
}
]
},
"shortcut": {
"quickOpDps": [
1
],
"faultDps": [],
"displayDps": [
1
],
"switchDp": 1,
"displayMsgs": {
"quickop_dp_switch_1": "Switch",
"quickop_dp_switch_1_on": "ON",
"dp_switch_1_on": "ON",
"dp_switch_1_off": "OFF",
"quickop_dp_switch_1_off": "OFF",
"dp_switch_1": "Switch"
}
},
"i18nTime": 1509939182376,
"id": "4PxSnRXcfvqrIi11",
"attribute": 2944,
"category": "cz",
"supportGroup": true,
"meshCategory": ""
}
],
"a": "tuya.m.device.ref.info.my.list",
"t": 1517228795985,
"success": true,
"v": "1.0",
"status": "ok"
},
{
"result": [
{
"devId": "02200391ecfabc8180cc",
"dpMaxTime": 1517170792569,
"virtual": false,
"productId": "4PxSnRXcfvqrIi11",
"dps": {
"11": 0,
"1": true,
"101": "QVA=",
"102": "QVA=",
"103": "QVA="
},
"activeTime": 1517170787,
"ip": "42.42.42.42",
"lon": "-42.4279215",
"moduleMap": {
"wifi": {
"bv": "5.07",
"cdv": "",
"pv": "2.1",
"verSw": "1.0.0",
"isOnline": true,
"cadv": ""
},
"mcu": {
"cdv": "",
"verSw": "1.0.0",
"isOnline": true,
"cadv": ""
}
},
"uuid": "02200391ecfabc8180cc",
"name": "Stalky sw2",
"isShare": false,
"timezoneId": "America/Toronto",
"iconUrl": "https://images.tuyaus.com/smart/icon/1498529014_0.png",
"lat": "42.4231049",
"runtimeEnv": "prod",
"localKey": "15f80f9621483537"
},
{
"devId": "02200391ecfabc8fa247",
"dpMaxTime": 1517022471865,
"virtual": false,
"productId": "4PxSnRXcfvqrIi11",
"dps": {
"11": 0,
"1": true,
"101": "AP",
"102": "AP",
"103": "AP"
},
"activeTime": 1517022356,
"ip": "42.42.42.42",
"lon": "-42.4279215",
"moduleMap": {
"wifi": {
"bv": "5.07",
"cdv": "",
"pv": "2.1",
"verSw": "1.0.0",
"isOnline": true,
"cadv": ""
},
"mcu": {
"cdv": "",
"verSw": "1.0.0",
"isOnline": true,
"cadv": ""
}
},
"uuid": "02200391ecfabc8fa247",
"name": "Snappy sw4",
"isShare": false,
"timezoneId": "America/Toronto",
"iconUrl": "https://images.tuyaus.com/smart/icon/1498529014_0.png",
"lat": "42.4231049",
"runtimeEnv": "prod",
"localKey": "53ab3e3c48e5a28f"
},
{
"devId": "01200885ecfabc802c01",
"dpMaxTime": 1517022406759,
"virtual": false,
"productId": "4PxSnRXcfvqrIi11",
"dps": {
"11": 0,
"1": true,
"101": "QVA=",
"102": "QVA=",
"103": "QVA="
},
"activeTime": 1517022280,
"ip": "42.42.42.42",
"lon": "-42.4279215",
"moduleMap": {
"wifi": {
"bv": "5.07",
"cdv": "",
"pv": "2.1",
"verSw": "1.0.0",
"isOnline": true,
"cadv": ""
},
"mcu": {
"cdv": "",
"verSw": "1.0.0",
"isOnline": true,
"cadv": ""
}
},
"uuid": "01200885ecfabc802c01",
"name": "Olaf sw3",
"isShare": false,
"timezoneId": "America/Toronto",
"iconUrl": "https://images.tuyaus.com/smart/icon/1498529014_0.png",
"lat": "42.4231049",
"runtimeEnv": "prod",
"localKey": "cfa1fd901557fe8a"
}
],
"a": "tuya.m.device.my.list",
"t": 1517228795947,
"success": true,
"v": "1.0",
"status": "ok"
},
{
"result": [
{
"uid": "fz1516934610837YmStU",
"password": "a1944d364b2149b2",
"code": "tymesh1517015922",
"pv": "2.1",
"name": "tymesh1517015922",
"share": false,
"meshId": "meebb921f5a09f385811fx",
"localKey": "e5b87e7b1c5a9281"
}
],
"a": "tuya.m.mesh.my.list",
"t": 1517228795938,
"success": true,
"v": "1.0",
"status": "ok"
},
{
"result": [],
"a": "tuya.m.device.group.my.list",
"t": 1517228795939,
"success": true,
"v": "1.0",
"status": "ok"
}
],
"t": 1517228795985,
"success": true,
"status": "ok"
}