First post here. I have not coded in 20 years. I have no idea how, but I copied some code example from SmartThings, tweaked it a little. And somehow got my Osram Lightify Switch to work!? I’m very happily surprised. It is no longer just a “thing” and I can turn it on / off. ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/google/slight_smile.png?v=5)
I’m sure the code it totally bonkers for the device - but it seems to work fine.
Just as a side note: From my experience Zigbee works dramatically better than Zwave. I used Zwave 7 years ago and it just did not work well. With ST my ZWave devices dont really work well either but all the Zigbee ones do (yes, I’ve done endless network repairs to no avail). So I’m very excited to have the Osram switch, it is Zigbee and less than half the price of the other Zwave devices on Amazon
/**
* Copyright 2015 SmartThings
* Adapted by Michael Seifert for the Osram Switch (NOT the dimmer).
*
* 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: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings") {
definition (name: "ZigBee Switch", namespace: "smartthings", author: "Seifert") {
capability "Actuator"
capability "Configuration"
capability "Refresh"
capability "Switch"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B04, FC0F", outClusters: "0019", manufacturer: "OSRAM", model: "LIGHTIFY SWITCH ON/OFF", deviceJoinName: "OSRAM LIGHTIFY SWITCH"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, FF00", outClusters: "0019", manufacturer: "MRVL", model: "MZ100", deviceJoinName: "Wemo Bulb"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05", outClusters: "0019", manufacturer: "OSRAM SYLVANIA", model: "iQBR30", deviceJoinName: "Sylvania Ultra iQ"
}
tiles(scale: 2) {
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
}
}
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}
main "switch"
details(["switch", "refresh"])
}
}
// Parse incoming device messages to generate events
def parse(String description) {
log.debug "description is $description"
def event = zigbee.getEvent(description)
if (event) {
sendEvent(event)
}
else {
log.warn "DID NOT PARSE MESSAGE for description : $description"
log.debug zigbee.parseDescriptionAsMap(description)
}
}
def off() {
zigbee.off()
}
def on() {
zigbee.on()
}
def refresh() {
return zigbee.readAttribute(0x0006, 0x0000) +
zigbee.readAttribute(0x0008, 0x0000) +
zigbee.configureReporting(0x0006, 0x0000, 0x10, 0, 600, null) +
zigbee.configureReporting(0x0008, 0x0000, 0x20, 1, 3600, 0x01)
}
def configure() {
log.debug "Configuring Reporting and Bindings."
return zigbee.configureReporting(0x0006, 0x0000, 0x10, 0, 600, null) +
zigbee.configureReporting(0x0008, 0x0000, 0x20, 1, 3600, 0x01) +
zigbee.readAttribute(0x0006, 0x0000) +
zigbee.readAttribute(0x0008, 0x0000)
}