English
English
简体中文
Register
Log In
English
English
简体中文
Register
Log In
Language
English
English
简体中文
Register
Log In

How to solve the issue of "No scenes available" when selecting existing smart scenes?

Last Updated on2025-02-28 07:17:26
Hello, the regular procedure for using the Smart Life SDK is:
1, SDK initialization OK;
2, Account login OK;
3, Call the getHomeList method to get the Home list;
4, You must call the getHomeData method to get the Home detail information, because only after calling the getHomeData method, the attributes in the home instance object will have data;
5, After the above four steps are correct, perform your operation;
If you use the scene function (especially if you are using the scene business package), you still need to get the scene data before using it.
[self.home getHomeDataWithSuccess:^(ThingSmartHomeModel *homeModel) {
// Get scene data in advance
[self loadSceneList];
} failure:^(NSError *error) { }];
- (void)loadSceneList {
// If the one-touch execution and automation list are empty, call the following method in advance in your code:
// If the following code is not written, when using the scene business package, there may be a situation where create scene-->add task-->choose existing smart scene-->data is empty
id<ThingSmartSceneBizProtocol> impl = [[ThingSmartBizCore sharedInstance] serviceOfProtocol:@protocol(ThingSmartSceneBizProtocol)];
[impl getSceneListWithHomeId:[SRHome getCurrentHome].homeId withSuccess:^(NSArray<ThingSmartSceneModel *> * _Nonnull scenes) { } failure:^(NSError * _Nonnull error) { }];
}

Click for services and help

Help Center