[OBSOLETE] IKEA Tradfri Button -- help needed (DTH in post 36)

I believe we need to send a command to it to make it believe a bulb is connected to it or complete the join

1 Like

This might help someone

http://www.zigbee.org/zigbee-products-2/#zigbeecertifiedproducts/?view_30_search=IKEA&view_30_page=1

I just bought a 5 button remote and was able to pair it, and used your DH code. It reads the battery level, but that’s about it. Looking forward to updates from all of you people who are much smarter than I!

I’m just curious if anyone has gotten any further with this? These little remotes look perfect for a number of uses, and it would be awesome to be able to read the button presses like any other remote.

I can’t find where I read it but I read about a week ago a guy who has it working.
I remember him saying the only way he could get it to work is by adding it as I thing but then leaving it like that and said as soon as he adds it as a device with a handler it wouldn’t work but would if left as a thing.
Sorry can’t confirm it though just remember reading it.

Hi there, almost the same for me :

  • I managed to pair the remote (5 buttons)
  • ST app only gives the battery level
  • On/Off button works
  • Dimmer buttons (with the :sun_with_face: icons) work
  • but temperature buttons (with > and < signs) won’t work

@RichMercer wold you be willing to help finishing your DH ?
Thanks a lot

Hi people,
a lot of us have buyed Tradfri Ikea kit (RGB bulb & Remote) for 29.90€: it is VERY easy to pair (and use) ikea bulbs with ST but at the moment there is no Device Handler for remote.
If you have buyed 5 ikea Tradfri RGB bulbs … you have 5 not working remotes :frowning:
These links could help to develop a working DH for remote:


Good luck!

1 Like

Who needs a remote sent to them to get this DH working? Willing to part with one of mine for the cause!

The problem is that the device connects directly to the lights, and considers the connection to the SmartThings hub as a secondary controller that it is aware of, but that it doesn’t talk to. There’s not a lot you can do about the architecture of the device - even when it’s connected via the Tradfri hub, it doesn’t control anything via the hub - it just talks directly to the lights.

The only question I’m left with is why the puck can’t control the temperature of the lights when you feel like it aught to be able to?

1 Like

hi all , ok this is my first post into the world of smartthings, I have been looking at a lot of the trends regarding connecting smart devices together. I have a lot of the Ikea bulbs, 5 remotes and a motion sensor, as well as the smartthings starter kit, the reason for this post is all to do with the ikea remote, the key statment smartthings makes things easier, so what is the purpose of the remote, to control a bulb or a series of bulbs, if you have your house fitted with Ikea bulbs this is great, this is what you need to do (or what i have done). I have 3 hubs, Amazon Echo plus (voice activation), Ikea gateway (only purpose is to update your ikea bulbs useless for anything else) and the brains Samsung SmartThings Hub. You can connect the remote to the ST Hub as a thing as there isn’t a viable DH yet it is pretty useless, however the question is why do you need to connect the remote to ST hub, its a remote, it turns things on and off, brighten and dims, why does your ST hub need to see it, answer it doesnt unless you want to attach other brands of Zigbee bulbs to it. So this is how it works, connect all your bulbs from Ikea to the ST hub, then attach them to the Echo plus, no you have control. Reset your remote 4 press on the sync button. then simple sync it to each bulb you want to control. This doesn’t reset the bulbs connection with the ST Hub, so now you have 3 methods of controlling your smart lighting, voice from your echo devices, from your phone, tablet etc and remote.

Good news for those of you who have a Hue bridge-- as long as the remotes have the most current firmware, they now meet the ZLL standard and can be added to the hue bridge! :sunglasses: :level_slider::bulb: This is new as of early November 2017. The following video shows you exactly how to do this.

This should also mean that if you start from scratch and now try to write a device type handler for a remote that has the updated firmware, everything should go much more smoothly as it now issues standard command responses. But again, you will have to first update the remote’s firmware to the most current version, which you can only do with the IKEA Gateway.

The reason you were having so many problems before is that these devices were not using the ZLL standard, they had some proprietary stuff which was throwing everything off. That was corrected in order to get them to work with the hue bridge, but it benefits any third party integration. :sunglasses:

That’s nice, but can it be used properly with smartthings?

