SmartThings Community

Osram Lightify and changing color temp question

(Richy) #5

If anyone cares all osram lightfy bulbs are on sale at lowes for 50% of until 3/7/16

(Ryan) #6

@johnconstantelo Thank you so much for this info! When you say manually turn off, do you mean with a light switch or lamp switch? Will it retain color temp using on/off functions via ST? ie will the color temp stay unchanged, if the bulbs are on a schedule? or set to turn on via a trigger?

(Scott G) #7

It will retain the color temp when using on/off via ST. It’s only if you physically cut power to the bulb that it will lose the color temp setting and default to 2700k the next time it gets power.

Note: The Osram hub only allows you to choose a new default instead of the 2700k. It does not retain the last color temp value when physically power cycling the bulb.

(Ryan) #8

Hmmm @johnconstantelo all set up and no option to change color temp. The right of the dimmer slider is blank. I had this paired with iris which I unpaired, then reset the bulb.

(Scott G) #9

Color temp is set by dragging the slider. As you drag, you’ll get a small overlay of the value for where the slider is currently. When you release it will send the command to the bulb. The tile to the right that has the color temp value will populate once the device has notified the hub of its color temp, so it may initially be blank, but either moving the slider or pressing the refresh tile should populate it.

(Ryan) #10

Thanks @Sticks18 ! I woke up this morning and still dont see it…Just the dimmer slide :\ …Just to make sure, I dont need the Lightify hub, correct?

(Scott G) #11

Can you take a screenshot of what your app looks like for this device (similar to the one John posted)? Maybe it was assigned the device handler for a generic dimmable bulb and not a color temp tunable one.

(Ryan) #12

(Scott G) #13

Strange. You might need to change the device handler. To do this you will need to login to the IDE. Go to the My Devices tab -> click on your Osram bulb -> click Edit at the bottom -> use the Type dropdown to select Zigbee White Color Temperature Bulb -> click Update at the bottom. This should update the device handler being used by this bulb, so you can adjust the color temp.

If you haven’t used the IDE before, it’s very useful for managing your ST setup. You can sign up/login using the links at the top-right of the website below:

(Tony) #14

Hi John,
I apologies in advance if my question is simple, I am new to ST (just a couple of week old !)…

I am considering buying a few Lightify Bulbs to cover a large open space room (devided in 3 zones)…
Is it possible to control (in the same way as your screen shot) a group of bulbs all at once, ie change the Temp and Dim for all bulbs of a same group?
I will control the On/Off with the ST (via a Z-Wave switch) so no issues with the loss of temperature…
How do I create and control a light scene for a group of Lightify bulbs in ST?

Many thanks for pointing me in the right direction…

(Scott G) #15

Welcome Tony! There is no stock solution for bulb grouping, but there are several community created options available. You will have to login in to the IDE and copy/paste code, but it’s real easy. Here’s a thread on using custom code in ST:

Usually the best way to controls groups is to create a virtual device, then use a SmartApp to replicate the changes to the virtual device out to the intended group bulbs. Here’s an option I built:

There is also this option, which I like:


Hi @Happytoon, and welcome!

I couldn’t have said it any better than @Sticks18!

(Suryatej Potula) #17


Even I have the same issue. I cant change the color of my Osram lights from smasung smarthings. Did you fix it? This is frustrating for me.

(Norm) #18

I also have a number of Osram Lightify Bulbs. I was able to change the color temp using either the standard Zigbee smart light bulb device type and had good success with this custom written device type ( ).

But now, for some unexplained reason, I can only dim the lights. The sliders on both those device types has no effect on the color temp.


(Alec McLure) #19

I’ve noticed same thing w/ color temp both for Osram RGBW (using Zigbee RGBW Device Handler) and for Hue Color A19s in white mode. Looks like the slider is not using the right ranges (2700 or so to 6500) - but only 1 to 100 - which are not valid values for color temps. Actually, it looks like the whole ability to customize the range on tiles is broken. I put in a support request. Maybe knowing that it’s also breaking Hues will help escalate it.

I was able to hack something by copying other code for the tunable whites (which basically takes the 0 to 100 value and converts it to the 2700 up range) - to work with my Osram RGBW - but it’s hugely awkward. For now I’m using the Hue app for color temp on my my couple of Hue RGBWs.


