local device = {} device.model = "KAJPLATS_WS_clear" device.vendor = "IKEA" device.description = "KAJPLATS light, white spectrum, clear" device.zigbeeModel = { "KAJPLATS E14 WS B38 CL 470lm", "KAJPLATS E27 WS G95 clear 806lm", "KAJPLATS E27 806lm 95mm smart WS", "KAJPLATS E27 WS G60 clear 470lm", "KAJPLATS E27 470lm smart WS", "KAJPLATS E12 WS B38 CL 450lm" } device.exposes = { { type = "light", features = { { type = "binary", name = "state", property = "state", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of this light", }, { type = "numeric", name = "brightness", property = "brightness", access = 7, min = 0, max = 254, description = "Brightness of this light", }, { type = "numeric", name = "color_temp", property = "color_temp", access = 7, unit = "mired", min = 153, max = 454, description = "Color temperature of this light", }, { type = "numeric", name = "color_temp_startup", property = "color_temp_startup", access = 7, unit = "mired", min = 153, max = 454, description = "Color temperature after cold power on of this light", }, { type = "composite", name = "level_config", property = "level_config", access = 7, description = "Configure genLevelCtrl", features = { { type = "numeric", name = "on_off_transition_time", property = "on_off_transition_time", access = 7, description = "Seconds taken to move to or from the target level when On or Off commands are received by an On/Off cluster", }, { type = "binary", name = "execute_if_off", property = "execute_if_off", access = 7, value_on = true, value_off = false, description = "this setting can affect the \"on_level\", \"current_level_startup\" or \"brightness\" setting", }, { type = "numeric", name = "current_level_startup", property = "current_level_startup", access = 7, min = 1, max = 254, description = "Defines the desired startup level for a device when it is supplied with power", }, }, }, }, }, { type = "enum", name = "effect", property = "effect", access = 2, description = "Triggers an effect on the light (e.g. make light blink for a few seconds)", values = { "blink", "breathe", "okay", "channel_change", "finish_effect", "stop_effect" }, }, { type = "enum", name = "power_on_behavior", property = "power_on_behavior", access = 7, description = "Controls the behavior when the device is powered on after power loss", category = "config", values = { "off", "on", "toggle", "previous" }, }, { type = "enum", name = "identify", property = "identify", access = 2, description = "Initiate device identification", category = "config", values = { "identify" }, }, } device.fromZigbee = { "on_off", "brightness", "color_temp", "color_hs", "color_xy" } device.configure = { bind = { "genOnOff", "genLevelCtrl", "lightingColorCtrl" }, reporting = { { cluster = "genOnOff", attribute = "onOff", min = 0, max = 3600, change = 0, }, { cluster = "genLevelCtrl", attribute = "currentLevel", min = 1, max = 3600, change = 1, }, { cluster = "lightingColorCtrl", attribute = "colorTemperatureMireds", min = 1, max = 3600, change = 1, }, }, } return device