Not at present, as I mentioned someone would have to write a device handler for it. But at least that process should be simpler now that they have been modified to meet the standard.

However, if you just associate the Tradfri button to the Phillips hue bridge and use the official SmartThings/Hue integration, you would be able to use the Tradfri Button as a parallel means of control so that it could control lights connected to the hue bridge and SmartThings could control the same lights. That’s the same way that some people use the Hue dimmer switch. It gives you a physical control button for the lights, which is sometimes all that people are looking for. :sunglasses:

Hi Gregoiredore, you’ve said that “On/Off button works
Dimmer buttons (with the :sun_with_face: icons) work”. Does that mean that you’ve been able to get them work with ST?

What I have is battery level, and buttons still do not send any events to ST. I have the latest update for IKEA from December with Zigbee support.

Anybody has any ideas?

HI ALL -
I am FAR from an expert and it took me a while to pick through everyone’s experiences and what I am about to write is DUE TO EVERYONE WHO HAS WORKED SO HARD to get this to work (THANK YOU!!) Special thanks to Edvald Eysteinsson and Jason Laursen who work the 2 device handlers.

I was able to get the Tradfri bulbs AND the Tradfri 5-button remote to work GREAT with Smartthings AND my ECHO Spot and Dot as well as ActionTiles. I found that it was as much the order or the process as it was the technology. I repeated the process many times to ensure it work. Caveat is that believe that this process may work with the Tradfri rotating dimmer but I didn’t feel comfortable saying it would work for sure.
Here’s my process:

  1. LOGIN to your Smartthings account and add the 2 Device Handlers you need - 1 is for the Tradfri Bulbs and 1 is for the Tradfri 5-button remote (I pasted it below because I am not sure I can find it again lol)
  2. RESET your bulb (turn it on 6 times quickly, wait for the flash/blink)
  3. RESET your remote (push the config button 4 times fast and look for the red flashing light on front)
    NOW YOU ARE READY
  4. ADD YOUR BULB(S) TO SMARTTHINGS - in the Smartthings app 1st ADD A THING and then TURN YOUR BULB ON. hold it close to your hub and wait for it to be recognized. Save it.
  5. GO TO SMARTHINGS ACCOUNT and VERIFY it was picked up by the bulb device handler. Test it. (on/off/dim/bright) LEAVE IT ON (not sure this isnt more superstition than required) but move it a bit away from the Smartthings hub.
  6. CONNECT YOUR REMOTE to Smartthings. Press the config button and hold it close to the hub. For me it seemed to take longer than it did for the bulb. Most likely it will be found but not recognized so it will be a “Thing”. This is fine.
  7. GO TO SMARTTHINGS and look at “Your Devices”. Find the “Thing” and scroll to the bottom and EDIT. Under “TYPE” change that to the IKEA TRADFRI DIMMER Device Handler you already added (pasted below). For me it was 2nd from the last.
  8. CONNECT THE REMOTE TO THE BULB(S) by holding the remote config button within 2" of the bulb until the bulb gets dim and bright a couple of times and then flashes quickly and stops. TEST the APP and Test the remote.

If you have an ECHO - do this BEFORE ou connect the remote (Step 6) ADD the devices to the Alexa App (Smarthome/Add Device I think).

