Ding:Tradfri: Unterschied zwischen den Versionen

Aus FabLab Region Nürnberg
(color names)
K (→‎Color names: Colored fields and sorting)
Zeile 346: Zeile 346:
{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
! RGB-Hex !! Name
!style="width:1em"|  !! RGB-Hex !! Name
|-
|-
| 4a418a || Blue
 
|style="background-color:#dcf0f8"| || dcf0f8 || cold_sky
|-
|-
| 6c83ba || Light Blue
|style="background-color:#eaf6fb"| || eaf6fb || cool_daylight
|-
|-
| 8f2686 || Saturated Purple
|style="background-color:#f5faf6"| || f5faf6 || cool_white
|-
|-
| a9d62b || Lime
|style="background-color:#f2eccf"| || f2eccf || sunrise
|-
|-
| c984bb || Light Purple
|style="background-color:#f1e0b5"| || f1e0b5 || warm_white
|-
|-
| d6e44b || Yellow
|style="background-color:#efd275"| || efd275 || warm_glow
|-
|-
| d9337c || Saturated Pink
|style="background-color:#ebb63e"| || ebb63e || candlelight
|-
|-
| da5d41 || Dark Peach
|style="background-color:#e78834"| || e78834 || warm_amber
|-
|-
| dc4b31 || Saturated Red
|style="background-color:#e57345"| || e57345 || peach
|-
|-
| dcf0f8 || Cold sky
|style="background-color:#da5d41"| || da5d41 || dark_peach
|-
|-
| e491af || Pink
|style="background-color:#dc4b31"| || dc4b31 || saturated_red
|-
|-
| e57345 || Peach
|style="background-color:#e491af"| || e491af || pink
|-
|-
| e78834 || Warm Amber
|style="background-color:#e8bedd"| || e8bedd || light_pink
|-
|-
| e8bedd || Light Pink
|style="background-color:#d9337c"| || d9337c || saturated_pink
|-
|-
| eaf6fb || Cool daylight
|style="background-color:#c984bb"| || c984bb || light_purple
|-
|-
| ebb63e || Candlelight
|style="background-color:#8f2686"| || 8f2686 || saturated_purple
|-
|-
| efd275 || Warm glow
|style="background-color:#4a418a"| || 4a418a || blue
|-
|-
| f1e0b5 || Warm white
|style="background-color:#6c83ba"| || 6c83ba || light_blue
|-
|-
| f2eccf || Sunrise
|style="background-color:#a9d62b"| || a9d62b || lime
|-
|-
| f5faf6 || Cool white
|style="background-color:#d6e44b"| || d6e44b || yellow
|}
|}



Version vom 17. März 2018, 09:30 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
9061 COMMISSIONING_MODE
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
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

Color names

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