I am using this device type OSRAM LIGHTIFY LED Tunable White 60W. that seems to be working fine for me still atleast it was few hours ago.

Osram Tunable White 60 A19 bulb

Osram bulbs have a firmware issue causing it to forget its dimming level when turned off (via commands). Handling
that issue by using state variables


//DEPRECATED - Using the generic DTH for this device. Users need to be moved before deleting this DTH

metadata {
definition (name: “OSRAM LIGHTIFY LED Tunable White 60W”, namespace: “smartthings”, author: “SmartThings”) {

    capability "Color Temperature"
    capability "Actuator"
    capability "Switch"
    capability "Switch Level"
    capability "Configuration"
    capability "Refresh"
    capability "Sensor"

    attribute "colorName", "string"

    // indicates that device keeps track of heartbeat (in state.heartbeat)
    attribute "heartbeat", "string"


// simulator metadata
simulator {
    // status messages
    status "on": "on/off: 1"
    status "off": "on/off: 0"

    // reply messages
    reply "zcl on-off on": "on/off: 1"
    reply "zcl on-off off": "on/off: 0"

// UI tile definitions
tiles {
    standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
        state "on", label: '${name}', action: "", icon: "st.switches.light.on", backgroundColor: "#79b821"
        state "off", label: '${name}', action: "switch.on", icon: "", backgroundColor: "#ffffff"
    standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
        state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"

    controlTile("colorTempSliderControl", "device.colorTemperature", "slider", height: 1, width: 2, inactiveLabel: false, range:"(2700..6500)") {
        state "colorTemperature", action:"color temperature.setColorTemperature"
    valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat") {
        state "colorTemperature", label: '${currentValue} K'
    valueTile("colorName", "device.colorName", inactiveLabel: false, decoration: "flat") {
        state "colorName", label: '${currentValue}'

    controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") {
        state "level", action:"switch level.setLevel"
    valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") {
        state "level", label: 'Level ${currentValue}%'

    details(["switch", "refresh", "colorName", "levelSliderControl", "level", "colorTempSliderControl", "colorTemp"])


// Parse incoming device messages to generate events
def parse(String description) {
//log.trace description

// save heartbeat (i.e. last time we got a message from device)
state.heartbeat = Calendar.getInstance().getTimeInMillis()

if (description?.startsWith("catchall:")) {
    if(description?.endsWith("0100") ||description?.endsWith("1001") || description?.matches("on/off\\s*:\\s*1"))
        def result = createEvent(name: "switch", value: "on")
        log.debug "Parse returned ${result?.descriptionText}"
        return result
    else if(description?.endsWith("0000") || description?.endsWith("1000") || description?.matches("on/off\\s*:\\s*0"))
        def result = createEvent(name: "switch", value: "off")
        log.debug "Parse returned ${result?.descriptionText}"
        return result

else if (description?.startsWith("read attr -")) {
    def descMap = parseDescriptionAsMap(description)
    log.trace "descMap : $descMap"

    if (descMap.cluster == "0300") {
        log.debug descMap.value
        def tempInMired = convertHexToInt(descMap.value)
        def tempInKelvin = Math.round(1000000/tempInMired)
        log.trace "temp in kelvin: $tempInKelvin"
        sendEvent(name: "colorTemperature", value: tempInKelvin, displayed:false)
    else if(descMap.cluster == "0008"){
        def dimmerValue = Math.round(convertHexToInt(descMap.value) * 100 / 255)
        log.debug "dimmer value is $dimmerValue"
        sendEvent(name: "level", value: dimmerValue)
else {
    def name = description?.startsWith("on/off: ") ? "switch" : null
    def value = name == "switch" ? (description?.endsWith(" 1") ? "on" : "off") : null
    def result = createEvent(name: name, value: value)
    log.debug "Parse returned ${result?.descriptionText}"
    return result


def on() {
log.debug "on()"
sendEvent(name: “switch”, value: “on”)

def off() {
log.debug "off()"
sendEvent(name: “switch”, value: “off”)
“st cmd 0x${device.deviceNetworkId} ${endpointId} 6 0 {}”

def refresh() {
sendEvent(name: “heartbeat”, value: “alive”, displayed:false)
“st rattr 0x${device.deviceNetworkId} ${endpointId} 6 0”, “delay 500”,
“st rattr 0x${device.deviceNetworkId} ${endpointId} 8 0”, “delay 500”,
“st rattr 0x${device.deviceNetworkId} ${endpointId} 0x0300 7”


def configure() {
state.levelValue = 100
log.debug "Configuring Reporting and Bindings."
def configCmds = [
“zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 0x0300 {${device.zigbeeId}} {}”, “delay 500”
return onOffConfig() + levelConfig() + configCmds + refresh() // send refresh cmds as part of config

def onOffConfig() {
“zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 6 {${device.zigbeeId}} {}”, “delay 200”,
“zcl global send-me-a-report 6 0 0x10 0 300 {01}”,
“send 0x${device.deviceNetworkId} 1 ${endpointId}”, “delay 1500”

//level config for devices with min reporting interval as 5 seconds and reporting interval if no activity as 1hour (3600s)
//min level change is 01
def levelConfig() {
“zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 8 {${device.zigbeeId}} {}”, “delay 200”,
“zcl global send-me-a-report 8 0 0x20 5 3600 {01}”,
“send 0x${device.deviceNetworkId} 1 ${endpointId}”, “delay 1500”

def setColorTemperature(value) {
value = (value*38) + 2700 //Calculation of mapping 0-100 to 2700-6500

def tempInMired = Math.round(1000000/value)
def finalHex = swapEndianHex(hex(tempInMired, 4))
def genericName = getGenericName(value)
log.debug "generic name is : $genericName"

def cmds = []
sendEvent(name: "colorTemperature", value: value, displayed:false)
sendEvent(name: "colorName", value: genericName)

cmds << "st cmd 0x${device.deviceNetworkId} ${endpointId} 0x0300 0x0a {${finalHex} 2000}"



def parseDescriptionAsMap(description) {
(description - “read attr - “).split(”,”).inject([:]) { map, param ->
def nameAndValue = param.split(":")
map += [(nameAndValue[0].trim()):nameAndValue[1].trim()]

def setLevel(value) {
state.levelValue = (value==null) ? 100 : value
log.trace "setLevel($value)"
def cmds = []

if (value == 0) {
    sendEvent(name: "switch", value: "off")
    cmds << "st cmd 0x${device.deviceNetworkId} ${endpointId} 6 0 {}"
else if (device.latestValue("switch") == "off") {
    sendEvent(name: "switch", value: "on")

sendEvent(name: "level", value: state.levelValue)
def level = hex(state.levelValue * 254 / 100)
cmds << "st cmd 0x${device.deviceNetworkId} ${endpointId} 8 4 {${level} 0000}"

//log.debug cmds


//Naming based on the wiki article here:
private getGenericName(value){
def genericName = "White"
if(value < 3300){
genericName = “Soft White”
} else if(value < 4150){
genericName = “Moonlight”
} else if(value < 5000){
genericName = “Cool White”
} else if(value <= 6500){
genericName = “Daylight”



private getEndpointId() {
new BigInteger(device.endpointId, 16).toString()

private hex(value, width=2) {
def s = new BigInteger(Math.round(value).toString()).toString(16)
while (s.size() < width) {
s = “0” + s

private String swapEndianHex(String hex) {

private Integer convertHexToInt(hex) {

//Need to reverse array of size 2
private byte[] reverseArray(byte[] array) {
byte tmp;
tmp = array[1];
array[1] = array[0];
array[0] = tmp;
return array

(Raghav Kashi) #21

I am seeing $24.99 for a BR30… is there a better price than that?


some Lowe’s stores have them for 75% off.

I bought 5 today for $7.49/ea

what i am most interested in is, how can i use ST to control the color temp and dim level for all 5 bulbs at once? Right now, i have to go into each bulb individually under the ‘Things’ menu to access and tune each bulb.


(Raghav Kashi) #23

I was told to create a virtual switch in the IDE and have that trigger an automation created in the ST app that will change the temperature on these bulbs.

(Eric Pendergrass) #24

Using WebCoRE for automation on my Osram lightify gardenspots has been the fix for getting the correct color. Smartthings uses the bulbs with the Philips HUE color ranges and that’s why they are all jacked. Some way of mapping the colors or a special device type handler might fix, but haven’t tried that.