TuyaInc / tuyasmart_home_ios_sdk

Tuya Smart iOS Home SDK
https://tuyainc.github.io/tuyasmart_home_ios_sdk_doc
50 stars 19 forks source link

TuyaSmartRequest api not works #31

Closed amacymind closed 4 years ago

amacymind commented 4 years ago

Hello, I used TuyaSmartRequest api 'm.smart.dp.his.stat.get.all' & 'm.smart.dp.his.stat.get.month' for get dpId data. But now its not works. Are you changed anything in it?

TuyaSmartRequest *request = [[TuyaSmartRequest alloc] init]; [request requestWithApiName:@"m.smart.dp.his.stat.get.all" postData:@{@"devId":deviceModel.devId, @"dpId":@"101"} version:@"1.0" success:^(id result) { } or

[request requestWithApiName:@"m.smart.dp.his.stat.get.month" postData:@{@"devId":deviceModel.devId, @"month":@"201909", @"dpId":@"101"} version:@"1.0" success:^(id result){ }

Its gives error like, Error Domain=com.tuya.www Code=1501 "Parameter or Data Error" UserInfo={NSLocalizedDescription=Parameter or Data Error, NSLocalizedFailureReason=PARAMS_ILLEGAL_OR_DATA_ILLEGAL}

TuyaRonbin commented 4 years ago

Can you provide the devId?

amacymind commented 4 years ago

Here's one for my devId: 33730035807d3a478136

TuyaRonbin commented 4 years ago

The device history function needs to have statistical authority, and now it has been opened for you. You can try it.

amacymind commented 4 years ago

No its not still works.

TuyaSmartRequest *request = [[TuyaSmartRequest alloc] init];
[request requestWithApiName:@"m.smart.dp.his.stat.get.all" postData:@{@"devId":@"33730035807d3a478136", @"dpId":@"101"} version:@"1.0" success:^(id result) {
       NSLog(@"result:%@",result);
}failure:^(NSError *error) {
       NSLog(@"error:%@",error);
    }];
xiaochengxuyuan commented 4 years ago

Parameter dpId:101 for 33730035807d3a478136 is a switch dp and its not supported in this interface. i guess you can try dpId:103 for the data you want.

amacymind commented 4 years ago

Yes I want battery status thats why i used 103. But its gives result like,

{
    sum = "0.00";
    thisDay = "0.0";
    years =     {
        2019 =         {
            10 = "0.00";
        };
    };
}

What this means?

xiaochengxuyuan commented 4 years ago

The result is the electricity you used.

amacymind commented 4 years ago

I want device battery status. Just tell me why 'm.smart.dp.his.stat.get.all' & 'm.smart.dp.his.stat.get.month'method not works? Also where is document for that methods previously its shows in tuya doc.

Arclight-Ltd commented 4 years ago

Hi dear, thanks for contacting Tuya, as for your issue, we believe that you may get further support in https://iot.tuya.com/council/chat/ , where you can raise an issue to solve all your problems.

tkhabbab commented 2 years ago

sendVerifyCode failure: Error Domain=com.tuya.www Code=1501 "Permission Verification Failed" UserInfo={NSLocalizedDescription=Permission Verification Failed, NSLocalizedFailureReason=SING_VALIDATE_FALED}

How can i solve this issue