Skip to content

Commit

Permalink
Merge pull request #26 from Garrcomm/device-description
Browse files Browse the repository at this point in the history
Added device description (resolves issue #25)
  • Loading branch information
glenndehaan committed Apr 22, 2021
2 parents 313eb6f + 9c3348d commit 81bf278
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,41 @@ coap-client -m get -u "$TF_USERNAME" -k "$TF_PRESHARED_KEY" "coaps://$TF_GATEWAY

> `$TF_DEVICEID` is an id from the list generated by the previous command. Ids are 5 digits long.
The result will look something similar to this:

```json5
{
"9001":"Warm white bulb",
"9002":429400800,
"9003":65561,
"9020":1619068199,
"3311":[{"5850":0,"5849":2,"9003":0,"5851":1}],
"9019":1,
"3":{
"0":"IKEA of Sweden",
"1":"TRADFRI bulb E27 WW 806lm",
"3":"2.3.050"
},
"5750":2
}
```

The numbers translate to the following labels:

Numeric key | Type | Description
----------- | ------- | -----------
3.0 | string | Manufacturer name
3.1 | string | Product name
3.3 | string | Firmware version
3.9 | integer | Battery status, 0 to 100 (not available in the example above since bulbs don't have batteries)
3311 | array | Bulb data, see also [Bulbs](#bulbs)
5750 | integer | Device type (2 stands for Bulb)
9001 | string | Name of the device
9002 | integer | Creation timestamp
9003 | integer | Instance ID
9020 | integer | Last seen timestamp
9019 | boolean | Reachability state

## Groups

### Get a list of all groups
Expand All @@ -135,6 +170,30 @@ coap-client -m get -u "$TF_USERNAME" -k "$TF_PRESHARED_KEY" "coaps://$TF_GATEWAY

> `$TF_GROUPID` is an id from the list generated by the previous command. Ids are 6 digits long.
The result will look something similar to this:

```json5
{
"9001":"Home office",
"9018":{"15002":{"9003":[65558,65561,65563]}},
"5851":254,
"9003":131087,
"9002":429400800,
"5850":1
}
```

The numbers translate to the following labels:

Numeric key | Type | Description
----------- | ------- | -----------
5850 | boolean | On/off status of the group
5851 | integer | Brightness status of the group
9001 | string | Name of the group
9002 | integer | Creation timestamp
9003 | integer | Instance ID
9018 | array | List of items within the group

### Add device to a specific group
To add a member device to a group, use this command:
```
Expand Down Expand Up @@ -187,6 +246,30 @@ coap-client -m get -u "$TF_USERNAME" -k "$TF_PRESHARED_KEY" "coaps://$TF_GATEWAY
> `$TF_GROUPID` is an id from the list generated by the `Get a list of all groups` command. Ids are 6 digits long.
The result will look something similar to this:

```json5
{
"9001":"Home office dimmed",
"9109":2,
"9003":196630,
"9002":429400800,
"9057":1,
"15013":[{"5850":0,"9003":65544,"5851":2},{"5850":0,"9003":65539},{"5850":0,"9003":65545},{"5850":1,"9003":65546,"5851":2},{"5850":1,"9003":65557,"5851":2}]
}
```

The numbers translate to the following labels:

Numeric key | Type | Description
----------- | ------- | -----------
9001 | string | Name of the scene
9002 | integer | Creation timestamp
9003 | integer | Instance ID
9057 | integer | Scene index
9109 | integer | Icon index
15013 | array | Light settings

### Activating a scene
A scene can be activated by controlling a specific group. From this endpoint you are able to set a scene on the specified group.
A detailed payload can be found in the `Groups > Payload` chapter.
Expand Down

0 comments on commit 81bf278

Please sign in to comment.