TRÅDFRI Binding

This binding integrates the IKEA TRÅDFRI gateway and devices connected to it (such as dimmable LED bulbs).

Supported Things

Beside the gateway (thing type "gateway"), the binding currently supports colored bulbs, dimmable warm white bulbs as well as white spectrum bulbs. The binding also supports read-only data from remote controls and motion sensors (e.g. the battery status). The TRÅDFRI controller and sensor devices currently cannot be observed right away. We assume that they are communicating directly with the bulbs or lamps without routing their commands through the gateway. This makes it nearly impossible to trigger events for pressed buttons. We only can access some static data like the present status or battery level.

The thing type ids are defined according to the lighting devices defined for ZigBee LightLink (see page 24, table 2. These are:

Device typeZigBee Device IDThing type
Dimmable Light0x01000100
Colour Temperature Light0x02200220
Extended Colour Light0x02100210
Occupancy Sensor0x01070107
Non-Colour Controller0x08200820
Non-Colour Scene Controller0x08300830

The following matrix lists the capabilities (channels) for each of the supported lighting device types:

Thing typeBrightnessColorColor TemperatureBattery LevelBattery Low
0100X
0220XX
0210XX
0107XX
0820XX
0830XX

Thing Configuration

For first pairing - the gateway requires a host parameter for the hostname or IP address and a code, which is the security code that is printed on the bottom of the gateway. Optionally, a port can be configured, but any standard gateway uses the default port 5684.

The code is used during the initialization for retrieving unique identity and pre-shared key from the gateway (fw version 1.2.0042 onwards) and then it's discarded from the configuration. The newly created authentication data is stored in advanced parameters identity and preSharedKey. On each initialization if the code is present in the thing configuration - the identity and preSharedKey are recreated and the code is again discarded.

The devices require only a single (integer) parameter, which is their instance id. Unfortunately, this is not displayed anywhere in the IKEA app, but it seems that they are sequentially numbered starting with 65537 for the first device. If in doubt, use the auto-discovered things to find out the correct instance ids.

Channels

The dimmable bulbs support the brightness channel. The white spectrum bulbs additionally also support the color_temperature channel.

Full color bulbs support the color_temperature and color channels. Brightness can be changed with the color channel.

The remote control and the motion sensor supports the battery_level and battery_low channels for reading the battery status.

Refer to the matrix above.

Channel Type IDItem TypeDescription
brightnessDimmerThe brightness of the bulb in percent
color_temperatureDimmercolor temperature from 0% = cold to 100% = warm
colorColorfull color
battery_levelNumberbattery level (in %)
battery_lowSwitchbattery low warning (<=10% = ON, >10% = OFF)

Full Example

demo.things:

Bridge tradfri:gateway:mygateway [ host="192.168.0.177", code="EHPW5rIJKyXFgjH3" ] {
    0100 myDimmableBulb [ id=65537 ]    
    0220 myColorTempBulb [ id=65538 ]
    0210 myColorBulb [ id=65539 ]
    0830 myRemoteControl [ id=65545 ]
}

demo.items:

Dimmer Light1 { channel="tradfri:0100:mygateway:myDimmableBulb:brightness" }
Dimmer Light2_Brightness { channel="tradfri:0220:mygateway:myColorTempBulb:brightness" }
Dimmer Light2_ColorTemperature { channel="tradfri:0220:mygateway:myColorTempBulb:color_temperature" }
Color ColorLight { channel="tradfri:0210:mygateway:myColorBulb:color" }
Number RemoteControlBatteryLevel { channel="tradfri:0830:mygateway:myRemoteControl:battery_level" } 
Switch RemoteControlBatteryLow { channel="tradfri:0830:mygateway:myRemoteControl:battery_low" }

demo.sitemap:

sitemap demo label="Main Menu"
{
    Frame {
        Slider item=Light1 label="Light1 Brightness [%.1f %%]"
        Slider item=Light2_Brightness label="Light2 Brightness [%.1f %%]"
        Slider item=Light2_ColorTemperature label="Light2 Color Temperature [%.1f %%]"
        Colorpicker item=ColorLight label="Color"
        Text item=RemoteControlBatteryLevel label="Battery level [%d %%]"
        Switch item=RemoteControlBatteryLow label="Battery low warning"
    }
}