If you use ACTIONTILES dont forget to login to your account and authorize the devices (location, authorize, select from the drop down menu, select your bulb(s) and remote(s).

I used this process and it works fine for the on/off bright/dim. I dont have color bulbs so I can’t say for sure from that.

AGAIN THANKS TO EVERYONE who experimented and helped me get this. I hope it helps you all too!

here is the DIMMER HANDLER (thanks Jonas Laursen)
-----copy starting the next line
/**

  • IKEA Trådfri Dimmer
  • Copyright 2017 Jonas Laursen
  • 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: “IKEA Trådfri Dimmer”, namespace: “dk.decko”, author: “Jonas Laursen”) {
capability "Configuration"
capability “Switch”

    fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,0B05,1000", outClusters: "0003,0004,0006,0008,0019,1000", manufacturer: "IKEA of Sweden", model: "TRADFRI wireless dimmer"
}


simulator {
	// TODO: define status and reply messages here
}

tiles {
	standardTile("switch", "device.switch") {
    	state "off", label: "Off", icon: "st.switches.switch.off"
        state "on", label: "On", icon: "st.switches.switch.on"
    }
}

main("switch")

}

// parse events into attributes
def parse(String description) {
//log.debug "Parsing ‘${description}’"
def map = zigbee.parseDescriptionAsMap(description)
if (map.command == “04”) {
if (map.data[0] == “00”) {
sendEvent(name: “switch”, value: “off”)
} else if (map.data[0] == “FF”) {
sendEvent(name: “switch”, value: “on”)
}
}
}

def configure() {
//log.debug “Configure called”
[“zdo bind 0x${device.deviceNetworkId} 0x01 0x01 8 {${device.zigbeeId}} {}”]
}
----- copy to the line above. 55 lines I believe

Here is the TRADFRI BULB Device Handler THANK YOU Edvald Eysteinsson!!
-----copy starting the next line
/**

  • Copyright 2017 Edvald Eysteinsson

  • 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.

  • IKEA Trådfri

  • This handler is written so that the bulbs behave a bit more like traditional halogen bulbs and the ones i modeled it

  • after is https://www.osram.com/osram_com/products/lamps/halogen-lamps/halopar/halopar-16-gu10gz10-star/index.jsp

  • they have a color rendering index of 100 at full brightness and that is equivalent to 3200 kelvin. The level at 1%

  • will use 2200 kelvin and each percent will increse the temperature by 10 ending up at 3190 at 100%

  • Author: Edvald Eysteinsson

  • Date: 2017-03-18
    */
    metadata {
    definition (name: “IKEA-Tradfri”, namespace: “edvaldeysteinsson”, author: “Edvald Eysteinsson”) {
    capability "Actuator"
    capability "Color Temperature"
    capability "Configuration"
    capability "Health Check"
    capability "Refresh"
    capability "Switch"
    capability "Switch Level"
    capability “Light”

    attribute “colorName”, “string”

    command "setColorName"
    command "setColorRelax"
    command "setColorEveryday"
    command "setColorFocus"
    command “nextColor”

    // Trådfri bulbs
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E27 WS�opal 980lm”, deviceJoinName: "TRÅDFRI bulb E27 WS opal 980lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E27 WS opal 980lm”, deviceJoinName: "TRÅDFRI bulb E27 WS opal 980lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E27 WS clear 950lm”, deviceJoinName: "TRÅDFRI bulb E27 WS clear 950lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E26 WS�opal 980lm”, deviceJoinName: "TRÅDFRI bulb E26 WS opal 980lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E26 WS opal 980lm”, deviceJoinName: "TRÅDFRI bulb E26 WS opal 980lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E26 WS clear 950lm”, deviceJoinName: "TRÅDFRI bulb E26 WS clear 950lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E14 WS opal 400lm”, deviceJoinName: "TRÅDFRI bulb E14 WS opal 400lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb E12 WS opal 400lm”, deviceJoinName: "TRÅDFRI bulb E12 WS opal 400lm"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “TRADFRI bulb GU10 WS 400lm”, deviceJoinName: “TRÅDFRI bulb GU10 WS 400lm”

    // FLOALT panels
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “FLOALT panel WS 30x30”, deviceJoinName: "FLOALT panel WS 30x30"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “FLOALT panel WS 30x90”, deviceJoinName: "FLOALT panel WS 30x90"
    fingerprint profileId: “0104”, inClusters: “0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000”, outClusters: “0005, 0019, 0020, 1000”, manufacturer: “IKEA of Sweden”, model: “FLOALT panel WS 60x60”, deviceJoinName: “FLOALT panel WS 60x60”
    }

preferences {
input name: “linkLevelAndColor”, type: “bool”, title: “Link level change with color temperature?”, defaultValue: true, displayDuringSetup: true, required: false
input name: “delay”, type: “number”, title: “Delay between level and color temperature change in milliseconds”, defaultValue: 0, displayDuringSetup: true, required: false
input name: “colorTempMin”, type: “number”, title: “Color temperature at lowest level(1%)”, defaultValue: 2200, range: “2200…4000”, displayDuringSetup: true, required: false
input name: “colorTempMax”, type: “number”, title: “Color temperature at highest level(100%)”, defaultValue: 3200, range: “2200…4000”, displayDuringSetup: true, required: false
input name: “colorNameAsKelvin”, type: “bool”, title: “Display color temperature as kelvin”, defaultValue: false, displayDuringSetup: true, required: false
}

// UI tile definitions
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:"#00a0dc", 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:”#00a0dc", nextState:“turningOff"
attributeState “turningOff”, label:’${name}’, action:“switch.on”, icon:“st.switches.light.off”, backgroundColor:”#ffffff", nextState:“turningOn”
}

  tileAttribute ("device.level", key: "SLIDER_CONTROL") {
    attributeState "level", action:"setLevel"
    }
}

controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 1, inactiveLabel: false, range:"(2200..4000)") {
  state "colorTemperature", action:"setColorTemperature"
}

valueTile("colorName", "device.colorName", inactiveLabel: false, decoration: "flat", width: 4, height: 1) {
  state "colorName", label: '${currentValue}'
}

standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 1) {
  state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}

standardTile("nextColor", "device.default", inactiveLabel: false, decoration: "flat", width: 2, height: 1) {
  state "default", label:"", action:"nextColor", icon:"https://github.com/edvaldeysteinsson/SmartThingsResources/raw/master/images/next_color.png"
}

standardTile("colorRelax", "device.default", inactiveLabel: false, width: 2, height: 2) {
  state "default", label:"", action:"setColorRelax", backgroundColor:"#ECCF73"
}

standardTile("colorEveryday", "device.default", inactiveLabel: false, width: 2, height: 2) {
  state "default", label:"", action:"setColorEveryday", backgroundColor:"#FBECCB"
}

standardTile("colorFocus", "device.default", inactiveLabel: false, width: 2, height: 2) {
  state "default", label:"", action:"setColorFocus", backgroundColor:"#F5FBFB"
}

main(["switch"])
details(["switch", "colorTempSliderControl", "colorName", "refresh", "nextColor", "colorRelax", "colorEveryday", "colorFocus"])

}
}

// parse events into attributes
def parse_new(description) {
def results = []

def map = description
if (description instanceof String) {
map = stringToMap(description)
}

if (map?.name && map?.value) {
results << createEvent(name: “${map?.name}”, value: “${map?.value}”)
}

results
}

// Parse incoming device messages to generate events
def parse(String description) {
def event = zigbee.getEvent(description)

if (event) {
if (event.name != “level” || (event.name==“level” && event.value > 0)) {
if (event.name==“colorTemperature”) {
setColorName(event.value)
}
sendEvent(event)
}
} else {
def cluster = zigbee.parse(description)

if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) {
  if (cluster.data[0] == 0x00) {
    sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
  } else {
    log.warn "ON/OFF REPORTING CONFIG FAILED- error code:${cluster.data[0]}"
  }
} else {
  log.warn "DID NOT PARSE MESSAGE for description : $description"
  log.debug "${cluster}"
}

}
}

def off() {
zigbee.off()
}

def on() {
zigbee.on()
}

def setLevel(value) {
// In case the level is 0 we dont want to do anything with the color temperature
if(value == 0){
zigbee.setLevel(value)
} else {
if(linkLevelAndColor ?: false){
def colorTempMin = colorTempMin ?: 2200;
def colorTempMax = colorTempMax ?: 3200;
def stepSize = (colorTempMax - colorTempMin) / 99;
int colorTemperature = Math.ceil((colorTempMin - stepSize) + (stepSize*value));

  // this will set the color temperature based on the level, default color temperatures are
  // 2200(1%) to 3200(100%) but they can be set in preferences.
  // This is a bit more like how a traditional bulb behaves, it will turn warmer at lower levels.
  // There is nothing preventing a user from doing the opposite, 4000 at 1% and 2200 at 100% if
  // they feel like it.
  delayBetween([
    zigbee.setLevel(value),
    zigbee.setColorTemperature(colorTemperature)
  ], delay ?: 0)
} else {
  zigbee.setLevel(value)
}

}
}

def setColorRelax() {
setColorTemperature(2200)
}

def setColorEveryday() {
setColorTemperature(2700)
}

