"error": 4002

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:

  1. Device is offline
  2. Parameters not following the device protocol

Please check the following:

  1. Confirm device connectivity status
  2. Verify parameter formatting complies with the device protocol specifications
  1. Device is online, I can change status by using EweLink, result is OK
  2. 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.

1 Like

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.

Hello,

Sorry, I dont understand this

In my automatic scenas I always find some devices which didn’t execute the routine with the error 4002

I have the ihost with wifi sonoff dual R3 for the curtains

thanks in advance for your support

Hello,

I’m facing an issue everytime that automatic routine is executed.

Error 4002

I have many curtains with sonoff dual R3 connected by wifi. When I open or close all with automatic escene,

I see many times that not all are open/close. When I check the log, I see this:

What can I do to solve it? I need to be sure that all curtains are open or closed when routine is executed

I have ihost hub with zigbee sonoff ZBMINIR2 devices for the lights and wifi sonoff dual r3 for curtains.

All are sincronized in ihost hub

Hi there, was the screenshot from iHost or the eWeLink App?

1 Like

Hello,

I’m facing an issue everytime that automatic routine is executed.

Error 4002

I have many curtains with sonoff dual R3 connected by wifi. When I open or close all with automatic escene,

I see many times that not all are open/close. When I check the log, I see this:

What can I do to solve it? I need to be sure that all curtains are open or closed when routine is executed

I have ihost hub with zigbee sonoff ZBMINIR2 devices for the lights and wifi sonoff dual r3 for curtains.

All are sincronized in ihost hub

1 Like

Hello!

Screenshot is from ewelink app

Error code 4002 indicates your devices are offline so they can’t work according to the scene.

Thanks for your reply

How is it possible that device are ofline if they are always connected to the wifi?

Seems that there are random disconections? How can I check this point? How to be sure that devices are always connected?

Thanks in advance

1 Like

I have disabled the LAN option

Let’s see if they go better in this way

This situation can happen if there are fluctuations in the network. These disconnections are usually very brief — lasting just a few tens or hundreds of milliseconds.
Please observe whether the issue happens repeatedly with specific devices or scenes. If you find that the same devices frequently fail to execute due to being offline, it might be a device-side firmware issue.
In that case, you can take note of the affected devices and the scene names, then submit a support ticket through the eWeLink app via Profile > Help & Feedback > Feedback (top right corner). Our team will look into the device logs for further analysis.

Ok.

Many thanks for your support.

I will send feedback after observation

Gustavo

I’m checkin log details in inhost in the laptop.

I see that Scenes fail many times, wheter manual or automatic.

If I activate manual scene of closing all curtains, many times I find one or several that didn’t work

Also automatic scenes. For example I have light sensor to close the curtain. Today the ligt sensor gave the order of closing. The first time failed…second time succeed.

See pictures below. The mouse is pointing the first time (failed). Next time, 5 seconds later succed.

@KwayLi99 please take a look

1 Like

Hello all!

I would say the issue is with the Scenes module.

Always when selecting the module in the app, it takes quite long to load, most of my scenes fail with error 4002. But at the same time the devices are online. For instance I have a scene which is disabling a device at specific time and sending a message. Unfortunately it fails in 99% of the cases. For test purposes, I have set a schedule for this device at the same time as the scene and it never fails to switch it off for few weeks now.

@eWeLink, please check the method used for module Scenes as it is causing all these troubles to all users and practically makes the scenes option useless. Note that I have multiple scenes with the same issue, but currently turned off as they do not execute properly due to that error.

We currently suspect that there may be an issue with the scene activation functionality, but we have not yet been able to reproduce the situation. Could you please provide us with your logs for analysis? If your device is synced as an add-on to the ihost, we would also appreciate it if you could share the add-on logs.

Thank you for your feedback regarding this issue. We are taking this matter seriously! Could you please also report this issue through the app? This will help us investigate whether the problem is occurring on the app side.