Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added device description (resolves issue #25) #26

Merged
merged 4 commits into from
Apr 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,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 @@ -123,6 +158,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 @@ -175,6 +234,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