def setColorFocus() {
setColorTemperature(4000)
}

def setColorTemperature(value) {
// This is added here just in case something calls this with a value that is out of range for the bulbs
if(value > 4000){
value = 4000;
} else if(value < 2200){
value = 2200;
}

setColorName(value)
zigbee.setColorTemperature(value)
}

def setColorName(value){
state.colourTemperature = value

if(colorNameAsKelvin ?: false){
sendEvent(name: “colorName”, value: “${value} K” )
} else {
if (value != null) {
def genericName

  if (value < 2450) {
    genericName = "Relax" // 2200 is named Relax by IKEA so i use that for 2200-2449
  } else if (value < 2950) {
    genericName = "Everyday" // 2700 is named Everyday by IKEA so i use that for 2450-2949
  } else if (value <= 4000) {
    genericName = "Focus" // 4000 is named Focus by IKEA so i use that for 2950-4000
  }

  sendEvent(name: "colorName", value: genericName)
}

}
}

def nextColor() {
if(state.colourTemperature < 2450) {
setColorEveryday()
} else if (state.colourTemperature < 2950) {
setColorFocus()
} else {
setColorRelax()
}
}

/**

  • PING is used by Device-Watch in attempt to reach the Device
  • */
    def ping() {
    return zigbee.onOffRefresh()
    }

def refresh() {
zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.colorTemperatureRefresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig() + zigbee.colorTemperatureConfig()
}

def configure() {
// Device-Watch allows 2 check-in misses from device + ping (plus 1 min lag time)
// enrolls with default periodic reporting until newer 5 min interval is confirmed
sendEvent(name: “checkInterval”, value: 2 * 10 * 60 + 1 * 60, displayed: false, data: [protocol: “zigbee”, hubHardwareId: device.hub.hardwareID])

// OnOff minReportTime 0 seconds, maxReportTime 5 min. Reporting interval if no activity
refresh()
}

def installed() {
if ((device.currentState(“level”)?.value == null) || (device.currentState(“level”)?.value == 0)) {
sendEvent(name: “level”, value: 100)
}
}
----- Copy to the line above. 272 lines.

8 Likes

I am getting the following:
Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_7182a6ac_a3f0_4aa1_8ca0_61fe604d85de: 16: unexpected token: Trådfri @ line 16, column 25. definition (name: “IKEA Trådfri Dimmer”, namespace: “dkdecko”, author: “Jonas Laursen”) { ^ 1 error

I am too new to Smartthings to know what I have done wrong

I get the same error message as TheCivvie.

/**

IKEA Trådfri Dimmer
Copyright 2017 Jonas Laursen
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: "IKEA Trådfri Dimmer", namespace: "dk.decko", author: "Jonas Laursen") {
capability "Configuration"
capability "Switch"
fingerprint profileId: "0104", inClusters: "0000,0001,0003,0009,0B05,1000", outClusters: "0003,0004,0006,0008,0019,1000", manufacturer: "IKEA of Sweden", model: "TRADFRI wireless dimmer"
}


simulator {
	// TODO: define status and reply messages here
}

tiles {
	standardTile("switch", "device.switch") {
    	state "off", label: "Off", icon: "st.switches.switch.off"
        state "on", label: "On", icon: "st.switches.switch.on"
    }
}

main("switch")
}

// parse events into attributes
def parse(String description) {
//log.debug "Parsing ‘${description}’"
def map = zigbee.parseDescriptionAsMap(description)
if (map.command == "04") {
if (map.data[0] == "00") {
sendEvent(name: "switch", value: "off")
} else if (map.data[0] == "FF") {
sendEvent(name: "switch", value: "on")
}
}
}

def configure() {
//log.debug "Configure called"
["zdo bind 0x${device.deviceNetworkId} 0x01 0x01 8 {${device.zigbeeId}} {}"]
}
3 Likes

Thabks, that sorted it

Hi there,

I’ve added the DTH and it recognised the puck, and once or twice the devices status has changed from on to off, but I can’t seem to set up the Tradfri dimmer, it doesn’t appear to be available to webCore at all.

Have I missed something basic? This is a DTH to enable the Tradfri dimmer to control smart stuff via smartthings?

Many thanks.