I try create a test application for EweLink.
I used Postman and everything matches the description until the moment
I want to change the state of the switch using
https://eu-apia.coolkit.cc/v2/device/thing/status ,
everything is set up the same as in all previous POSTs, but it returns me :
“error”: 4002,
“msg”: “提供的天的”,
“data”: {}
Can you please advise me what I’m doing wrong?
Error code 4002 may indicate one of the following issues:
- Device is offline
- Parameters not following the device protocol
Please check the following:
- Confirm device connectivity status
- Verify parameter formatting complies with the device protocol specifications
- Device is online, I can change status by using EweLink, result is OK
- Parameters in Body is:
{
“type”:1,
“id”:“100243c417”,
“params”:{
“switch”:“off”
}
}
Headers is same as v2/device/thing
I don’t know what I can reapair.
The protocol of this device is multi-channel protocol, so you should pass the parameter control like this, you can try:
“params”:{
“switches”: [
{
“switch”: “off”,
“outlet”: 0
},
{
“switch”: “off”,
“outlet”: 1
},
{
“switch”: “off”,
“outlet”: 2
},
{
“switch”: “off”,
“outlet”: 3
}
]
}
Thank you, now is all OK. Again thanks.