Commit 45fce4b7 authored by chen.weican's avatar chen.weican

【修改内容】修改空调内机的数据同步

【提交人】陈伟灿
parent 0bc4dfcd
...@@ -9,7 +9,7 @@ cJSON *old_ccu_msg_build_json(const char* nodeid,const char* opcode,const char* ...@@ -9,7 +9,7 @@ cJSON *old_ccu_msg_build_json(const char* nodeid,const char* opcode,const char*
cJSON *old_ccu_msg_build(const char* nodeid,const char* opcode,const char* status,const char* arg); cJSON *old_ccu_msg_build(const char* nodeid,const char* opcode,const char* status,const char* arg);
int send_msg_to_module(cJSON *root); int send_msg_to_module(cJSON *root);
cJSON * val_conver_new2old(cJSON *newccuItem,cJSON *oldccuItem,int syn_type);
int arming_status_notify(int type); int arming_status_notify(int type);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define PRODUCT_TPYE "kk" #define PRODUCT_TPYE "kk"
#define CCU_LAN "eth1" #define CCU_LAN "eth1"
#define KK_CCU_ID "CCU_77770" #define KK_CCU_ID "CCU_77771"
#define KK_CCU_PRODUCTID "ccu_n12" #define KK_CCU_PRODUCTID "ccu_n12"
#define KK_GW_PRODUCTID "gateway_2" #define KK_GW_PRODUCTID "gateway_2"
#define KK_CCU_RANDOM "0000000000" #define KK_CCU_RANDOM "0000000000"
......
...@@ -410,6 +410,36 @@ int kk_get_device_name(const char* deviceCode,const char *epNum,char *devName,in ...@@ -410,6 +410,36 @@ int kk_get_device_name(const char* deviceCode,const char *epNum,char *devName,in
_kk_area_unlock(); _kk_area_unlock();
return isGet; return isGet;
} }
int kk_get_device_roomInfo(const char* deviceCode,int epNum,char *roomName,char *roomId)
{
int isGet = 0;
char *sqlCmd = NULL;
char *proomName = NULL;
char *proomId = NULL;
sqlite3_stmt *stmt;
kk_area_ctx_t *ctx = _kk_area_get_ctx();
const char *searchCmd = "select * from AreaDevInfo where deviceCode = '%s' and epNum = '%d';";
_kk_area_lock();
sqlCmd = sqlite3_mprintf(searchCmd,deviceCode,epNum);
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
proomName = (char*)sqlite3_column_text(stmt, DB_DEV_ROOM_NAME);
proomId = (char*)sqlite3_column_text(stmt, DB_DEV_ROOM_ID);
if(strlen(proomName) < 256){
memcpy(roomName,proomName,strlen(proomName));
}else{
memcpy(roomName,proomName,255);
}
memcpy(roomId,proomId,strlen(proomId));
isGet = 1;
}
//INFO_PRINT("\n");
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
_kk_area_unlock();
return isGet;
}
int kk_room_dev_remove(const char *deviceCode,const char *epNum) int kk_room_dev_remove(const char *deviceCode,const char *epNum)
{ {
int res = 0; int res = 0;
......
...@@ -34,7 +34,7 @@ int kk_get_device_name(const char* deviceCode,const char *epNum,char *devName,in ...@@ -34,7 +34,7 @@ int kk_get_device_name(const char* deviceCode,const char *epNum,char *devName,in
int kk_room_update_armingstate(int state,const char *roomid); int kk_room_update_armingstate(int state,const char *roomid);
int kk_get_room_armingstate(const char* roomId); int kk_get_room_armingstate(const char* roomId);
int kk_get_roomId_by_deviceCode(const char* deviceCode,const char *epNum,char *roomId,int size); int kk_get_roomId_by_deviceCode(const char* deviceCode,const char *epNum,char *roomId,int size);
int kk_get_device_roomInfo(const char* deviceCode,int epNum,char *roomName,char *roomId);
#endif #endif
...@@ -292,9 +292,10 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA ...@@ -292,9 +292,10 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA
else{ else{
return FAIL_RETURN; return FAIL_RETURN;
} }
dm_mgr_properities_db_create(node->dev_shadow,deviceCode,dev_type);
INIT_LIST_HEAD(&node->linked_list); INIT_LIST_HEAD(&node->linked_list);
list_add_tail(&node->linked_list, &ctx->dev_list); list_add_tail(&node->linked_list, &ctx->dev_list);
dm_mgr_properities_db_create(node->dev_shadow,deviceCode,dev_type);
if(dev_type == KK_DM_DEVICE_CCU){ if(dev_type == KK_DM_DEVICE_CCU){
_dm_init_tsl_params(node->dev_shadow,node->deviceCode); _dm_init_tsl_params(node->dev_shadow,node->deviceCode);
......
...@@ -446,6 +446,9 @@ static int kk_service_addDeviceToRoom_reply(cJSON *param,cJSON *msgId) ...@@ -446,6 +446,9 @@ static int kk_service_addDeviceToRoom_reply(cJSON *param,cJSON *msgId)
static int kk_service_addDeviceToRoom_handle(cJSON *params) static int kk_service_addDeviceToRoom_handle(cJSON *params)
{ {
char epNumStr[10] = {0}; char epNumStr[10] = {0};
int isAirGwFlag = 0;
int res = 0;
dm_mgr_dev_node_t *node = NULL;
if(params == NULL){ if(params == NULL){
return INVALID_PARAMETER; return INVALID_PARAMETER;
} }
...@@ -466,13 +469,36 @@ static int kk_service_addDeviceToRoom_handle(cJSON *params) ...@@ -466,13 +469,36 @@ static int kk_service_addDeviceToRoom_handle(cJSON *params)
if(deviceCode == NULL){ if(deviceCode == NULL){
return FAIL_RETURN; return FAIL_RETURN;
} }
res = dm_mgr_get_device_by_devicecode((char*)deviceCode->valuestring,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
cJSON *epNum = cJSON_GetObjectItem(params, MSG_AREA_ROOM_EPNUM); cJSON *epNum = cJSON_GetObjectItem(params, MSG_AREA_ROOM_EPNUM);
if(epNum == NULL){ if(epNum == NULL){
if(strcmp(node->productType,KK_DM_AIR_GATEWAY_TYPE) == 0){
isAirGwFlag = 1;
}
strcpy(epNumStr,"1"); strcpy(epNumStr,"1");
}else{ }else{
strcpy(epNumStr,epNum->valuestring); strcpy(epNumStr,epNum->valuestring);
} }
kk_room_dev_add(roomId->valuestring,room_name->valuestring,deviceCode->valuestring,epNumStr,dev_name->valuestring); kk_room_dev_add(roomId->valuestring,room_name->valuestring,deviceCode->valuestring,epNumStr,dev_name->valuestring);
//内机默认添加到跟网关同个房间
if(strcmp(node->productType,KK_DM_AIR_GATEWAY_TYPE) == 0 && isAirGwFlag){
int eplist[64] = {0};
char name[128] = {0};
int i = 0;
int count = kk_indoorAir_query_epnums(deviceCode->valuestring,eplist);
for(i = 0; i < count; i++){
memset(epNumStr,0x0,sizeof(epNumStr));
memset(name,0x0,sizeof(name));
sprintf(epNumStr,"%d",eplist[i]);
sprintf(name,"空调%d",eplist[i]);
kk_room_dev_add(roomId->valuestring,room_name->valuestring,deviceCode->valuestring,epNumStr,name);
}
}
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
/************************************************************ /************************************************************
...@@ -585,220 +611,7 @@ static int kk_service_executeRoom_handle(cJSON *params) ...@@ -585,220 +611,7 @@ static int kk_service_executeRoom_handle(cJSON *params)
kk_free_room_dev_list(); kk_free_room_dev_list();
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
#if 0
static int kk_service_setLocalTimer_handle(cJSON *params,const char *deviceCode)
{
int res = 0;
kk_dev_list_t *pList = NULL;
dm_mgr_dev_node_t *search_node = NULL;
char *timer = NULL,*targets = NULL;
int isEnable = 0, isValid = 0, zoneOffset = 0;
int size = 0 ;
if(params == NULL || deviceCode == NULL){
return INVALID_PARAMETER;
}
res = dm_mgr_get_device_by_devicecode(deviceCode,&search_node);
if (res < SUCCESS_RETURN) {
ERROR_PRINT("dm_mgr_get_device_by_devicecode failed\n");
return res;
}
size = kk_service_get_array_size(search_node->dev_shadow);
cJSON *LocalTimerArray = cJSON_GetObjectItem(params, MSG_TIMER_SETLOCALTIMER_LOCALTIMER);
if(LocalTimerArray == NULL){
return FAIL_RETURN;
}
cJSON * item = LocalTimerArray->child;
while(item != NULL){
timer = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_TIMER)->valuestring;
isEnable = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_ENABLE)->valueint;
isValid = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_ISVALID)->valueint;
zoneOffset = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_ZONEOFFSET)->valueint;
targets = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_TARGETS)->valuestring;
kk_service_localtimer_set(search_node->dev_shadow,timer,isEnable,isValid,zoneOffset,targets,size);
item = item->next;
}
return SUCCESS_RETURN;
}
static int kk_service_getLocalTimer_handle(const char *deviceCode)
{
if(deviceCode == NULL){
return INVALID_PARAMETER;
}
dm_msg_thing_service_post(deviceCode,MSG_TIMER_GETLOCALTIMER_GETLOCALTIMER);
return SUCCESS_RETURN;
}
static int kk_service_setCountDown_handle(cJSON *params,const char *deviceCode)
{
int res = 0;
kk_dev_list_t *pList = NULL;
dm_mgr_dev_node_t *search_node = NULL;
char *targets = NULL;
int isEnable = 0, isValid = 0, delaytimer = 0,current = 0;
int size = 0 ;
if(params == NULL || deviceCode == NULL){
return INVALID_PARAMETER;
}
res = dm_mgr_get_device_by_devicecode(deviceCode,&search_node);
if (res < SUCCESS_RETURN) {
ERROR_PRINT("dm_mgr_get_device_by_devicecode failed\n");
return res;
}
size = kk_service_get_array_size(search_node->dev_shadow);
cJSON *LocalTimerArray = cJSON_GetObjectItem(params, MSG_TIMER_SETCOUNTDOWN_COUNTDOWN);
if(LocalTimerArray == NULL){
return FAIL_RETURN;
}
cJSON * item = LocalTimerArray->child;
while(item != NULL){
delaytimer = cJSON_GetObjectItem(item,MSG_TIMER_SETCOUNTDOWN_DELAYTIME)->valueint;
current = cJSON_GetObjectItem(item,MSG_TIMER_SETCOUNTDOWN_CURRENTTIME)->valueint;
isValid = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_ISVALID)->valueint;
isEnable = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_ENABLE)->valueint;
targets = cJSON_GetObjectItem(item,MSG_TIMER_SETLOCALTIMER_TARGETS)->valuestring;
kk_service_setCountDown_set(search_node->dev_shadow,delaytimer,current,isEnable,isValid,targets,size);
item = item->next;
}
return SUCCESS_RETURN;
}
static int kk_service_getCountDown_handle(const char *deviceCode)
{
if(deviceCode == NULL){
return INVALID_PARAMETER;
}
dm_msg_thing_service_post(deviceCode,MSG_TIMER_SETCOUNTDOWN_GETCOUNTDOWN);
return SUCCESS_RETURN;
}
static int kk_service_getLockKeylist_handle(const char *deviceCode)
{
if(deviceCode == NULL){
return INVALID_PARAMETER;
}
return SUCCESS_RETURN;
}
static int kk_service_addKey_handle(const char *deviceCode,cJSON *param)
{
char keyId[32] = {0};
int res = 0;
dm_mgr_dev_node_t *node = NULL;
if(deviceCode == NULL || param == NULL){
return INVALID_PARAMETER;
}
res = dm_mgr_get_device_by_devicecode(deviceCode, &node);
if (res < SUCCESS_RETURN) {
ERROR_PRINT("dm_mgr_get_device_by_devicecode failed\n");
return res;
}
cJSON *KeyType = cJSON_GetObjectItem(param,MSG_KEYADD_KEYTYPE);
if(KeyType == NULL) return FAIL_RETURN;
cJSON *KeyRole = cJSON_GetObjectItem(param,MSG_KEYADD_KEYROLE);
if(KeyRole == NULL) return FAIL_RETURN;
cJSON *IsValid = cJSON_GetObjectItem(param,MSG_KEYADD_KEYISVALID);
if(IsValid == NULL) return FAIL_RETURN;
cJSON *KeyName = cJSON_GetObjectItem(param,MSG_KEYADD_KEYNAME);
if(KeyName == NULL) return FAIL_RETURN;;
cJSON *KeyEffectiveTime = cJSON_GetObjectItem(param,MSG_KEYADD_KEYEFFECTIVE);
if(KeyEffectiveTime == NULL) return FAIL_RETURN;;
cJSON *KeyExpiryTime = cJSON_GetObjectItem(param,MSG_KEYADD_KEYEXPIRE);
if(KeyExpiryTime == NULL) return FAIL_RETURN;;
HAL_GetTime_s(keyId);
kk_property_update_lockkeys(deviceCode,keyId,KeyType->valueint,KeyRole->valueint,IsValid->valueint,
KeyName->valuestring,KeyEffectiveTime->valueint,KeyExpiryTime->valueint);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYADD_NOTIFICATION_KEYID,NULL,keyId);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYADD_NOTIFICATION_KEYTYPE,&KeyType->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYADD_NOTIFICATION_KEYROLE,&KeyRole->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYADD_NOTIFICATION_KEYISVALID,&IsValid->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYADD_NOTIFICATION_KEYNAME,NULL,KeyName->valuestring);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYADD_NOTIFICATION_KEYEFFECTIVE,&IsValid->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYADD_NOTIFICATION_KEYEXPIRE,&IsValid->valueint,NULL);
dm_msg_thing_event_post(deviceCode,MSG_KEYADD_NOTIFICATION);
return SUCCESS_RETURN;
}
static int kk_service_modifyKey_handle(const char *deviceCode,cJSON *param)
{
int res = 0;
dm_mgr_dev_node_t *node = NULL;
if(deviceCode == NULL || param == NULL){
return INVALID_PARAMETER;
}
res = dm_mgr_get_device_by_devicecode(deviceCode, &node);
if (res < SUCCESS_RETURN) {
ERROR_PRINT("dm_mgr_get_device_by_devicecode failed\n");
return res;
}
cJSON *keyId = cJSON_GetObjectItem(param,MSG_KEYADD_KEYID);
if(keyId == NULL) return FAIL_RETURN;
cJSON *KeyType = cJSON_GetObjectItem(param,MSG_KEYADD_KEYTYPE);
if(KeyType == NULL) return FAIL_RETURN;
cJSON *KeyRole = cJSON_GetObjectItem(param,MSG_KEYADD_KEYROLE);
if(KeyRole == NULL) return FAIL_RETURN;
cJSON *IsValid = cJSON_GetObjectItem(param,MSG_KEYADD_KEYISVALID);
if(IsValid == NULL) return FAIL_RETURN;
cJSON *KeyName = cJSON_GetObjectItem(param,MSG_KEYADD_KEYNAME);
if(KeyName == NULL) return FAIL_RETURN;;
cJSON *KeyEffectiveTime = cJSON_GetObjectItem(param,MSG_KEYADD_KEYEFFECTIVE);
if(KeyEffectiveTime == NULL) return FAIL_RETURN;;
cJSON *KeyExpiryTime = cJSON_GetObjectItem(param,MSG_KEYADD_KEYEXPIRE);
if(KeyExpiryTime == NULL) return FAIL_RETURN;;
kk_property_update_lockkeys(deviceCode,keyId->valuestring,KeyType->valueint,KeyRole->valueint,IsValid->valueint,
KeyName->valuestring,KeyEffectiveTime->valueint,KeyExpiryTime->valueint);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYMODIFY_NOTIFICATION_KEYID,NULL,keyId->valuestring);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYMODIFY_NOTIFICATION_KEYTYPE,&KeyType->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYMODIFY_NOTIFICATION_KEYROLE,&KeyRole->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYMODIFY_NOTIFICATION_KEYISVALID,&IsValid->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYMODIFY_NOTIFICATION_KEYNAME,NULL,KeyName->valuestring);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYMODIFY_NOTIFICATION_KEYEFFECTIVE,&IsValid->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYMODIFY_NOTIFICATION_KEYEXPIRE,&IsValid->valueint,NULL);
dm_msg_thing_event_post(deviceCode,MSG_KEYMODIFY_NOTIFICATION);
return SUCCESS_RETURN;
}
static int kk_service_deleteKey_handle(const char *deviceCode,cJSON *param)
{
int res = 0;
dm_mgr_dev_node_t *node = NULL;
if(deviceCode == NULL || param == NULL){
return INVALID_PARAMETER;
}
res = dm_mgr_get_device_by_devicecode(deviceCode, &node);
if (res < SUCCESS_RETURN) {
ERROR_PRINT("dm_mgr_get_device_by_devicecode failed\n");
return res;
}
cJSON *KeyType = cJSON_GetObjectItem(param,MSG_KEYADD_KEYTYPE);
if(KeyType == NULL) return FAIL_RETURN;
cJSON *KeyRole = cJSON_GetObjectItem(param,MSG_KEYADD_KEYROLE);
if(KeyRole == NULL) return FAIL_RETURN;
cJSON *keyId = cJSON_GetObjectItem(param,MSG_KEYADD_KEYID);
if(keyId == NULL) return FAIL_RETURN;
kk_property_delete_lockkeys(deviceCode,keyId->valuestring);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYDELETE_NOTIFICATION_KEYID,NULL,keyId->valuestring);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYDELETE_NOTIFICATION_KEYTYPE,&KeyType->valueint,NULL);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_KEYDELETE_NOTIFICATION_KEYROLE,&KeyRole->valueint,NULL);
dm_msg_thing_event_post(deviceCode,MSG_KEYDELETE_NOTIFICATION);
return SUCCESS_RETURN;
}
#endif
/************************************************************ /************************************************************
*功能描述:添加场景处理 *功能描述:添加场景处理
*输入参数:params:云端下发数据,包含场景名称,场景类型,场景使能等 *输入参数:params:云端下发数据,包含场景名称,场景类型,场景使能等
......
...@@ -179,6 +179,42 @@ static int _kk_check_property_exist(const char* deviceCode,const char* identifie ...@@ -179,6 +179,42 @@ static int _kk_check_property_exist(const char* deviceCode,const char* identifie
_kk_property_db_unlock(); _kk_property_db_unlock();
return isExist; return isExist;
} }
char *human_induction_device[] = {
(char*){"3049"},
(char*){"3042"},
(char*){"3053"},
(char*){"3043"},
};
char *door_induction_device[] = {
(char*){"3045"},
(char*){"3050"},
(char*){"3051"},
(char*){"3070"},
};
static int _kk_check_human_induction_device(char *productCode){
int i = 0;
int num = sizeof(human_induction_device)/sizeof(char *);
for(i =0; i < num; i++){
if(strcmp(productCode,human_induction_device[i]) == 0)
{
return 1;
}
}
return 0;
}
static int _kk_check_door_induction_device(char *productCode){
int i = 0;
int num = sizeof(door_induction_device)/sizeof(char *);
for(i =0; i < num; i++){
if(strcmp(productCode,door_induction_device[i]) == 0)
{
return 1;
}
}
return 0;
}
/************************************************************ /************************************************************
*功能描述: 插入属性到数据库 *功能描述: 插入属性到数据库
*输入参数: deviceCode:设备deviceCode *输入参数: deviceCode:设备deviceCode
...@@ -192,21 +228,37 @@ static int _kk_check_property_exist(const char* deviceCode,const char* identifie ...@@ -192,21 +228,37 @@ static int _kk_check_property_exist(const char* deviceCode,const char* identifie
int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_data_type_e valuetype,int devtype) int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_data_type_e valuetype,int devtype)
{ {
printf("---------------------------------------->identifier:%s\n",identifier);
dm_mgr_dev_node_t *node = NULL;
int res = 0 ;
const char *insertCmd = "insert into PropertiesInfo (deviceCode,identifier,value,valueType,devType) \ const char *insertCmd = "insert into PropertiesInfo (deviceCode,identifier,value,valueType,devType) \
values ('%s','%s','%s','%d','%d');"; values ('%s','%s','%s','%d','%d');";
char *sqlCmd = NULL; char *sqlCmd = NULL;
int rc = 0; int rc = 0;
char *zErrMsg = 0; char *zErrMsg = 0;
kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx(); kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx();
printf("---------------------------------------->1\n");
if(_kk_check_property_exist(deviceCode,identifier) == 1) if(_kk_check_property_exist(deviceCode,identifier) == 1)
{ {
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
printf("---------------------------------------->2\n");
_kk_property_db_lock(); _kk_property_db_lock();
//传感器类默认安防等级为离家安防 //传感器类默认安防等级为离家安防
if(strcmp(identifier,"SensorType") == 0 && devtype == KK_DM_DEVICE_SUBDEV){ if(strcmp(identifier,"SensorType") == 0 && devtype == KK_DM_DEVICE_SUBDEV){
sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"1",valuetype,devtype); res = dm_mgr_get_device_by_devicecode(deviceCode, &node);
if (res != SUCCESS_RETURN) {
return FAIL_RETURN;
}
printf("---------------------------------------->3\n");
if(_kk_check_human_induction_device(node->productCode) == 1 || //门磁和人体默认室外安防
_kk_check_door_induction_device(node->productCode) == 1){
sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"1",valuetype,devtype);
}else{
printf("---------------------------------------->\n");
sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"2",valuetype,devtype);//其他24小时警戒
}
}else{ }else{
sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"",valuetype,devtype); sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"",valuetype,devtype);
} }
...@@ -317,6 +369,42 @@ int kk_indoorAir_db_insert(const char *deviceCode,const char *identifier,kk_tsl_ ...@@ -317,6 +369,42 @@ int kk_indoorAir_db_insert(const char *deviceCode,const char *identifier,kk_tsl_
_kk_property_db_unlock(); _kk_property_db_unlock();
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
/************************************************************
*功能描述: 查询空调内机数量
*输入参数: deviceCode:设备deviceCode
epNum:内机端点
*输出参数: 无
*返 回 值: 0:成功;其他:失败
*其他说明:属性的值插入的时候先置空,后续再update
*************************************************************/
int kk_indoorAir_query_epnums(const char *deviceCode,int epList[])
{
char *sqlCmd = NULL;
//int rc = 0;
//char *zErrMsg = 0;
sqlite3_stmt *stmt;
char *valueStr = NULL;
int count = 0;
kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx();
_kk_property_db_lock();
sqlCmd = sqlite3_mprintf("select * from indoorAirProperties WHERE deviceCode= '%s' and identifier = '%s'",deviceCode,"PowerSwitch");
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
if(count > 64){
return count;
}
printf("-----------------------------------------------kk_indoorAir_query_epnums\n");
epList[count] = sqlite3_column_int(stmt, DB_INDOORAIR_EPNUM);
printf("epList[count] :%d\n",epList[count]);
count++;
}
sqlite3_free(sqlCmd);
_kk_property_db_unlock();
sqlite3_finalize(stmt);
return count;
}
/************************************************************ /************************************************************
*功能描述:通过deviceCode删除空调内机 *功能描述:通过deviceCode删除空调内机
*输入参数: deviceCode:设备deviceCode *输入参数: deviceCode:设备deviceCode
......
...@@ -55,5 +55,6 @@ int kk_property_update_lockkeys(char deviceCode[DEVICE_CODE_MAXLEN],char *keyId, ...@@ -55,5 +55,6 @@ int kk_property_update_lockkeys(char deviceCode[DEVICE_CODE_MAXLEN],char *keyId,
int kk_property_delete_lockkeys(char deviceCode[DEVICE_CODE_MAXLEN],char *keyId); int kk_property_delete_lockkeys(char deviceCode[DEVICE_CODE_MAXLEN],char *keyId);
int kk_indoorAir_db_insert(const char *deviceCode,const char *identifier,kk_tsl_data_type_e valuetype,int epNum); int kk_indoorAir_db_insert(const char *deviceCode,const char *identifier,kk_tsl_data_type_e valuetype,int epNum);
int kk_indoorAir_db_update_value(const char *deviceCode,const char *identifier,const char* value,int epNum); int kk_indoorAir_db_update_value(const char *deviceCode,const char *identifier,const char* value,int epNum);
int kk_indoorAir_query_epnums(const char *deviceCode,int epList[]);
#endif #endif
...@@ -79,8 +79,9 @@ int kk_sync_init(void) ...@@ -79,8 +79,9 @@ int kk_sync_init(void)
static cJSON * kk_get_room_devices(const char *roomId) static cJSON * kk_get_room_devices(const char *roomId)
{ {
dm_mgr_dev_node_t *node = NULL;
const char *selectCmd = "select * from AreaDevInfo WHERE roomId = '%s';"; const char *selectCmd = "select * from AreaDevInfo WHERE roomId = '%s';";
int res = 0;
char *sqlCmd = NULL; char *sqlCmd = NULL;
sqlite3_stmt *stmt; sqlite3_stmt *stmt;
char *deviceCode = NULL; char *deviceCode = NULL;
...@@ -96,12 +97,20 @@ static cJSON * kk_get_room_devices(const char *roomId) ...@@ -96,12 +97,20 @@ static cJSON * kk_get_room_devices(const char *roomId)
deviceCode = (char*)sqlite3_column_text(stmt, DB_DEV_DEVICECODE); deviceCode = (char*)sqlite3_column_text(stmt, DB_DEV_DEVICECODE);
epNum = (char*)sqlite3_column_text(stmt, DB_DEV_EPNUM); epNum = (char*)sqlite3_column_text(stmt, DB_DEV_EPNUM);
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
if(kk_check_multi_ep_num(deviceCode)){ if(kk_check_multi_ep_num(deviceCode)){
cJSON_AddStringToObject(dev,KK_SYNC_SCENE_EPNUM_STR,epNum); cJSON_AddStringToObject(dev,KK_SYNC_SCENE_EPNUM_STR,epNum);
}else if(strcmp(node->productType,KK_DM_AIR_GATEWAY_TYPE) == 0){
if(atoi(epNum) == 1){//epNum为1的是空调网关
continue;
}else{
cJSON_AddStringToObject(dev,KK_SYNC_SCENE_EPNUM_STR,epNum);
}
} }
cJSON_AddStringToObject(dev,KK_SYNC_DEVICECODE_STR,deviceCode); cJSON_AddStringToObject(dev,KK_SYNC_DEVICECODE_STR,deviceCode);
//cJSON_AddStringToObject(dev,KK_SYNC_SCENE_EPNUM_STR,epNum); //cJSON_AddStringToObject(dev,KK_SYNC_SCENE_EPNUM_STR,epNum);
kk_get_device_name(deviceCode,epNum,devName,sizeof(devName)); kk_get_device_name(deviceCode,epNum,devName,sizeof(devName));
...@@ -367,6 +376,61 @@ static cJSON *kk_get_properties_info(char *deviceCode,int devType) ...@@ -367,6 +376,61 @@ static cJSON *kk_get_properties_info(char *deviceCode,int devType)
sqlite3_finalize(stmt); sqlite3_finalize(stmt);
return obj; return obj;
} }
static cJSON *kk_get_indoor_properties_info(char *deviceCode)
{
char *sqlCmd = NULL;
//char *zErrMsg = 0;
sqlite3_stmt *stmt;
char *propertyStr = NULL;
char *valueStr = NULL;
int valueType = 0;
int eplist[65] = {0};
int count = 0,i = 0;
char *ptr = NULL;
kk_sync_ctx_t *ctx = _kk_sync_get_ctx();
if(deviceCode == NULL){
return NULL;
}
cJSON *obj = cJSON_CreateObject();
cJSON *eps = cJSON_CreateArray();
count = kk_indoorAir_query_epnums(deviceCode,eplist);
printf("-------------->count:%d\n",count);
for(i = 0; i < count; i++){
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
sqlCmd = sqlite3_mprintf("select * from indoorAirProperties WHERE deviceCode = '%s' and epNum=%d;",deviceCode,eplist[i]);
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
cJSON *propertyItem = cJSON_CreateObject();
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
cJSON_AddNumberToObject(propertyItem, "epNum",eplist[i]);
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
while(sqlite3_step(stmt) == SQLITE_ROW){
propertyStr = (char*)sqlite3_column_text(stmt, DB_INDOORAIR_IDENTIFITER);
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
valueType = sqlite3_column_int(stmt, DB_INDOORAIR_VALUETYPE);
valueStr = (char*)sqlite3_column_text(stmt, DB_INDOORAIR_VALUE);
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
if(valueType == KK_TSL_DATA_TYPE_TEXT){
cJSON_AddStringToObject(propertyItem, propertyStr, valueStr);
}else if(valueType == KK_TSL_DATA_TYPE_INT||
valueType == KK_TSL_DATA_TYPE_ENUM||
valueType == KK_TSL_DATA_TYPE_BOOL){
cJSON_AddNumberToObject(propertyItem, propertyStr, atoi(valueStr));
}else if(valueType == KK_TSL_DATA_TYPE_DOUBLE){
cJSON_AddNumberToObject(propertyItem, propertyStr, atof(valueStr));
}
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
}
cJSON_AddItemToArray(eps,propertyItem);
}
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
cJSON_AddItemToObject(obj, "eps", eps);
cJSON_AddNumberToObject(obj, "EpTotal", count);
cJSON_AddNumberToObject(obj, "CombineDeviceFlag", 1);
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
return obj;
}
static int kk_get_properties_info_obj(char *deviceCode) static int kk_get_properties_info_obj(char *deviceCode)
{ {
char *sqlCmd = NULL; char *sqlCmd = NULL;
...@@ -471,6 +535,7 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode) ...@@ -471,6 +535,7 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
kk_sync_ctx_t *ctx = _kk_sync_get_ctx(); kk_sync_ctx_t *ctx = _kk_sync_get_ctx();
char *subDeviceCode = NULL; char *subDeviceCode = NULL;
char *subProductCode = NULL; char *subProductCode = NULL;
char *subproductType = NULL;
char *subVersion = NULL; char *subVersion = NULL;
char *subIsline = NULL; char *subIsline = NULL;
if(gwdevicesItem == NULL || deviceCode == NULL){ if(gwdevicesItem == NULL || deviceCode == NULL){
...@@ -488,7 +553,8 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode) ...@@ -488,7 +553,8 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
subDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE); subDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE);
subProductCode = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTCODE); subProductCode = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTCODE);
subVersion = (char*)sqlite3_column_text(stmt, DB_SUB_VERSION); subVersion = (char*)sqlite3_column_text(stmt, DB_SUB_VERSION);
subIsline = (char*)sqlite3_column_text(stmt, DB_SUB_ONLINE); subIsline = (char*)sqlite3_column_text(stmt, DB_SUB_ONLINE);
subproductType = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTTYPE);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_DEVICECODE_STR, subDeviceCode); cJSON_AddStringToObject(subdevicesItem, KK_SYNC_DEVICECODE_STR, subDeviceCode);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_VERSION_STR, subVersion); cJSON_AddStringToObject(subdevicesItem, KK_SYNC_VERSION_STR, subVersion);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_MAC_STR, subDeviceCode); cJSON_AddStringToObject(subdevicesItem, KK_SYNC_MAC_STR, subDeviceCode);
...@@ -503,7 +569,10 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode) ...@@ -503,7 +569,10 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
if(kk_check_multi_ep_num(subDeviceCode)){ if(kk_check_multi_ep_num(subDeviceCode)){
properties=kk_get_properties_info(subDeviceCode,KK_DM_DEVICE_SUBDEV); properties=kk_get_properties_info(subDeviceCode,KK_DM_DEVICE_SUBDEV);
}else{ }else if(strcmp(subproductType,KK_DM_AIR_GATEWAY_TYPE) == 0){
properties=kk_get_indoor_properties_info(subDeviceCode);
}
else{
properties=kk_get_properties_info_obj(subDeviceCode); properties=kk_get_properties_info_obj(subDeviceCode);
} }
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "kk_scene_handle.h" #include "kk_scene_handle.h"
#include "dm_ota.h" #include "dm_ota.h"
#include "ccu_ver.h" #include "ccu_ver.h"
#include "kk_area_handle.h"
int g_timezone = 8; int g_timezone = 8;
char * g_filerToPlatTable[] = char * g_filerToPlatTable[] =
{ {
...@@ -568,7 +570,12 @@ static int kk_alarm_notify_handle(dm_mgr_dev_node_t *node,char *identifier,char ...@@ -568,7 +570,12 @@ static int kk_alarm_notify_handle(dm_mgr_dev_node_t *node,char *identifier,char
cJSON *param = cJSON_CreateObject(); cJSON *param = cJSON_CreateObject();
if(strcmp(identifier,"BatteryAlarm") == 0){ if(strcmp(identifier,"BatteryAlarm") == 0){
cJSON_AddStringToObject(param, "LowBatteryState", "1"); cJSON_AddStringToObject(param, "LowBatteryState", "1");
}else{ }else if(strcmp(identifier,"DismantleState") == 0 && atoi(valueBuf) == 1){
cJSON_AddStringToObject(param, "DismantleState", "1");
}else if(strcmp(identifier,"SmokeSensorState") == 0 && atoi(valueBuf) == 1){
cJSON_AddStringToObject(param, "CommonAlarmState", "1");
}
else{
cJSON_AddStringToObject(param, "CommonAlarmState", "1"); cJSON_AddStringToObject(param, "CommonAlarmState", "1");
} }
cJSON_AddItemToObject(payload, "params", param); cJSON_AddItemToObject(payload, "params", param);
...@@ -636,7 +643,7 @@ static int kk_indoorAir_property_save(cJSON *payload,char *deviceCode) ...@@ -636,7 +643,7 @@ static int kk_indoorAir_property_save(cJSON *payload,char *deviceCode)
if(epNum->type == cJSON_Number){ if(epNum->type == cJSON_Number){
epNumInt = epNum->valueint; epNumInt = epNum->valueint;
}else if(epNum->type == cJSON_String){ }else if(epNum->type == cJSON_String){
epNumInt = epNum->valuestring; epNumInt = atoi(epNum->valuestring);
} }
for(idx = 0; idx < node->dev_shadow->property_number; idx++){ for(idx = 0; idx < node->dev_shadow->property_number; idx++){
property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx); property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx);
...@@ -679,6 +686,10 @@ static int kk_indoorAir_property_handle(cJSON *info,cJSON *payload,char *deviceC ...@@ -679,6 +686,10 @@ static int kk_indoorAir_property_handle(cJSON *info,cJSON *payload,char *deviceC
static int kk_indoorAir_online_handle(dm_mgr_dev_node_t *node ,char *deviceCode,int epNum) static int kk_indoorAir_online_handle(dm_mgr_dev_node_t *node ,char *deviceCode,int epNum)
{ {
int idx = 0; int idx = 0;
int gwExist = 0;
char roomId[32] = {0};
char roomName[256] = {0};
char epNumStr[10] = {0};
kk_tsl_data_t *property = NULL; kk_tsl_data_t *property = NULL;
if(node == NULL){ if(node == NULL){
return -1; return -1;
...@@ -690,6 +701,14 @@ static int kk_indoorAir_online_handle(dm_mgr_dev_node_t *node ,char *deviceCode, ...@@ -690,6 +701,14 @@ static int kk_indoorAir_online_handle(dm_mgr_dev_node_t *node ,char *deviceCode,
} }
kk_indoorAir_db_insert(deviceCode,property->identifier,property->data_value.type,epNum); kk_indoorAir_db_insert(deviceCode,property->identifier,property->data_value.type,epNum);
} }
gwExist = kk_get_device_roomInfo(deviceCode,1,roomName,roomId);//获取网关房间信息
if(gwExist){
char name[128] = {0};
sprintf(name,"空调%d",epNum);
sprintf(epNumStr,"%d",epNum);
kk_room_dev_add(roomId,roomName,deviceCode,epNumStr,name);
}
return 0; return 0;
} }
void kk_platMsg_handle(void* data, char* chalMark){ void kk_platMsg_handle(void* data, char* chalMark){
...@@ -857,7 +876,7 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -857,7 +876,7 @@ void kk_platMsg_handle(void* data, char* chalMark){
sprintf(btnId,"%d",buttonId->valueint); sprintf(btnId,"%d",buttonId->valueint);
kk_scene_execute_quickpanel(btnId,info_dcode->valuestring); kk_scene_execute_quickpanel(btnId,info_dcode->valuestring);
} }
INFO_PRINT("kk_platMsg_handle event post enters \n"); INFO_PRINT("-------------------kk_platMsg_handle event post enters \n");
for(idx = 0; idx < node->dev_shadow->event_number; idx++){ for(idx = 0; idx < node->dev_shadow->event_number; idx++){
eventItem = node->dev_shadow->events + idx; eventItem = node->dev_shadow->events + idx;
if(eventItem != NULL){ if(eventItem != NULL){
...@@ -867,7 +886,8 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -867,7 +886,8 @@ void kk_platMsg_handle(void* data, char* chalMark){
kk_tsl_data_t *itemData = NULL; kk_tsl_data_t *itemData = NULL;
for(index = 0; index < eventItem->output_data_number;index++){ for(index = 0; index < eventItem->output_data_number;index++){
itemStr = cJSON_GetObjectItem(jsonPay, eventItem->identifier); itemStr = cJSON_GetObjectItem(jsonPay, eventItem->identifier);
itemData = eventItem->output_datas + index; itemData = eventItem->output_datas + index;
printf("------------111--------->itemData->identifier:%s\n",itemData->identifier);
cJSON * itemDataIdentifier = cJSON_GetObjectItem(jsonPay, itemData->identifier); cJSON * itemDataIdentifier = cJSON_GetObjectItem(jsonPay, itemData->identifier);
if(itemDataIdentifier != NULL){ if(itemDataIdentifier != NULL){
memset(tmpStr,0x0,sizeof(tmpStr)); memset(tmpStr,0x0,sizeof(tmpStr));
...@@ -890,7 +910,7 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -890,7 +910,7 @@ void kk_platMsg_handle(void* data, char* chalMark){
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,NULL,itemDataIdentifier->valuestring); kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,NULL,itemDataIdentifier->valuestring);
} }
if(sensorDev){ if(sensorDev){
kk_alarm_notify_handle(node,eventItem->identifier,valueBuf);//告警信息处理 kk_alarm_notify_handle(node,itemData->identifier,valueBuf);//告警信息处理
} }
INFO_PRINT("kk_platMsg_handle data: event post\n"); INFO_PRINT("kk_platMsg_handle data: event post\n");
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL); dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
...@@ -904,7 +924,7 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -904,7 +924,7 @@ void kk_platMsg_handle(void* data, char* chalMark){
itemStr = cJSON_GetObjectItem(jsonPay, eventItem->identifier); itemStr = cJSON_GetObjectItem(jsonPay, eventItem->identifier);
if(itemStr != NULL){ if(itemStr != NULL){
if(sensorDev){ if(sensorDev){
kk_history_insert_sensor_info(info_dcode->valuestring,eventItem->identifier,"",HAL_GetTime()); //kk_history_insert_sensor_info(info_dcode->valuestring,eventItem->identifier,"",HAL_GetTime());
} }
//kk_tsl_set_value(kk_tsl_set_event_output_value,dev_shadow,eventItem->identifier,&itemStr->valueint,NULL); //kk_tsl_set_value(kk_tsl_set_event_output_value,dev_shadow,eventItem->identifier,&itemStr->valueint,NULL);
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL); dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
......
{ {
"version": "1.2", "version": "1.3",
"update": "2020-11-25 17:12", "update": "2021-08-16",
"devices": [ "devices": [
{ {
"pid": "00068611", "pid": "00068611",
"name": "XC Wall switch 1G", "name": "XC Wall switch 1G",
"type": "ZR", "type": "ZR",
...@@ -603,7 +603,7 @@ ...@@ -603,7 +603,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -624,7 +624,7 @@ ...@@ -624,7 +624,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -645,7 +645,7 @@ ...@@ -645,7 +645,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -666,7 +666,7 @@ ...@@ -666,7 +666,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -679,7 +679,7 @@ ...@@ -679,7 +679,7 @@
}, },
{ {
"pid": "00803033", "pid": "00803033",
"name": "XB Midea Air Condition Panel", "name": "XB Midea Air Condition Panel Z3KA",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3033, "b_pid": 3033,
...@@ -687,7 +687,7 @@ ...@@ -687,7 +687,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -700,7 +700,7 @@ ...@@ -700,7 +700,7 @@
}, },
{ {
"pid": "00803034", "pid": "00803034",
"name": "XB Midea Air Condition Panel", "name": "XB Midea Air Condition Panel Z3ZA",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3034, "b_pid": 3034,
...@@ -708,7 +708,7 @@ ...@@ -708,7 +708,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -721,7 +721,7 @@ ...@@ -721,7 +721,7 @@
}, },
{ {
"pid": "00803035", "pid": "00803035",
"name": "XB Daikin Air Condition Panel", "name": "XB Daikin Air Condition Panel Z3KA",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3035, "b_pid": 3035,
...@@ -729,7 +729,7 @@ ...@@ -729,7 +729,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -750,7 +750,7 @@ ...@@ -750,7 +750,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -828,7 +828,7 @@ ...@@ -828,7 +828,7 @@
{ {
"pid": "0402002B", "pid": "0402002B",
"name": "iHORN gas detector", "name": "iHORN gas detector",
"type": "ZED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3040, "b_pid": 3040,
...@@ -869,6 +869,28 @@ ...@@ -869,6 +869,28 @@
} }
] ]
}, },
{
"pid": "0402000D",
"name": "KPL Body Sensor",
"type": "ZSED",
"ota": false,
"b_pid": 3042,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"000D",
"b_oid": 0,
"cluster": {
"client": "0003",
"server": "0000:0003:0500"
}
}
]
},
{ {
"pid": "0402010D", "pid": "0402010D",
"name": "Infrared Curtain Detector", "name": "Infrared Curtain Detector",
...@@ -891,6 +913,50 @@ ...@@ -891,6 +913,50 @@
} }
] ]
}, },
{
"pid": "04032225",
"name": "KPL Indoor Siren",
"type": "ZR",
"ota": true,
"b_pid": 3044,
"eps": [
{
"ep": "1",
"zid": "0403",
"zname": "IAS Warnning Device",
"zone_type":"0225",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0500"
}
}
]
},
{
"pid": "04022015",
"name": "KPL Door Seneor",
"type": "ZSED",
"ota": false,
"b_pid": 3045,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"0015",
"b_oid": 0,
"cluster": {
"client": "0003",
"server": "0000:0003:0500"
}
}
]
},
{ {
"pid": "00510001", "pid": "00510001",
"name": "KIT Quick Panel", "name": "KIT Quick Panel",
...@@ -1014,8 +1080,8 @@ ...@@ -1014,8 +1080,8 @@
"b_oid": 0, "b_oid": 0,
"cluster": { "cluster": {
"client": "0003:0019", "client": "0019",
"server": "0000:0003:0402:0405" "server": "0000:0001:0003:0400:0402:0405"
} }
} }
] ]
...@@ -1109,7 +1175,7 @@ ...@@ -1109,7 +1175,7 @@
}, },
{ {
"pid": "04031225", "pid": "04031225",
"name": "BD indoor siren", "name": "BD Indoor Siren",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3057, "b_pid": 3057,
...@@ -1131,7 +1197,7 @@ ...@@ -1131,7 +1197,7 @@
}, },
{ {
"pid": "00803062", "pid": "00803062",
"name": "Center Air Conditioning PRO", "name": "Center Air Conditioning Gateway PRO",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3062, "b_pid": 3062,
...@@ -1139,7 +1205,7 @@ ...@@ -1139,7 +1205,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1",
"zid": "0080", "zid": "0300",
"zname": "Heating Cooling Unit", "zname": "Heating Cooling Unit",
"b_oid": 0, "b_oid": 0,
...@@ -1150,6 +1216,27 @@ ...@@ -1150,6 +1216,27 @@
} }
] ]
}, },
{
"pid": "000A0001",
"name": "YM Doorlock",
"type": "ZSED",
"ota": false,
"b_pid": 3064,
"eps": [
{
"ep": "1",
"zid": "000A",
"zname": "Door Lock",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0001:0003:0101:0B05"
}
}
]
},
{ {
"pid": "02020000", "pid": "02020000",
"name": "DY Window Covering", "name": "DY Window Covering",
...@@ -1201,7 +1288,7 @@ ...@@ -1201,7 +1288,7 @@
"eps": [ "eps": [
{ {
"ep": "1", "ep": "1:2",
"zid": "0100", "zid": "0100",
"zname": "On/Off Light", "zname": "On/Off Light",
"b_oid": 0, "b_oid": 0,
...@@ -1325,7 +1412,7 @@ ...@@ -1325,7 +1412,7 @@
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0402:0405" "server": "0000:0003:0402:0405:0400"
} }
} }
] ]
...@@ -1372,6 +1459,115 @@ ...@@ -1372,6 +1459,115 @@
} }
] ]
}, },
{
"pid": "3050",
"name": "iHORN Gas Sensor",
"type": "ZR",
"ota": true,
"b_pid": 3080,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"002B",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0500"
}
}
]
},
{
"pid": "3041",
"name": "iHORN Smoke Sensor",
"type": "ZSED",
"ota": true,
"b_pid": 3081,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"0028",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0500"
}
}
]
},
{
"pid": "0402102B",
"name": "BD Gas Sensor",
"type": "ZR",
"ota": true,
"b_pid": 3082,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"002B",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0500"
}
}
]
},
{
"pid": "04021028",
"name": "BD Smoke Sensor",
"type": "ZSED",
"ota": true,
"b_pid": 3083,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"0028",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0500"
}
}
]
},
{
"pid": "03020002",
"name": "Environment Detection Panel",
"type": "ZR",
"ota": true,
"b_pid": 3084,
"eps": [
{
"ep": "1",
"zid": "0302",
"zname": "Temperature Sensor",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0400:0402:0405:040D:042A:042B"
}
}
]
},
{ {
"pid": "00068631", "pid": "00068631",
"name": "HD Wall switch 1G", "name": "HD Wall switch 1G",
...@@ -1498,6 +1694,157 @@ ...@@ -1498,6 +1694,157 @@
} }
] ]
}, },
{
"pid": "03008603",
"name": "HD HVAC Floor Heating All in one",
"type": "ZR",
"ota": true,
"b_pid": 3090,
"eps": [
{
"ep": "1",
"zid": "0300",
"zname": "Heating Cooling Unit",
"b_oid": 0,
"cluster": {
"client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202"
}
},
{
"ep": "2",
"zid": "0300",
"zname": "Heating Cooling Unit",
"b_oid": 0,
"cluster": {
"client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201"
}
},
{
"ep": "3",
"zid": "0300",
"zname": "Heating Cooling Unit",
"b_oid": 0,
"cluster": {
"client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202"
}
}
]
},
{
"pid": "00060002",
"name": "Offline Voice Panel",
"type": "ZR",
"ota": true,
"b_pid": 3104,
"eps": [
{
"ep": "1:2:3:4",
"zid": "0103",
"zname": "On/Off Light Switch",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0004:0005:0006"
}
},
{
"ep": "5:6:7:8",
"zid": "0004",
"zname": "Scene Selector",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0004:0005:0006"
}
},
{
"ep": "9",
"zid": "0007",
"zname": "Combined Interface",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0008"
}
}
]
},
{
"pid": "04022028",
"name": "KPL Smoke Sensor",
"type": "ZSED",
"ota": true,
"b_pid": 3105,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"0028",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0500"
}
}
]
},
{
"pid": "0402202B",
"name": "KPL Gas Sensor",
"type": "ZR",
"ota": true,
"b_pid": 3106,
"eps": [
{
"ep": "1",
"zid": "0402",
"zname": "IAS Zone",
"zone_type":"002B",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0500"
}
}
]
},
{
"pid": "00020003",
"name": "BJ Water cut-off panel",
"type": "ZR",
"ota": true,
"b_pid": 3108,
"eps": [
{
"ep": "1",
"zid": "0002",
"zname": "On/Off Output",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0004:0005:0006"
}
}
]
},
{ {
"pid": "00048612", "pid": "00048612",
"name": "XC Scene Panel 6G", "name": "XC Scene Panel 6G",
...@@ -1518,6 +1865,27 @@ ...@@ -1518,6 +1865,27 @@
} }
} }
] ]
},
{
"pid": "000A0002",
"name": "YC Doorlock",
"type": "ZSED",
"ota": false,
"b_pid": 4508,
"eps": [
{
"ep": "1",
"zid": "000A",
"zname": "Door Lock",
"b_oid": 0,
"cluster": {
"client": "0003:0019",
"server": "0000:0001:0003:0101:0B05"
}
}
]
} }
] ]
} }
\ No newline at end of file
{ {
"productCode":"3020", "productCode":"3020",
"operateType":"2001", "operateType":"2001",
"channel":1, "channel":1,
"syn_type":1, "syn_type":1,
"syn_opcode":"STATUS", "syn_opcode":"STATUS",
"newccu":[ "newccu":[
{ {
"identifier":"PowerSwitch", "identifier":"PowerSwitch",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
}, },
{ {
"identifier":"Power", "identifier":"Power",
"opcodemap":"GET_DEV_POWER", "opcodemap":"GET_DEV_POWER",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
}, },
{ {
"identifier":"Electric", "identifier":"Electric",
"opcodemap":"GET_ELECTRICAL", "opcodemap":"GET_ELECTRICAL",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
}, },
{ {
"identifier":"", "identifier":"",
"opcodemap":"STATUS", "opcodemap":"STATUS",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 1 "value": 1
} }
], ],
"oldccu":[ "oldccu":[
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"PowerSwitch", "identifiermap":"PowerSwitch",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["OFF","ON"], "valueRange":["OFF","ON"],
"syn":"switch", "syn":"switch",
"synType":"map" "synType":"map"
}, },
{ {
"opcode":"GET_DEV_POWER", "opcode":"GET_DEV_POWER",
"identifiermap":"Power", "identifiermap":"Power",
"dataType":"string_double", "dataType":"string_double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"", "syn":"",
"synType":"dummy" "synType":"dummy"
}, },
{ {
"opcode":"GET_ELECTRICAL", "opcode":"GET_ELECTRICAL",
"identifiermap":"Electric", "identifiermap":"Electric",
"dataType":"string_double", "dataType":"string_double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"", "syn":"",
"synType":"dummy" "synType":"dummy"
}, },
{ {
"opcode":"STATUS", "opcode":"STATUS",
"identifiermap":"", "identifiermap":"",
"dataType":"dummy", "dataType":"dummy",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"light_switch", "syn":"light_switch",
"synType":"bool" "synType":"bool"
} }
] ]
} }
\ No newline at end of file
{ {
"productCode":"3023", "productCode":"3023",
"operateType":"3", "operateType":"3",
"channel":2, "channel":2,
"newccu":[ "newccu":[
{ {
"identifier":"PowerSwitch", "identifier":"PowerSwitch",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
}, },
{ {
"identifier":"PowerSwitch", "identifier":"PowerSwitch",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"2", "channel":"2",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
} }
], ],
"oldccu":[ "oldccu":[
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"PowerSwitch", "identifiermap":"PowerSwitch",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["OFF","ON"] "valueRange":["OFF","ON"]
}, },
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"PowerSwitch", "identifiermap":"PowerSwitch",
"dataType":"map", "dataType":"map",
"channel":"2", "channel":"2",
"valueRange":["OFF","ON"] "valueRange":["OFF","ON"]
} }
] ]
} }
\ No newline at end of file
{ {
"productCode":"3027", "productCode":"3027",
"operateType":"1003", "operateType":"1003",
"channel":2, "channel":2,
"newccu":[ "newccu":[
{ {
"identifier":"OperationMode", "identifier":"OperationMode",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1,2], "valueRange":[0,1,2],
"value": 2 "value": 2
}, },
{ {
"identifier":"OperationMode", "identifier":"OperationMode",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"2", "channel":"2",
"valueRange":[0,1,2], "valueRange":[0,1,2],
"value": 2 "value": 2
} }
], ],
"oldccu":[ "oldccu":[
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"OperationMode", "identifiermap":"OperationMode",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["CLOSE","OPEN","STOP"] "valueRange":["CLOSE","OPEN","STOP"]
}, },
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"OperationMode", "identifiermap":"OperationMode",
"dataType":"map", "dataType":"map",
"channel":"2", "channel":"2",
"valueRange":["CLOSE","OPEN","STOP"] "valueRange":["CLOSE","OPEN","STOP"]
} }
] ]
} }
\ No newline at end of file
{ {
"productCode":"3032", "productCode":"3032",
"operateType":"14002", "operateType":"14002",
"channel":1, "channel":1,
"syn_type":1, "syn_type":1,
"syn_opcode":"CHOPIN_FRESH_AIR_STATUS", "syn_opcode":"CHOPIN_FRESH_AIR_STATUS",
"newccu":[ "newccu":[
{ {
"identifier":"PowerSwitch", "identifier":"PowerSwitch",
"opcodemap":"FRESH_AIR_SWITCH", "opcodemap":"FRESH_AIR_SWITCH",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
},{ },{
"identifier":"WorkMode", "identifier":"WorkMode",
"opcodemap":"FRESH_AIR_RUN_MODEL", "opcodemap":"FRESH_AIR_RUN_MODEL",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 1 "value": 1
},{ },{
"identifier":"WindSpeed", "identifier":"WindSpeed",
"opcodemap":"FRESH_AIR_SPEED_SET", "opcodemap":"FRESH_AIR_SPEED_SET",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1,2,3], "valueRange":[0,1,2,3],
"value": 1 "value": 1
},{ },{
"identifier":"ChildLockState", "identifier":"ChildLockState",
"opcodemap":"FRESH_AIR_SET_LOCK_STATUS", "opcodemap":"FRESH_AIR_SET_LOCK_STATUS",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
},{ },{
"identifier":"TimingOffTime", "identifier":"TimingOffTime",
"opcodemap":"FRESH_AIR_SET_TIME_OFF", "opcodemap":"FRESH_AIR_SET_TIME_OFF",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"StrainerUsageTime", "identifier":"StrainerUsageTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS", "opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"StrainerAlarmTime", "identifier":"StrainerAlarmTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS", "opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"CurrentTemperature", "identifier":"CurrentTemperature",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS", "opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
} }
], ],
"oldccu":[ "oldccu":[
{ {
"opcode":"FRESH_AIR_SWITCH", "opcode":"FRESH_AIR_SWITCH",
"identifiermap":"PowerSwitch", "identifiermap":"PowerSwitch",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["OFF","ON"], "valueRange":["OFF","ON"],
"syn":"on", "syn":"on",
"synType":"bool" "synType":"bool"
},{ },{
"opcode":"FRESH_AIR_RUN_MODEL", "opcode":"FRESH_AIR_RUN_MODEL",
"identifiermap":"WorkMode", "identifiermap":"WorkMode",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["AUTO","MANUAL"], "valueRange":["AUTO","MANUAL"],
"syn":"runModel", "syn":"runModel",
"synType":"map" "synType":"map"
},{ },{
"opcode":"FRESH_AIR_SPEED_SET", "opcode":"FRESH_AIR_SPEED_SET",
"identifiermap":"WindSpeed", "identifiermap":"WindSpeed",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["STOP","LOW","MID","HIGH"], "valueRange":["STOP","LOW","MID","HIGH"],
"syn":"speed", "syn":"speed",
"synType":"int" "synType":"int"
},{ },{
"opcode":"FRESH_AIR_SET_LOCK_STATUS", "opcode":"FRESH_AIR_SET_LOCK_STATUS",
"identifiermap":"ChildLockState", "identifiermap":"ChildLockState",
"dataType":"bool", "dataType":"bool",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"ChildLockState", "syn":"ChildLockState",
"synType":"double" "synType":"double"
},{ },{
"opcode":"FRESH_AIR_SET_TIME_OFF", "opcode":"FRESH_AIR_SET_TIME_OFF",
"identifiermap":"TimingOffTime", "identifiermap":"TimingOffTime",
"dataType":"string_time", "dataType":"string_time",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"time_off", "syn":"time_off",
"synType":"string_time" "synType":"string_time"
},{ },{
"opcode":"CHOPIN_FRESH_AIR_STATUS ", "opcode":"CHOPIN_FRESH_AIR_STATUS ",
"identifiermap":"StrainerUsageTime", "identifiermap":"StrainerUsageTime",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"filterScreenWorkTime", "syn":"filterScreenWorkTime",
"synType":"int" "synType":"int"
},{ },{
"opcode":"CHOPIN_FRESH_AIR_STATUS", "opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"StrainerAlarmTime", "identifiermap":"StrainerAlarmTime",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"filterScreenAlarmTime", "syn":"filterScreenAlarmTime",
"synType":"int" "synType":"int"
},{ },{
"opcode":"CHOPIN_FRESH_AIR_STATUS", "opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"CurrentTemperature", "identifiermap":"CurrentTemperature",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"cur_temperature", "syn":"cur_temperature",
"synType":"double" "synType":"double"
} }
] ]
} }
{ {
"productCode":"3034", "productCode":"3034",
"operateType":"15003", "operateType":"15003",
"channel":1, "channel":1,
"syn_type":1, "syn_type":1,
"syn_opcode":"FAN_COIL_STATUS", "syn_opcode":"FAN_COIL_STATUS",
"newccu":[ "newccu":[
{ {
"identifier":"PowerSwitch", "identifier":"PowerSwitch",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
},{ },{
"identifier":"WorkMode", "identifier":"WorkMode",
"opcodemap":"FAN_COIL_SET_RUN_MODEL", "opcodemap":"FAN_COIL_SET_RUN_MODEL",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[1,2,3,4], "valueRange":[1,2,3,4],
"value": 1 "value": 1
},{ },{
"identifier":"WindSpeed", "identifier":"WindSpeed",
"opcodemap":"FAN_COIL_SET_FUN_SPEED", "opcodemap":"FAN_COIL_SET_FUN_SPEED",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[1,2,3,4], "valueRange":[1,2,3,4],
"value": 1 "value": 1
},{ },{
"identifier":"TargetTemperature", "identifier":"TargetTemperature",
"opcodemap":"FAN_COIL_SET_TEMPERATURE", "opcodemap":"FAN_COIL_SET_TEMPERATURE",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 16 "value": 16
},{ },{
"identifier":"TimingOffTime", "identifier":"TimingOffTime",
"opcodemap":"FAN_COIL_SET_DELAY_SWITCH_TASK", "opcodemap":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"ChildLockState", "identifier":"ChildLockState",
"opcodemap":"FAN_COIL_SET_LOCK_STATUS", "opcodemap":"FAN_COIL_SET_LOCK_STATUS",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
},{ },{
"identifier":"CurrentTemperature", "identifier":"CurrentTemperature",
"opcodemap":"room_temperature", "opcodemap":"room_temperature",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 22 "value": 22
},{ },{
"identifier":"smart_model_id", "identifier":"smart_model_id",
"opcodemap":"FAN_COIL_STATUS", "opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy", "dataType":"dummy",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"smart_model_time_index", "identifier":"smart_model_time_index",
"opcodemap":"FAN_COIL_STATUS", "opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy", "dataType":"dummy",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"system_time", "identifier":"system_time",
"opcodemap":"FAN_COIL_STATUS", "opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy", "dataType":"dummy",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": "1970-01-01 00:00:00" "value": "1970-01-01 00:00:00"
},{ },{
"identifier":"week_day", "identifier":"week_day",
"opcodemap":"FAN_COIL_STATUS", "opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy", "dataType":"dummy",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"total_work_time", "identifier":"total_work_time",
"opcodemap":"FAN_COIL_STATUS", "opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy", "dataType":"dummy",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
},{ },{
"identifier":"timing_boot", "identifier":"timing_boot",
"opcodemap":"FAN_COIL_STATUS", "opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy", "dataType":"dummy",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": { "value": {
"enable ": false, "enable ": false,
"time": "00:00" "time": "00:00"
} }
} }
], ],
"oldccu":[ "oldccu":[
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"PowerSwitch", "identifiermap":"PowerSwitch",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["OFF","ON"], "valueRange":["OFF","ON"],
"syn":"on", "syn":"on",
"synType":"bool" "synType":"bool"
},{ },{
"opcode":"FAN_COIL_SET_RUN_MODEL", "opcode":"FAN_COIL_SET_RUN_MODEL",
"identifiermap":"WorkMode", "identifiermap":"WorkMode",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["COLD","HOT","WIND","DEHUMIDIFICATION"], "valueRange":["COLD","HOT","WIND","DEHUMIDIFICATION"],
"syn":"run_model", "syn":"run_model",
"synType":"map" "synType":"map"
},{ },{
"opcode":"FAN_COIL_SET_FUN_SPEED", "opcode":"FAN_COIL_SET_FUN_SPEED",
"identifiermap":"WindSpeed", "identifiermap":"WindSpeed",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["AUTO","HIGH","MID","LOW"], "valueRange":["AUTO","HIGH","MID","LOW"],
"syn":"fan_speed", "syn":"fan_speed",
"synType":"map" "synType":"map"
},{ },{
"opcode":"FAN_COIL_SET_TEMPERATURE", "opcode":"FAN_COIL_SET_TEMPERATURE",
"identifiermap":"TargetTemperature", "identifiermap":"TargetTemperature",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"setting_temperature", "syn":"setting_temperature",
"synType":"double" "synType":"double"
},{ },{
"opcode":"FAN_COIL_SET_DELAY_SWITCH_TASK", "opcode":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"identifiermap":"TimingOffTime", "identifiermap":"TimingOffTime",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"timing_shutdown", "syn":"timing_shutdown",
"synType":"timing_shutdown" "synType":"timing_shutdown"
},{ },{
"opcode":"FAN_COIL_SET_LOCK_STATUS", "opcode":"FAN_COIL_SET_LOCK_STATUS",
"identifiermap":"ChildLockState", "identifiermap":"ChildLockState",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"", "syn":"",
"synType":"dummy" "synType":"dummy"
},{ },{
"opcode":"room_temperature", "opcode":"room_temperature",
"identifiermap":"CurrentTemperature", "identifiermap":"CurrentTemperature",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"room_temperature", "syn":"room_temperature",
"synType":"double" "synType":"double"
},{ },{
"opcode":"FAN_COIL_STATUS", "opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_id", "identifiermap":"smart_model_id",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"smart_model_id", "syn":"smart_model_id",
"synType":"double" "synType":"double"
},{ },{
"opcode":"FAN_COIL_STATUS", "opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_time_index", "identifiermap":"smart_model_time_index",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"smart_model_time_index", "syn":"smart_model_time_index",
"synType":"double" "synType":"double"
},{ },{
"opcode":"FAN_COIL_STATUS", "opcode":"FAN_COIL_STATUS",
"identifiermap":"system_time", "identifiermap":"system_time",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"system_time", "syn":"system_time",
"synType":"map" "synType":"map"
},{ },{
"opcode":"FAN_COIL_STATUS", "opcode":"FAN_COIL_STATUS",
"identifiermap":"week_day", "identifiermap":"week_day",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"week_day", "syn":"week_day",
"synType":"int" "synType":"int"
},{ },{
"opcode":"FAN_COIL_STATUS", "opcode":"FAN_COIL_STATUS",
"identifiermap":"total_work_time", "identifiermap":"total_work_time",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"total_work_time", "syn":"total_work_time",
"synType":"int" "synType":"int"
},{ },{
"opcode":"FAN_COIL_STATUS", "opcode":"FAN_COIL_STATUS",
"identifiermap":"timing_boot", "identifiermap":"timing_boot",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"timing_boot", "syn":"timing_boot",
"synType":"def" "synType":"def"
} }
] ]
} }
{ {
"productCode":"3051", "productCode":"3051",
"operateType":"3499", "operateType":"3499",
"channel":1, "channel":1,
"syn_type":1, "syn_type":1,
"syn_opcode":"DOOR_CONTACT_STATUS", "syn_opcode":"DOOR_CONTACT_STATUS",
"newccu":[ "newccu":[
{ {
"identifier":"ContactState", "identifier":"ContactState",
"opcodemap":"DOOR_CONTACT_NOTIFY", "opcodemap":"DOOR_CONTACT_NOTIFY",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
"valueRange":[0,1], "valueRange":[0,1],
"value": 0 "value": 0
}, },
{ {
"identifier":"Battery", "identifier":"Battery",
"opcodemap":"POWER_NOTIFY", "opcodemap":"POWER_NOTIFY",
"dataType":"double", "dataType":"double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"value": 0 "value": 0
} }
], ],
"oldccu":[ "oldccu":[
{ {
"opcode":"DOOR_CONTACT_NOTIFY", "opcode":"DOOR_CONTACT_NOTIFY",
"identifiermap":"ContactState", "identifiermap":"ContactState",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["CLOSE","OPEN"], "valueRange":["CLOSE","OPEN"],
"syn":"status", "syn":"status",
"synType":"map" "synType":"map"
}, },
{ {
"opcode":"POWER_NOTIFY", "opcode":"POWER_NOTIFY",
"identifiermap":"Battery", "identifiermap":"Battery",
"dataType":"string_double", "dataType":"string_double",
"channel":"1", "channel":"1",
"valueRange":[], "valueRange":[],
"syn":"power", "syn":"power",
"synType":"string_double" "synType":"string_double"
} }
] ]
} }
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"method": "thing.service.property.set", "method": "thing.service.property.set",
"inputData": [ "inputData": [
{ {
"identifier": "TargetTemperature", "identifier": "Temperature",
"name": "目标温度", "name": "目标温度",
"dataType": { "dataType": {
"type": "double", "type": "double",
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
"desc": "属性获取", "desc": "属性获取",
"method": "thing.service.property.get", "method": "thing.service.property.get",
"inputData": [ "inputData": [
"TargetTemperature", "Temperature",
"CurrentTemperature", "CurrentTemperature",
"PowerSwitch", "PowerSwitch",
"ChildLockState", "ChildLockState",
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
], ],
"outputData": [ "outputData": [
{ {
"identifier": "TargetTemperature", "identifier": "Temperature",
"name": "目标温度", "name": "目标温度",
"dataType": { "dataType": {
"type": "double", "type": "double",
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
} }
}, },
{ {
"identifier": "TargetTemperature", "identifier": "Temperature",
"name": "目标温度", "name": "目标温度",
"accessMode": "rw", "accessMode": "rw",
"required": true, "required": true,
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
"method": "thing.event.property.post", "method": "thing.event.property.post",
"outputData": [ "outputData": [
{ {
"identifier": "TargetTemperature", "identifier": "Temperature",
"name": "目标温度", "name": "目标温度",
"dataType": { "dataType": {
"type": "double", "type": "double",
......
...@@ -120,7 +120,19 @@ ...@@ -120,7 +120,19 @@
"desc": "属性上报" "desc": "属性上报"
}, },
{ {
"outputData": [], "outputData":[
{
"identifier": "sosAlarmState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"identifier": "sosAlarm", "identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post", "method": "thing.event.sosAlarm.post",
"name": "sosAlarm", "name": "sosAlarm",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment