Osram lightify surface (DTH in post 11)

dth_lighting

(Manos) #1

Hi guys,

Has anyone made this Osram lightify Surface “bulb” work?

http://www.osram.com/osram_com/products/luminaires/indoor-luminaires/wall-luminaires/lightify-surface-light-w/index.jsp

I have tried a few Zig bee device types but nothing works.

Any help/ideas would be appreciated.

Thank you


(Scott G) #2

What’s the raw description look like? You can find it on the device screen in the IDE.

It should just be a dimmable light, so I suspect it’s the endpoint that needs to be fixed.


(Manos) #3

Actually it does not show the raw description. All the other Osram bulbsI have, do have a raw description… I am clueless


(Manos) #4

I have written many times to support, sent the screenshot from ide, they are unable to help…I am so puzzled


(Scott G) #5

Very odd. We have to be able to get more info…

Can you try resetting and rejoining the device then looking in the hub logs in the IDE for the join events?

It would look something like in this post:

If you can’t find it, try applying this device type and pressing the refresh button while watching the live logs.

/**
 *  Copyright 2015 SmartThings
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */
    metadata {
// Automatically generated. Make future change here.
definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings") {
	capability "Switch Level"
	capability "Actuator"
	capability "Switch"
	capability "Configuration"
	capability "Sensor"
	capability "Refresh"

	fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0008,0B05", outClusters: "0019"
	}

	// 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:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff"
			state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn"
			state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff"
			state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn"
		}
		standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
			state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
		}
		controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 3, inactiveLabel: false) {
			state "level", action:"switch level.setLevel"
		}
valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") {
			state "level", label:'${currentValue} %', unit:"%", backgroundColor:"#ffffff"
		}
		main "switch"
		details(["switch", "refresh", "level", "levelSliderControl"])
	}
}

// Parse incoming device messages to generate events
def parse(String description) {
	log.info description
	if (description?.startsWith("catchall:")) {
		def msg = zigbee.parse(description)
		log.trace msg
		log.trace "data: $msg.data"
	}
	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
	}
}

// Commands to device
def on() {
	log.debug "on()"
	sendEvent(name: "switch", value: "on")
	"st cmd 0x${device.deviceNetworkId} ${endpointId} 6 1 {}"
}

def off() {
	log.debug "off()"
	sendEvent(name: "switch", value: "off")
	"st cmd 0x${device.deviceNetworkId} ${endpointId} 6 0 {}"
}
def setLevel(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")
cmds << "st cmd 0x${device.deviceNetworkId} ${endpointId} 6 1 {}"

	}

	sendEvent(name: "level", value: value)
def level = hexString(Math.round(value * 255/100))
cmds << "st cmd 0x${device.deviceNetworkId} ${endpointId} 8 4 {${level} 0000}"

	//log.debug cmds
	cmds
}

def refresh() {
	[
		"zdo active 0x${device.deviceNetworkId}"
	]
}

def configure() {

	/*log.debug "binding to switch and level control cluster"
	[
		"zdo bind 0x${device.deviceNetworkId} 1 1 6 {${device.zigbeeId}} {}", "delay 200",
		"zdo bind 0x${device.deviceNetworkId} 1 1 8 {${device.zigbeeId}} {}"
	]
*/

	//set transition time to 2 seconds. Not currently working.
	"st wattr 0x${device.deviceNetworkId} 1 8 0x10 0x21 {1400}"
}



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

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

(Manos) #6

Now I cannot make them pair anymore. I did manage to reset them but it seems like the hub does not find them anymore. None of the two I have


(Manos) #7

I managed to connect it.

This is what I get

