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*
cJSON *old_ccu_msg_build(const char* nodeid,const char* opcode,const char* status,const char* arg);
int send_msg_to_module(cJSON *root);
cJSON * val_conver_new2old(cJSON *newccuItem,cJSON *oldccuItem,int syn_type);
int arming_status_notify(int type);
......
......@@ -30,7 +30,7 @@
#define PRODUCT_TPYE "kk"
#define CCU_LAN "eth1"
#define KK_CCU_ID "CCU_77770"
#define KK_CCU_ID "CCU_77771"
#define KK_CCU_PRODUCTID "ccu_n12"
#define KK_GW_PRODUCTID "gateway_2"
#define KK_CCU_RANDOM "0000000000"
......
......@@ -410,6 +410,36 @@ int kk_get_device_name(const char* deviceCode,const char *epNum,char *devName,in
_kk_area_unlock();
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 res = 0;
......
......@@ -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_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_device_roomInfo(const char* deviceCode,int epNum,char *roomName,char *roomId);
#endif
......@@ -292,9 +292,10 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA
else{
return FAIL_RETURN;
}
dm_mgr_properities_db_create(node->dev_shadow,deviceCode,dev_type);
INIT_LIST_HEAD(&node->linked_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){
_dm_init_tsl_params(node->dev_shadow,node->deviceCode);
......
This diff is collapsed.
......@@ -179,6 +179,42 @@ static int _kk_check_property_exist(const char* deviceCode,const char* identifie
_kk_property_db_unlock();
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
......@@ -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)
{
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) \
values ('%s','%s','%s','%d','%d');";
char *sqlCmd = NULL;
int rc = 0;
char *zErrMsg = 0;
kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx();
printf("---------------------------------------->1\n");
if(_kk_check_property_exist(deviceCode,identifier) == 1)
{
return SUCCESS_RETURN;
}
printf("---------------------------------------->2\n");
_kk_property_db_lock();
//传感器类默认安防等级为离家安防
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{
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_
_kk_property_db_unlock();
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
......
......@@ -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_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_query_epnums(const char *deviceCode,int epList[]);
#endif
......@@ -79,8 +79,9 @@ int kk_sync_init(void)
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';";
int res = 0;
char *sqlCmd = NULL;
sqlite3_stmt *stmt;
char *deviceCode = NULL;
......@@ -96,12 +97,20 @@ static cJSON * kk_get_room_devices(const char *roomId)
deviceCode = (char*)sqlite3_column_text(stmt, DB_DEV_DEVICECODE);
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)){
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_SCENE_EPNUM_STR,epNum);
kk_get_device_name(deviceCode,epNum,devName,sizeof(devName));
......@@ -367,6 +376,61 @@ static cJSON *kk_get_properties_info(char *deviceCode,int devType)
sqlite3_finalize(stmt);
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)
{
char *sqlCmd = NULL;
......@@ -471,6 +535,7 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
kk_sync_ctx_t *ctx = _kk_sync_get_ctx();
char *subDeviceCode = NULL;
char *subProductCode = NULL;
char *subproductType = NULL;
char *subVersion = NULL;
char *subIsline = NULL;
if(gwdevicesItem == NULL || deviceCode == NULL){
......@@ -488,7 +553,8 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
subDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE);
subProductCode = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTCODE);
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_VERSION_STR, subVersion);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_MAC_STR, subDeviceCode);
......@@ -503,7 +569,10 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
if(kk_check_multi_ep_num(subDeviceCode)){
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);
}
......
......@@ -39,6 +39,8 @@
#include "kk_scene_handle.h"
#include "dm_ota.h"
#include "ccu_ver.h"
#include "kk_area_handle.h"
int g_timezone = 8;
char * g_filerToPlatTable[] =
{
......@@ -568,7 +570,12 @@ static int kk_alarm_notify_handle(dm_mgr_dev_node_t *node,char *identifier,char
cJSON *param = cJSON_CreateObject();
if(strcmp(identifier,"BatteryAlarm") == 0){
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_AddItemToObject(payload, "params", param);
......@@ -636,7 +643,7 @@ static int kk_indoorAir_property_save(cJSON *payload,char *deviceCode)
if(epNum->type == cJSON_Number){
epNumInt = epNum->valueint;
}else if(epNum->type == cJSON_String){
epNumInt = epNum->valuestring;
epNumInt = atoi(epNum->valuestring);
}
for(idx = 0; idx < node->dev_shadow->property_number; 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
static int kk_indoorAir_online_handle(dm_mgr_dev_node_t *node ,char *deviceCode,int epNum)
{
int idx = 0;
int gwExist = 0;
char roomId[32] = {0};
char roomName[256] = {0};
char epNumStr[10] = {0};
kk_tsl_data_t *property = NULL;
if(node == NULL){
return -1;
......@@ -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);
}
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;
}
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);
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++){
eventItem = node->dev_shadow->events + idx;
if(eventItem != NULL){
......@@ -867,7 +886,8 @@ void kk_platMsg_handle(void* data, char* chalMark){
kk_tsl_data_t *itemData = NULL;
for(index = 0; index < eventItem->output_data_number;index++){
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);
if(itemDataIdentifier != NULL){
memset(tmpStr,0x0,sizeof(tmpStr));
......@@ -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);
}
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");
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
......@@ -904,7 +924,7 @@ void kk_platMsg_handle(void* data, char* chalMark){
itemStr = cJSON_GetObjectItem(jsonPay, eventItem->identifier);
if(itemStr != NULL){
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);
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
......
This diff is collapsed.
{
"productCode":"3020",
"operateType":"2001",
"channel":1,
"syn_type":1,
"syn_opcode":"STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"Power",
"opcodemap":"GET_DEV_POWER",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},
{
"identifier":"Electric",
"opcodemap":"GET_ELECTRICAL",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},
{
"identifier":"",
"opcodemap":"STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 1
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"switch",
"synType":"map"
},
{
"opcode":"GET_DEV_POWER",
"identifiermap":"Power",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},
{
"opcode":"GET_ELECTRICAL",
"identifiermap":"Electric",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},
{
"opcode":"STATUS",
"identifiermap":"",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"syn":"light_switch",
"synType":"bool"
}
]
}
{
"productCode":"3020",
"operateType":"2001",
"channel":1,
"syn_type":1,
"syn_opcode":"STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"Power",
"opcodemap":"GET_DEV_POWER",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},
{
"identifier":"Electric",
"opcodemap":"GET_ELECTRICAL",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},
{
"identifier":"",
"opcodemap":"STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 1
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"switch",
"synType":"map"
},
{
"opcode":"GET_DEV_POWER",
"identifiermap":"Power",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},
{
"opcode":"GET_ELECTRICAL",
"identifiermap":"Electric",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},
{
"opcode":"STATUS",
"identifiermap":"",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"syn":"light_switch",
"synType":"bool"
}
]
}
\ No newline at end of file
{
"productCode":"3023",
"operateType":"3",
"channel":2,
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"2",
"valueRange":[0,1],
"value": 0
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"]
},
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"2",
"valueRange":["OFF","ON"]
}
]
}
{
"productCode":"3023",
"operateType":"3",
"channel":2,
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"2",
"valueRange":[0,1],
"value": 0
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"]
},
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"2",
"valueRange":["OFF","ON"]
}
]
}
\ No newline at end of file
{
"productCode":"3027",
"operateType":"1003",
"channel":2,
"newccu":[
{
"identifier":"OperationMode",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1,2],
"value": 2
},
{
"identifier":"OperationMode",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"2",
"valueRange":[0,1,2],
"value": 2
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"OperationMode",
"dataType":"map",
"channel":"1",
"valueRange":["CLOSE","OPEN","STOP"]
},
{
"opcode":"SWITCH",
"identifiermap":"OperationMode",
"dataType":"map",
"channel":"2",
"valueRange":["CLOSE","OPEN","STOP"]
}
]
}
{
"productCode":"3027",
"operateType":"1003",
"channel":2,
"newccu":[
{
"identifier":"OperationMode",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1,2],
"value": 2
},
{
"identifier":"OperationMode",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"2",
"valueRange":[0,1,2],
"value": 2
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"OperationMode",
"dataType":"map",
"channel":"1",
"valueRange":["CLOSE","OPEN","STOP"]
},
{
"opcode":"SWITCH",
"identifiermap":"OperationMode",
"dataType":"map",
"channel":"2",
"valueRange":["CLOSE","OPEN","STOP"]
}
]
}
\ No newline at end of file
{
"productCode":"3032",
"operateType":"14002",
"channel":1,
"syn_type":1,
"syn_opcode":"CHOPIN_FRESH_AIR_STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"FRESH_AIR_SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"WorkMode",
"opcodemap":"FRESH_AIR_RUN_MODEL",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 1
},{
"identifier":"WindSpeed",
"opcodemap":"FRESH_AIR_SPEED_SET",
"dataType":"int",
"channel":"1",
"valueRange":[0,1,2,3],
"value": 1
},{
"identifier":"ChildLockState",
"opcodemap":"FRESH_AIR_SET_LOCK_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"TimingOffTime",
"opcodemap":"FRESH_AIR_SET_TIME_OFF",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"StrainerUsageTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"StrainerAlarmTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"CurrentTemperature",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
}
],
"oldccu":[
{
"opcode":"FRESH_AIR_SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"on",
"synType":"bool"
},{
"opcode":"FRESH_AIR_RUN_MODEL",
"identifiermap":"WorkMode",
"dataType":"map",
"channel":"1",
"valueRange":["AUTO","MANUAL"],
"syn":"runModel",
"synType":"map"
},{
"opcode":"FRESH_AIR_SPEED_SET",
"identifiermap":"WindSpeed",
"dataType":"map",
"channel":"1",
"valueRange":["STOP","LOW","MID","HIGH"],
"syn":"speed",
"synType":"int"
},{
"opcode":"FRESH_AIR_SET_LOCK_STATUS",
"identifiermap":"ChildLockState",
"dataType":"bool",
"channel":"1",
"valueRange":[],
"syn":"ChildLockState",
"synType":"double"
},{
"opcode":"FRESH_AIR_SET_TIME_OFF",
"identifiermap":"TimingOffTime",
"dataType":"string_time",
"channel":"1",
"valueRange":[],
"syn":"time_off",
"synType":"string_time"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS ",
"identifiermap":"StrainerUsageTime",
"dataType":"int",
"channel":"1",
"valueRange":[],
"syn":"filterScreenWorkTime",
"synType":"int"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"StrainerAlarmTime",
"dataType":"int",
"channel":"1",
"valueRange":[],
"syn":"filterScreenAlarmTime",
"synType":"int"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"CurrentTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"cur_temperature",
"synType":"double"
}
]
}
{
"productCode":"3032",
"operateType":"14002",
"channel":1,
"syn_type":1,
"syn_opcode":"CHOPIN_FRESH_AIR_STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"FRESH_AIR_SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"WorkMode",
"opcodemap":"FRESH_AIR_RUN_MODEL",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 1
},{
"identifier":"WindSpeed",
"opcodemap":"FRESH_AIR_SPEED_SET",
"dataType":"int",
"channel":"1",
"valueRange":[0,1,2,3],
"value": 1
},{
"identifier":"ChildLockState",
"opcodemap":"FRESH_AIR_SET_LOCK_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"TimingOffTime",
"opcodemap":"FRESH_AIR_SET_TIME_OFF",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"StrainerUsageTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"StrainerAlarmTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"CurrentTemperature",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
}
],
"oldccu":[
{
"opcode":"FRESH_AIR_SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"on",
"synType":"bool"
},{
"opcode":"FRESH_AIR_RUN_MODEL",
"identifiermap":"WorkMode",
"dataType":"map",
"channel":"1",
"valueRange":["AUTO","MANUAL"],
"syn":"runModel",
"synType":"map"
},{
"opcode":"FRESH_AIR_SPEED_SET",
"identifiermap":"WindSpeed",
"dataType":"map",
"channel":"1",
"valueRange":["STOP","LOW","MID","HIGH"],
"syn":"speed",
"synType":"int"
},{
"opcode":"FRESH_AIR_SET_LOCK_STATUS",
"identifiermap":"ChildLockState",
"dataType":"bool",
"channel":"1",
"valueRange":[],
"syn":"ChildLockState",
"synType":"double"
},{
"opcode":"FRESH_AIR_SET_TIME_OFF",
"identifiermap":"TimingOffTime",
"dataType":"string_time",
"channel":"1",
"valueRange":[],
"syn":"time_off",
"synType":"string_time"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS ",
"identifiermap":"StrainerUsageTime",
"dataType":"int",
"channel":"1",
"valueRange":[],
"syn":"filterScreenWorkTime",
"synType":"int"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"StrainerAlarmTime",
"dataType":"int",
"channel":"1",
"valueRange":[],
"syn":"filterScreenAlarmTime",
"synType":"int"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"CurrentTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"cur_temperature",
"synType":"double"
}
]
}
{
"productCode":"3034",
"operateType":"15003",
"channel":1,
"syn_type":1,
"syn_opcode":"FAN_COIL_STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"WorkMode",
"opcodemap":"FAN_COIL_SET_RUN_MODEL",
"dataType":"int",
"channel":"1",
"valueRange":[1,2,3,4],
"value": 1
},{
"identifier":"WindSpeed",
"opcodemap":"FAN_COIL_SET_FUN_SPEED",
"dataType":"int",
"channel":"1",
"valueRange":[1,2,3,4],
"value": 1
},{
"identifier":"TargetTemperature",
"opcodemap":"FAN_COIL_SET_TEMPERATURE",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 16
},{
"identifier":"TimingOffTime",
"opcodemap":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"ChildLockState",
"opcodemap":"FAN_COIL_SET_LOCK_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"CurrentTemperature",
"opcodemap":"room_temperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 22
},{
"identifier":"smart_model_id",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"smart_model_time_index",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"system_time",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": "1970-01-01 00:00:00"
},{
"identifier":"week_day",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"total_work_time",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"timing_boot",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": {
"enable ": false,
"time": "00:00"
}
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"on",
"synType":"bool"
},{
"opcode":"FAN_COIL_SET_RUN_MODEL",
"identifiermap":"WorkMode",
"dataType":"map",
"channel":"1",
"valueRange":["COLD","HOT","WIND","DEHUMIDIFICATION"],
"syn":"run_model",
"synType":"map"
},{
"opcode":"FAN_COIL_SET_FUN_SPEED",
"identifiermap":"WindSpeed",
"dataType":"map",
"channel":"1",
"valueRange":["AUTO","HIGH","MID","LOW"],
"syn":"fan_speed",
"synType":"map"
},{
"opcode":"FAN_COIL_SET_TEMPERATURE",
"identifiermap":"TargetTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"setting_temperature",
"synType":"double"
},{
"opcode":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"identifiermap":"TimingOffTime",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"timing_shutdown",
"synType":"timing_shutdown"
},{
"opcode":"FAN_COIL_SET_LOCK_STATUS",
"identifiermap":"ChildLockState",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},{
"opcode":"room_temperature",
"identifiermap":"CurrentTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"room_temperature",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_id",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"smart_model_id",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_time_index",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"smart_model_time_index",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"system_time",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"system_time",
"synType":"map"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"week_day",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"week_day",
"synType":"int"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"total_work_time",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"total_work_time",
"synType":"int"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"timing_boot",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"timing_boot",
"synType":"def"
}
]
}
{
"productCode":"3034",
"operateType":"15003",
"channel":1,
"syn_type":1,
"syn_opcode":"FAN_COIL_STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"WorkMode",
"opcodemap":"FAN_COIL_SET_RUN_MODEL",
"dataType":"int",
"channel":"1",
"valueRange":[1,2,3,4],
"value": 1
},{
"identifier":"WindSpeed",
"opcodemap":"FAN_COIL_SET_FUN_SPEED",
"dataType":"int",
"channel":"1",
"valueRange":[1,2,3,4],
"value": 1
},{
"identifier":"TargetTemperature",
"opcodemap":"FAN_COIL_SET_TEMPERATURE",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 16
},{
"identifier":"TimingOffTime",
"opcodemap":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"ChildLockState",
"opcodemap":"FAN_COIL_SET_LOCK_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"CurrentTemperature",
"opcodemap":"room_temperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 22
},{
"identifier":"smart_model_id",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"smart_model_time_index",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"system_time",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": "1970-01-01 00:00:00"
},{
"identifier":"week_day",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"total_work_time",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"timing_boot",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": {
"enable ": false,
"time": "00:00"
}
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"on",
"synType":"bool"
},{
"opcode":"FAN_COIL_SET_RUN_MODEL",
"identifiermap":"WorkMode",
"dataType":"map",
"channel":"1",
"valueRange":["COLD","HOT","WIND","DEHUMIDIFICATION"],
"syn":"run_model",
"synType":"map"
},{
"opcode":"FAN_COIL_SET_FUN_SPEED",
"identifiermap":"WindSpeed",
"dataType":"map",
"channel":"1",
"valueRange":["AUTO","HIGH","MID","LOW"],
"syn":"fan_speed",
"synType":"map"
},{
"opcode":"FAN_COIL_SET_TEMPERATURE",
"identifiermap":"TargetTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"setting_temperature",
"synType":"double"
},{
"opcode":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"identifiermap":"TimingOffTime",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"timing_shutdown",
"synType":"timing_shutdown"
},{
"opcode":"FAN_COIL_SET_LOCK_STATUS",
"identifiermap":"ChildLockState",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},{
"opcode":"room_temperature",
"identifiermap":"CurrentTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"room_temperature",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_id",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"smart_model_id",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_time_index",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"smart_model_time_index",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"system_time",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"system_time",
"synType":"map"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"week_day",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"week_day",
"synType":"int"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"total_work_time",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"total_work_time",
"synType":"int"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"timing_boot",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"timing_boot",
"synType":"def"
}
]
}
{
"productCode":"3051",
"operateType":"3499",
"channel":1,
"syn_type":1,
"syn_opcode":"DOOR_CONTACT_STATUS",
"newccu":[
{
"identifier":"ContactState",
"opcodemap":"DOOR_CONTACT_NOTIFY",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"Battery",
"opcodemap":"POWER_NOTIFY",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
}
],
"oldccu":[
{
"opcode":"DOOR_CONTACT_NOTIFY",
"identifiermap":"ContactState",
"dataType":"map",
"channel":"1",
"valueRange":["CLOSE","OPEN"],
"syn":"status",
"synType":"map"
},
{
"opcode":"POWER_NOTIFY",
"identifiermap":"Battery",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"power",
"synType":"string_double"
}
]
}
{
"productCode":"3051",
"operateType":"3499",
"channel":1,
"syn_type":1,
"syn_opcode":"DOOR_CONTACT_STATUS",
"newccu":[
{
"identifier":"ContactState",
"opcodemap":"DOOR_CONTACT_NOTIFY",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"Battery",
"opcodemap":"POWER_NOTIFY",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
}
],
"oldccu":[
{
"opcode":"DOOR_CONTACT_NOTIFY",
"identifiermap":"ContactState",
"dataType":"map",
"channel":"1",
"valueRange":["CLOSE","OPEN"],
"syn":"status",
"synType":"map"
},
{
"opcode":"POWER_NOTIFY",
"identifiermap":"Battery",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"power",
"synType":"string_double"
}
]
}
\ No newline at end of file
......@@ -17,7 +17,7 @@
"method": "thing.service.property.set",
"inputData": [
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"dataType": {
"type": "double",
......@@ -88,7 +88,7 @@
"desc": "属性获取",
"method": "thing.service.property.get",
"inputData": [
"TargetTemperature",
"Temperature",
"CurrentTemperature",
"PowerSwitch",
"ChildLockState",
......@@ -97,7 +97,7 @@
],
"outputData": [
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"dataType": {
"type": "double",
......@@ -189,7 +189,7 @@
}
},
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"accessMode": "rw",
"required": true,
......@@ -273,7 +273,7 @@
"method": "thing.event.property.post",
"outputData": [
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"dataType": {
"type": "double",
......
......@@ -120,7 +120,19 @@
"desc": "属性上报"
},
{
"outputData": [],
"outputData":[
{
"identifier": "sosAlarmState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"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