create a new device group, you can only create up to 50 groups.
200 unique_name - the unique identity of a device group
Copy {
"code" : "0" ,
"data" : {
"org_id" : "1411841915123" ,
"name" : "test group22" ,
"unique_name" : "1B86514936880D18" ,
"created" : "1587690584174"
}
}
Copy curl --request POST \
--url '{host}/1.0/group' \
--user '<username>:<password>' \
--header 'content-type: application/x-www-form-urlencoded' \
--data '{"name":"device group name"}' \
--include
200 unique_name - the unique name of a device group
created - the timestamp, unit millisecond
Copy {
"code" : "0" ,
"data" : {
"page" : {
"count" : "12"
} ,
"list" : [
{
"name" : "Default" ,
"group_unique_name" : "" ,
"created" : "0" ,
"dev_cnt" : "62" ,
"online_cnt" : "1"
} ,
{
"created" : "1553573458000" ,
"name" : "雅安茶园" ,
"group_unique_name" : "52975E5A7C2C396A" ,
"dev_cnt" : "7" ,
"online_cnt" : "0"
}
]
}
}
Copy curl --request GET \
--url '{host}/1.0/lists/group' \
--user '<username>:<password>' \
--include
list device group with devices
List all groups and devices in each group.
The Default group is a virtual group, its group_unique_name
is empty. All devices will be claimed into the Default group, users could then reorganize them with different groups.
200 dev_eui - device EUI
dev_name - device name
lon - longitude
lat - latitude
online_status - "0" offline, "1" online
battery_status - "0" battery low power, "1" battery power OK
Copy {
"code" : "0" ,
"data" : [
{
"group_name" : "Default" ,
"group_unique_name" : "" ,
"nodes" : [
{
"dev_eui" : "2CF7F12003900000" ,
"dev_name" : "TEST" ,
"lon" : "113.9291658" ,
"lat" : "22.5710348" ,
"online_status" : "0" ,
"battery_status" : "2"
} ,
{
"dev_eui" : "2CF7F12104700011" ,
"dev_name" : "US915-2CF7F12104700011" ,
"lon" : "113.926979" ,
"lat" : "22.573724" ,
"online_status" : "0" ,
"battery_status" : "2"
}
]
} ,
{
"group_name" : "demo" ,
"group_unique_name" : "00452831720DCA8A" ,
"nodes" : [
{
"dev_eui" : "2CF7F1201350001A" ,
"dev_name" : "2CF7F1201350001A" ,
"lon" : "111.304984" ,
"lat" : "26.15868" ,
"online_status" : "0" ,
"battery_status" : "2"
}
]
}
]
}
Copy curl --request GET \
--url '{host}/1.0/lists/group/devices' \
--user '<username>:<poassword>' \
--header 'content-type: application/json' \
--include