Do you have detailed documents for attribute,tags and stats for deivices


#1

Hi,

I turned on and off an LED lamp on Modulo Development Board from my Android phone on several times.
I got data of devices using APIs in Javascript programs but I don’t know some items in response.
(get http://afero.io/v1/accounts/{accountId}/devices?expansions=attributes (or tags or state) )

I need details for each items. Do you have any document which commented on the details of each item?

Following result is Sample of get http://afero.io/v1/accounts/{accountId}/devices?expansions=attributes

Example of question.
It seems that “id:” is sequencial number but is this a number for what?
What is the difference between “data:” and “value”?
If you can, please give me details of each item?

BR,
kazu

==== Real resut for get (but IDs are change to imitation) ====

[
{
deviceId:“87654321-869e-4235-8236-012345678901”,
profileId:“76543210-5287-4df8-8e8a-123456789012”,
updating:false,
createdTimestamp:1461744012219,
virtual:true,
disconnectNotificationLevel:“LOW”,
friendlyName:“Preview Device”,
attributes:[
{
id:1024,
data:“0100”,
value:“1”,
updatedTimestamp:1468992931843
},
{
id:1025,
data:“0000000000000000”,
updatedTimestamp:1462956256477
},
{
id:1030,
updatedTimestamp:1462956256488
},
{
id:1031,
data:“4500000000000000”,
updatedTimestamp:1462956256498
},
{
id:2001,
updatedTimestamp:1461744012273
},
{
id:2002,
updatedTimestamp:1461744012283
},
{
id:2003,
updatedTimestamp:1461744012293
},
{
id:2004,
updatedTimestamp:1461744012302
},
{
id:60000,
data:“01”,
updatedTimestamp:1461744012262
},
{
id:65018,
updatedTimestamp:1464243040583
},
{
id:65019,
updatedTimestamp:1461744012312
},
{
id:65020,
data:“e8030000180018000C00A00F”,
updatedTimestamp:1461744012323
},
{
id:65021,
data:“00”,
updatedTimestamp:1461744012333 //2016/4/27 17:00:02
}
],
developerDevice:false,
partnerId:“65432109-fff3-4a2d-a28e-123456789012”,
deviceTypeId:“54321098-aaf3-4c64-8499-123456789012”
},

{
deviceId:“01236a5ad62ca571”,
profileId:“43210987-eff8-4680-ac38-123456789012”,
updating:false,
createdTimestamp:1449515527819,
virtual:false,
disconnectNotificationLevel:“LOW”,
friendlyName:“Myfirst”,
attributes:[
{
id:1024,
data:“0000”,
value:“0”,
updatedTimestamp:1469078724685 //2016/7/21 14:25:24
},
{
id:1025,
data:“0000000000000000”,
value:“0”,
updatedTimestamp:1469073639478
},
{
id:1030,
data:“0100”,
value:“1”,
updatedTimestamp:1469073639613
},
{
id:1031,
data:“4500000000000000”,
value:“69”,
updatedTimestamp:1469073639684
},
{
id:2001,
data:“0000000000000000”,
value:“0”,
updatedTimestamp:1469073640119
},
{
id:2002,
data:“0000000000000000”,
value:“0”,
updatedTimestamp:1469073640183
},
{
id:2003,
data:“E60C000000000000”,
value:“3302”,
updatedTimestamp:1469073640247
},
{
id:2004,
data:“5B0E000000000000”,
value:“3675”,
updatedTimestamp:1469073640329
},
{
id:60000,
data:“01”,
value:“true”,
updatedTimestamp:1469073640450
},
{
id:65018,
data:“0000”,
value:“0”,
updatedTimestamp:1469073640546
},
{
id:65019,
data:“3030204E2F41”,
value:“00 N/A”,
updatedTimestamp:1469073640621
},
{
id:65020,
data:“FA000000180018000C00A00F”,
value:“FA000000180018000C00A00F”,
updatedTimestamp:1469073640693
},
{
id:65021,
data:“00”,
value:“false”,
updatedTimestamp:1463986236642 //2016/7/21 13:00:04
}
],
developerDevice:true,
partnerId:“65432109-fff3-4a2d-a28e-123456789012”,
deviceTypeId:“32109876-3876-47d6-821e-123456789012”
}
] ,


How to get device information from afero Cloud?
#2

Hi, Kazu!

We have just recently realized that attribute information wasn’t available in the public developer docs. Just last week, we updated them to include a list of Attributes and what they mean. Please check out https://developer.afero.io/docs/en/?target=AttrRegistry.html for a list of attributes and what they mean.

You will find some other information about attribute IDs and what they mean in another thread on the forum: Execute an Action on a Device using Cloud APIs - it looks like the thread discusses the GPIO configuration attributes which look like they didn’t get added to the developer documentation - I’ll go ahead and make a note to get those added to the official docs soon.

As far as “data” and “value”, it’s a little confusing. They are essentially the same information. “Data” stores the attribute in a little-endian hexadecimal string (that’s how the ASR-1 handles data internally) so “0100” is really hexadecimal 0x0001 which is just plain “1”.

We realized that data format was not very intuitive so we added a “value” field to display the attribute as a string representation of the atttribute since “1” makes a lot more sense to people than “0100” does.

Both attributes are read/write and will update each other automatically, so you can read/write “data” or “value” as your application sees fit.

Please let me know if you need any more information!

Cheers,

Joe