Ding:Tradfri: Unterschied zwischen den Versionen
Mose (Diskussion | Beiträge) (→Quellen: pytradfri) |
Mose (Diskussion | Beiträge) (→IKEA: More gateway keys (some unknown)) |
||
(7 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 9: | Zeile 9: | ||
* To add multiple remotes to a group simply pair it with a remote that is already in that group. | * To add multiple remotes to a group simply pair it with a remote that is already in that group. | ||
== | == CoAP Communication == | ||
I use [https://github.com/obgm/libcoap libcoap] for all examples. Replace $GWIP with your gateway's IP-Address. | I use [https://github.com/obgm/libcoap libcoap] for all examples. Replace $GWIP with your gateway's IP-Address. | ||
Zeile 15: | Zeile 15: | ||
For more information on CoAP see [https://tools.ietf.org/html/rfc7252#section-5.8 RFC7252]. | For more information on CoAP see [https://tools.ietf.org/html/rfc7252#section-5.8 RFC7252]. | ||
=== | === Gateway === | ||
==== Get key for new identity ==== | ==== Authenticate / Get key for new identity ==== | ||
Since gateway version 1.1.15 you need to get an individual identity and key for all requests you make. | Since gateway version 1.1.15 you need to get an individual identity and key for all requests you make. | ||
Zeile 29: | Zeile 29: | ||
The identity you choose is referred as $IDENT in all further examples. The answer 9091 has to be used as $PSK. | The identity you choose is referred as $IDENT in all further examples. The answer 9091 has to be used as $PSK. | ||
==== General informations ==== | |||
#> coap-client -m get -u $IDENT -k $PSK coaps://$GWIP:5684/15011/15012 | |||
... | |||
==== Get valid endpoints ==== | |||
#> coap-client -m get -u $IDENT -k $PSK coaps://$GWIP:5684/.well-known/core | |||
==== Activate commisioning mode ==== | |||
#> coap-client -m put -u $IDENT -k $PSK -e '{"9061":<span style="color:red">Timeout</span>}' coaps://$GWIP:5684/15011/15012 | |||
Puts the gateway in a state in which it accepts pairings for up to <span style="color:red">Timeout</span> seconds. | |||
==== Reboot ==== | |||
#> coap-client -m post -u $IDENT -k $PSK coaps://$GWIP:5684/15011/9030 | |||
==== Factory defaults ==== | |||
#> coap-client -m post -u $IDENT -k $PSK coaps://$GWIP:5684/15011/9031 | |||
=== Devices === | === Devices === | ||
Zeile 72: | Zeile 96: | ||
#> coap-client -m delete -u $IDENT -k $PSK coaps://$GWIP:5684/15004/<span style="color:red">GroupID</span> | #> coap-client -m delete -u $IDENT -k $PSK coaps://$GWIP:5684/15004/<span style="color:red">GroupID</span> | ||
== | == Key Reference == | ||
==== | === IKEA === | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
Zeile 117: | Zeile 135: | ||
|- | |- | ||
| 5706 || COLOR | | 5706 || COLOR | ||
|- | |||
| 5707 || HUE | |||
|- | |||
| 5708 || SATURATION | |||
|- | |- | ||
| 5709 || COLOR_X | | 5709 || COLOR_X | ||
|- | |- | ||
| 5710 || COLOR_Y | | 5710 || COLOR_Y | ||
|- | |||
| 5711 || COLOR_TEMPERATURE | |||
|- | |- | ||
| 5712 || TRANSITION_TIME | | 5712 || TRANSITION_TIME | ||
Zeile 223: | Zeile 247: | ||
|- | |- | ||
| 9059 || CURRENT_TIMESTAMP | | 9059 || CURRENT_TIMESTAMP | ||
|- | |||
| 9060 || CURRENT_TIMESTAMP_ISO8601 | |||
|- | |- | ||
| 9061 || COMMISSIONING_MODE | | 9061 || COMMISSIONING_MODE | ||
|- | |||
| 9062 || -unknown- | |||
|- | |- | ||
| 9063 || AUTH_PATH | | 9063 || AUTH_PATH | ||
Zeile 239: | Zeile 267: | ||
|- | |- | ||
| 9071 || GATEWAY_TIME_SOURCE | | 9071 || GATEWAY_TIME_SOURCE | ||
|- | |||
| 9073 || -unknown- | |||
|- | |||
| 9075 || -unknown- | |||
|- | |||
| 9077 || -unknown- | |||
|- | |||
| 9078 || -unknown- | |||
|- | |||
| 9081 || -unknown- maybe Gateway ID | |||
|- | |||
| 9082 || -unknown- | |||
|- | |||
| 9083 || HOMEKIT_ID | |||
|- | |- | ||
| 9090 || CLIENT_IDENTITY_PROPOSED | | 9090 || CLIENT_IDENTITY_PROPOSED | ||
|- | |- | ||
| 9091 || NEW_PSK_BY_GW | | 9091 || NEW_PSK_BY_GW | ||
|- | |||
| 9092 || CERTIFICATE_PROV | |||
|- | |||
| 9093 || ALEXA_PAIR_STATUS | |||
|- | |||
| 9094 || SEND_CERT_TO_GATEWAY | |||
|- | |||
| 9095 || SEND_COGNITO_ID_TO_GATEWAY | |||
|- | |||
| 9096 || CERTIFICATE_PEM | |||
|- | |||
| 9097 || KEY_PAIR | |||
|- | |||
| 9098 || PUBLIC_KEY | |||
|- | |||
| 9099 || PRIVATE_KEY | |||
|- | |||
| 9100 || GATEWAY_ID | |||
|- | |||
| 9101 || COGNITO_ID | |||
|- | |||
| 9103 || IOT_ENDPOINT | |||
|- | |||
| 9104 || SEND_GH_COGNITO_ID_TO_GATEWAY | |||
|- | |||
| 9105 || GOOGLE_HOME_PAIR_STATUS | |||
|- | |- | ||
| 9994 || TIME_ARRAY | | 9994 || TIME_ARRAY | ||
Zeile 267: | Zeile 335: | ||
|- | |- | ||
| 15013 || LIGHT_SETTING | | 15013 || LIGHT_SETTING | ||
|} | |||
=== OMA LwM2M === | |||
<pre>3 – Device | |||
0 – Manufacturer | |||
1 – Model Number | |||
2 – Serial Number | |||
3 – Firmware Version | |||
4 – Reboot | |||
5 – Factory Reset | |||
6 – Available Power Sources | |||
> 0 – DC power | |||
> 1 – Internal Battery | |||
> 2 – External Battery | |||
> 3 – | |||
> 4 – Power over Ethernet | |||
> 5 – USB | |||
> 6 – AC (Mains) power | |||
> 7 – Solar | |||
7 – Power Source Voltage | |||
8 – Power Source Current | |||
9 – Battery Level | |||
</pre> | |||
== Defined Colors == | |||
{| class="wikitable sortable" | |||
|- | |||
!style="width:1em"| !! RGB-Hex !! Name | |||
|- | |||
|style="background-color:#dcf0f8"| || dcf0f8 || cold_sky | |||
|- | |||
|style="background-color:#eaf6fb"| || eaf6fb || cool_daylight | |||
|- | |||
|style="background-color:#f5faf6"| || f5faf6 || cool_white | |||
|- | |||
|style="background-color:#f2eccf"| || f2eccf || sunrise | |||
|- | |||
|style="background-color:#f1e0b5"| || f1e0b5 || warm_white | |||
|- | |||
|style="background-color:#efd275"| || efd275 || warm_glow | |||
|- | |||
|style="background-color:#ebb63e"| || ebb63e || candlelight | |||
|- | |||
|style="background-color:#e78834"| || e78834 || warm_amber | |||
|- | |||
|style="background-color:#e57345"| || e57345 || peach | |||
|- | |||
|style="background-color:#da5d41"| || da5d41 || dark_peach | |||
|- | |||
|style="background-color:#dc4b31"| || dc4b31 || saturated_red | |||
|- | |||
|style="background-color:#e491af"| || e491af || pink | |||
|- | |||
|style="background-color:#e8bedd"| || e8bedd || light_pink | |||
|- | |||
|style="background-color:#d9337c"| || d9337c || saturated_pink | |||
|- | |||
|style="background-color:#c984bb"| || c984bb || light_purple | |||
|- | |||
|style="background-color:#8f2686"| || 8f2686 || saturated_purple | |||
|- | |||
|style="background-color:#4a418a"| || 4a418a || blue | |||
|- | |||
|style="background-color:#6c83ba"| || 6c83ba || light_blue | |||
|- | |||
|style="background-color:#a9d62b"| || a9d62b || lime | |||
|- | |||
|style="background-color:#d6e44b"| || d6e44b || yellow | |||
|} | |} | ||
Zeile 274: | Zeile 413: | ||
https://github.com/ggravlingen/pytradfri | https://github.com/ggravlingen/pytradfri | ||
http://www.openmobilealliance.org/tech/profiles/LWM2M_Device-v1_0.xml | |||
[[Kategorie:Projekte]] | [[Kategorie:Projekte]] |
Aktuelle Version vom 18. März 2018, 02:56 Uhr
This page is a collection of findings while fiddling around with Ikea Tradfri devices, mostly with the gateway interface. As there is no public documentation for this, most of this was found by me or other people on the interwebs through try and error or reverse engineering of code. This page and the information on it is not affiliated with Ikea of Sweden AB.
You can reach me through IRC: IVI053 in #fln on freenode.
General Notes
- Devices should be powered when operations are performed on them, otherwise you could end up in an inconsistent state.
- After moving a device to a group you need to press the pairing button on all remotes in this group.
- To add multiple remotes to a group simply pair it with a remote that is already in that group.
CoAP Communication
I use libcoap for all examples. Replace $GWIP with your gateway's IP-Address.
For more information on CoAP see RFC7252.
Gateway
Authenticate / Get key for new identity
Since gateway version 1.1.15 you need to get an individual identity and key for all requests you make.
#> coap-client -m post -u "Client_identity" -k SecurityCode -e "{\"9090\":\"Identity\"}" coaps://$GWIP:5684/15011/9063
{ "9091":"A0bcDeF12g3hIJkL", "9029":"1.3.0014" }
The identity you choose is referred as $IDENT in all further examples. The answer 9091 has to be used as $PSK.
General informations
#> coap-client -m get -u $IDENT -k $PSK coaps://$GWIP:5684/15011/15012
...
Get valid endpoints
#> coap-client -m get -u $IDENT -k $PSK coaps://$GWIP:5684/.well-known/core
Activate commisioning mode
#> coap-client -m put -u $IDENT -k $PSK -e '{"9061":Timeout}' coaps://$GWIP:5684/15011/15012
Puts the gateway in a state in which it accepts pairings for up to Timeout seconds.
Reboot
#> coap-client -m post -u $IDENT -k $PSK coaps://$GWIP:5684/15011/9030
Factory defaults
#> coap-client -m post -u $IDENT -k $PSK coaps://$GWIP:5684/15011/9031
Devices
List IDs
#> coap-client -m get -u $IDENT -k $PSK coaps://$GWIP:5684/15001
[ 65574, 65576, 65586 ]
Groups
List IDs
#> coap-client -m get -u $IDENT -k $PSK coaps://$GWIP:5684/15004
[ 131080, 131079, 131092 ]
Create
#> coap-client -m post -u $IDENT -k $PSK -e '{"9001":"NewName"}' coaps://$GWIP:5684/15004
Add device to group
#> coap-client -m put -u $IDENT -k $PSK -e '{"9038":GroupID,"9003":[DeviceID]}' coaps://$GWIP:5684/15004/add
Remove device from group
#> coap-client -m put -u $IDENT -k $PSK -e '{"9038":GroupID,"9003":[DeviceID]}' coaps://$GWIP:5684/15004/remove
Without 9038 you can remove a device from all groups at once.
Delete
#> coap-client -m delete -u $IDENT -k $PSK coaps://$GWIP:5684/15004/GroupID
Key Reference
IKEA
Key | Value |
---|---|
1001 | NEW_FIRMWARE_AVAILABLE |
1002 | SMART_TASK_TRIGGERED_EVENT |
1003 | GATEWAY_REBOOT_NOTIFICATION |
2051 | OPTION_APP_TOKEN |
3300 | SENSOR |
3311 | LIGHT |
3312 | PLUG |
5001 | LOSS_OF_INTERNET_CONNECTIVITY |
5601 | MIN_MSR_VALUE |
5602 | MAX_MSR_VALUE |
5603 | MIN_RNG_VALUE |
5604 | MAX_RNG_VALUE |
5605 | RESET_MIN_MAX_MSR |
5700 | SENSOR_VALUE |
5701 | UNIT |
5706 | COLOR |
5707 | HUE |
5708 | SATURATION |
5709 | COLOR_X |
5710 | COLOR_Y |
5711 | COLOR_TEMPERATURE |
5712 | TRANSITION_TIME |
5750 | TYPE |
5751 | SENSOR_TYPE |
5805 | CUM_ACTIVE_POWER |
5820 | POWER_FACTOR |
5850 | ONOFF |
5851 | DIMMER |
5852 | ON_TIME |
9001 | NAME |
9002 | CREATED_AT |
9003 | INSTANCE_ID |
9009 | SCENE_LINK |
9014 | NOTIFICATION_STATE |
9015 | NOTIFICATION_EVENT |
9016 | SMART_TASK_TEMPLATE |
9017 | NOTIFICATION_NVPAIR |
9018 | HS_ACCESSORY_LINK |
9019 | REACHABILITY_STATE |
9020 | LAST_SEEN |
9023 | NTP_SERVER |
9024 | TIME_REMAINING_IN_SECONDS |
9029 | VERSION |
9030 | REBOOT |
9031 | RESET |
9032 | FORCE_CHECK_OTA_UPDATE |
9033 | SESSION_ID |
9034 | UPDATE_FIRMWARE |
9035 | GATEWAY_NAME |
9036 | MASTER_TOKEN_TAG |
9037 | OTA_UPDATE |
9038 | GROUP_ID |
9039 | SCENE_ID |
9040 | SMART_TASK_TYPE |
9041 | REPEAT_DAYS |
9042 | START_ACTION |
9043 | END_ACTION |
9044 | TRIGGER_TIME_INTERVAL |
9045 | GROUP_SETTINGS |
9046 | START_TIME_HR |
9047 | START_TIME_MN |
9048 | END_TIME_HR |
9049 | END_TIME_MN |
9050 | SMART_TASK_ACTION |
9051 | SHORTCUT_ICON_REFERENCE_TYPE |
9052 | GATEWAY_REBOOT_NOTIFICATION_TYPE |
9054 | OTA_UPDATE_STATE |
9055 | GATEWAY_UPDATE_PROGRESS |
9056 | GATEWAY_UPDATE_DETAILS_URL |
9057 | SCENE_INDEX |
9058 | SCENE_ACTIVATE_FLAG |
9059 | CURRENT_TIMESTAMP |
9060 | CURRENT_TIMESTAMP_ISO8601 |
9061 | COMMISSIONING_MODE |
9062 | -unknown- |
9063 | AUTH_PATH |
9064 | SESSION_LENGTH |
9066 | OTA_TYPE |
9068 | IKEA_MOODS |
9069 | UPDATE_ACCEPTED_TIMESTAMP |
9070 | USE_CURRENT_LIGHT_SETTINGS |
9071 | GATEWAY_TIME_SOURCE |
9073 | -unknown- |
9075 | -unknown- |
9077 | -unknown- |
9078 | -unknown- |
9081 | -unknown- maybe Gateway ID |
9082 | -unknown- |
9083 | HOMEKIT_ID |
9090 | CLIENT_IDENTITY_PROPOSED |
9091 | NEW_PSK_BY_GW |
9092 | CERTIFICATE_PROV |
9093 | ALEXA_PAIR_STATUS |
9094 | SEND_CERT_TO_GATEWAY |
9095 | SEND_COGNITO_ID_TO_GATEWAY |
9096 | CERTIFICATE_PEM |
9097 | KEY_PAIR |
9098 | PUBLIC_KEY |
9099 | PRIVATE_KEY |
9100 | GATEWAY_ID |
9101 | COGNITO_ID |
9103 | IOT_ENDPOINT |
9104 | SEND_GH_COGNITO_ID_TO_GATEWAY |
9105 | GOOGLE_HOME_PAIR_STATUS |
9994 | TIME_ARRAY |
9995 | GROUP_LINK_ARRAY |
15001 | DEVICES |
15002 | HS_LINK |
15004 | GROUPS |
15005 | SCENE |
15006 | NOTIFICATIONS |
15009 | SWITCH |
15010 | SCHEDULES |
15011 | GATEWAY |
15012 | GATEWAY_DETAILS |
15013 | LIGHT_SETTING |
OMA LwM2M
3 – Device 0 – Manufacturer 1 – Model Number 2 – Serial Number 3 – Firmware Version 4 – Reboot 5 – Factory Reset 6 – Available Power Sources > 0 – DC power > 1 – Internal Battery > 2 – External Battery > 3 – > 4 – Power over Ethernet > 5 – USB > 6 – AC (Mains) power > 7 – Solar 7 – Power Source Voltage 8 – Power Source Current 9 – Battery Level
Defined Colors
RGB-Hex | Name | |
---|---|---|
dcf0f8 | cold_sky | |
eaf6fb | cool_daylight | |
f5faf6 | cool_white | |
f2eccf | sunrise | |
f1e0b5 | warm_white | |
efd275 | warm_glow | |
ebb63e | candlelight | |
e78834 | warm_amber | |
e57345 | peach | |
da5d41 | dark_peach | |
dc4b31 | saturated_red | |
e491af | pink | |
e8bedd | light_pink | |
d9337c | saturated_pink | |
c984bb | light_purple | |
8f2686 | saturated_purple | |
4a418a | blue | |
6c83ba | light_blue | |
a9d62b | lime | |
d6e44b | yellow |
Quellen
https://github.com/Hypfer/node-tradfri
https://github.com/ggravlingen/pytradfri
http://www.openmobilealliance.org/tech/profiles/LWM2M_Device-v1_0.xml