d793da53-6ce3-4343-bd29-506c14f243a1 10:31:02 PM: error groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.math.BigInteger#.
Cannot resolve which method to invoke for [null, class java.lang.Integer] due to overlapping prototypes between:
[class [I, int]
[class [B, int]
[class java.lang.String, int] @ line 87
d793da53-6ce3-4343-bd29-506c14f243a1 10:31:02 PM: debug off()
d793da53-6ce3-4343-bd29-506c14f243a1 10:31:00 PM: error groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.math.BigInteger#.
Cannot resolve which method to invoke for [null, class java.lang.Integer] due to overlapping prototypes between:
[class [I, int]
[class [B, int]
[class java.lang.String, int] @ line 81
d793da53-6ce3-4343-bd29-506c14f243a1 10:31:00 PM: debug on()
d793da53-6ce3-4343-bd29-506c14f243a1 10:30:51 PM: error java.lang.NullPointerException: Cannot invoke method multiply() on null object @ line 104
d793da53-6ce3-4343-bd29-506c14f243a1 10:30:51 PM: trace setLevel(null)
d793da53-6ce3-4343-bd29-506c14f243a1 10:30:51 PM: error java.lang.NullPointerException: Cannot invoke method multiply() on null object @ line 104
d793da53-6ce3-4343-bd29-506c14f243a1 10:30:51 PM: trace setLevel(null)
d793da53-6ce3-4343-bd29-506c14f243a1 10:30:39 PM: error groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.math.BigInteger#.
Cannot resolve which method to invoke for [null, class java.lang.Integer] due to overlapping prototypes between:
[class [I, int]
[class [B, int]
[class java.lang.String, int] @ line 81
d793da53-6ce3-4343-bd29-506c14f243a1 10:30:39 PM: debug on()


(Scott G) #8

Is that pressing refresh()? What device type? That’s a lot of errors, but I’m not sure what you were doing to trigger them.

Can you check the hub events to see if it registered the join events? If you go to My Hubs and click List Events they should be in there around the time you paired it. You might have to click All at the top.


(Manos) #9

When I press refresh it does nothing. I checked the pairing event and I found this in the raw description

03 C05E 0100 02 09 1000 0000 0003 0004 0005 0006 0008 0B04 FC0F 01 0019


(Manos) #10

This is the device

http://www.osram.com/osram_com/products/luminaires/indoor-luminaires/wall-luminaires/lightify-surface-light-w/index.jsp


Getting Osram Lightify CLB40 bulbs working with ST hub
Osram lightify plug support
(Scott G) #11

There you go…hoping this works for you.

/**
 *  Copyright 2015 SmartThings
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */
metadata {
	definition (name: "Lightify Surface", namespace: "smartthings", author: "SmartThings") {
		capability "Switch Level"
		capability "Actuator"
		capability "Switch"
		capability "Configuration"
		capability "Sensor"
		capability "Refresh"

		fingerprint profileId: "C05E", inClusters: "0000,0003,0004,0005,0006,0008,0B04,FC0F", outClusters: "0019"
	}

	// 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:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff"
			state "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn"
			state "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"turningOff"
			state "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"turningOn"
		}
		standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
			state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
		}
		controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 3, inactiveLabel: false) {
			state "level", action:"switch level.setLevel"
		}
valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") {
			state "level", label:'${currentValue} %', unit:"%", backgroundColor:"#ffffff"
		}
		main "switch"
		details(["switch", "refresh", "level", "levelSliderControl"])
	}
}

// Parse incoming device messages to generate events
def parse(String description) {
	log.info description
	def msg = zigbee.parse(description)
if (description?.startsWith("catchall:")) {
	log.trace msg
	if(description?.endsWith("0100") ||description?.endsWith("1001"))
{
	def result = createEvent(name: "switch", value: "on")
log.debug "Parse returned ${result?.descriptionText}"
return result
}
    
if(description?.endsWith("0000") || description?.endsWith("1000"))
{
	def result = createEvent(name: "switch", value: "off")
    log.debug "Parse returned ${result?.descriptionText}"
    return result
}
	}
	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
	}

   if (description?.startsWith("read attr")) {
   	
Map descMap = (description - "read attr - ").split(",").inject([:]) { map, param ->
		def nameAndValue = param.split(":")
		map += [(nameAndValue[0].trim()):nameAndValue[1].trim()]
		}
		
log.debug "Desc Map: $descMap"
 
switch (descMap.cluster) {

	case "0008":
    
		log.debug description[-2..-1]
		def i = Math.round(convertHexToInt(descMap.value) / 256 * 100 )
		sendEvent( name: "level", value: i )
        sendEvent( name: "switch.setLevel", value: i) //added to help subscribers
        break
        
}            
        
}

}

// Commands to device
def on() {
	log.debug "on()"
	sendEvent(name: "switch", value: "on")
	"st cmd 0x${device.deviceNetworkId} 3 6 1 {}"
}

def off() {
	log.debug "off()"
	sendEvent(name: "switch", value: "off")
	"st cmd 0x${device.deviceNetworkId} 3 6 0 {}"
}
def setLevel(value) {
	log.trace "setLevel($value)"
	def cmds = []

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

	}

	sendEvent(name: "level", value: value)
def level = hexString(Math.round(value * 255/100))
cmds << "st cmd 0x${device.deviceNetworkId} 3 8 4 {${level} 1500}"

	//log.debug cmds
	cmds
}

def refresh() {
	[
		"st wattr 0x${device.deviceNetworkId} 3 6 0", "delay 200",
		"st wattr 0x${device.deviceNetworkId} 3 8 0"
	]
}

def configure() {

	log.debug "binding to switch and level control cluster"
	[
		
//Switch Reporting
"zcl global send-me-a-report 6 0 0x10 0 3600 {01}", "delay 500",
"send 0x${device.deviceNetworkId} 3 1", "delay 1000",

//Level Control Reporting
"zcl global send-me-a-report 8 0 0x20 5 3600 {0010}", "delay 200",
"send 0x${device.deviceNetworkId} 3 1", "delay 1500",

"zdo bind 0x${device.deviceNetworkId} 3 1 6 {${device.zigbeeId}} {}", "delay 1000",
		"zdo bind 0x${device.deviceNetworkId} 3 1 8 {${device.zigbeeId}} {}"
	]


	//set transition time to 2 seconds. Not currently working.
	// "st wattr 0x${device.deviceNetworkId} 1 8 0x10 0x21 {1400}"
}



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

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

OSRAM Lightify
Osram Lightify CLA 60 W Clear
Help with SmartThings and Lightify bulb
OSRAM Lightify surface light?
(Manos) #12

I am getting this error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script1450475845336103717532.groovy: 108: unexpected char: '' @ line 108, column 1.}`
^

1 error


(Scott G) #13

Looks like copying the code into the forum screwed up one of the closing brackets. On line 108 does the } have apostrophes around it? Just delete the apostrophes.


(Manos) #14

It works! Thank you so much!!

I am getting this error though.I dont know if it is important.

c497169b-188a-4b0b-8aaf-be71f80d4b2f 11:21:28 PM: debug off()
c497169b-188a-4b0b-8aaf-be71f80d4b2f 11:21:01 PM: error java.lang.NullPointerException: Cannot invoke method multiply() on null object @ line 139
c497169b-188a-4b0b-8aaf-be71f80d4b2f 11:21:01 PM: trace setLevel(null)
c497169b-188a-4b0b-8aaf-be71f80d4b2f 11:20:59 PM: error java.lang.NullPointerException: Cannot invoke method multiply() on null object @ line 139
c497169b-188a-4b0b-8aaf-be71f80d4b2f 11:20:59 PM: trace setLevel(null)


(Scott G) #15

Good deal!

Does dimming work? If so I think you can ignore the error. Otherwise, I think it’s an ST issue not passing a value from the level slider. I’ll try to take a look later if you can’t dim.


(Manos) #16

Everything works like a charm :slight_smile:


(Stanko Plestenjak) #17

Hi Scott,

with yours DTH I run 3 of my Lightify Surface lights. It work in basics. On/off and dimming.
I have 2 additional wishes:

  1. I really want to have a transitional effect with on/off function (like Fibaro dimmer have it)
  2. It think that my lights are too much bright on 1% dimm. From approx 60-75% to 100% is practically no difference in light output.

I buy you a beer if you are willing to help with this.

Regards, Stane

ps - sorry for my english