[OBSOLETE] Ikea Tradfri Wireless Dimmer Device Handler draft

The only useful thing I came up with so far was using it to control a group of lights with a Synchronised Dimming smartapp:

There may be other things people would want to control, I guess it would have to be something that would be enhanced with a physical control and that provides instant feedback (i.e. not a thermostat) not sure how to implement these yet but I can think of a few possibilities:

  1. Music volume
  2. Fan speed
  3. Position of something, maybe blinds.

One thing that was mentioned in a post above was using it to cycle through some lighting scenes. You could set a minimum turn time to avoid accidental switching and have it increment through scenes by turning.

Just some ideas

Kris.

Maybe the device should also be reported as a “multi-buttons device” where each state could be exposed as a “pressed button” like


  1. Fast backward
  2. Backward
  3. Forward
  4. Fast Forward

Also as an accelerator sensor


Carl thanks for the update. I’m just trying to bind my dimmer using your latest code but get the following error. I’m guessing this is the binding commands on lines 67-69 of your handler that is triggering the error but I’m not sure why.

41b0b4b9-f819-4df3-8a35-6a4f319e12bd  21:43:08: error org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'script_dth_002f64a7_39f3_46c4_8755_ade32e96b591_ver_0_2$_configure_closure2@7555c605' with class 'script_dth_002f64a7_39f3_46c4_8755_ade32e96b591_ver_0_2$_configure_closure2' to class 'physicalgraph.ChangeTrackingMap'
41b0b4b9-f819-4df3-8a35-6a4f319e12bd  21:43:08: debug Configiring Reporting and Bindings.

A couple of small updates


It is the “state = {}” that is throwing an error in the configure() method, works OK with this commented out.

I have created a new tile for the battery %, and can get it to display a fixed value I send manually in parse() but I can’t figure out how to actually get the battery info

I have tried configuring reporting as the ST docs and also added it to the refresh method:

return zigbee.readAttribute(0x0001, 0x0021) + zigbee.configureReporting(0x0001, 0x0021, 0x20, 30, 21600, 0x01)

What I don’t understand now is what this should do
 we trigger a readAttribute() but the result is not returned in a variable so I don’t know how to do anything with it, should it trigger a new event to be handled in parse()?
If it should then it currently doesn’t work


I have seen other DHs that query the voltage attribute rather than the % battery using 0x020 instead of 0x021 and converting to a %, when I get a bit of time I’ll try to get this working.

Considering I don’t really use the dimmer I’m spending far to long on trying to make it work (at least according to my wife) :grin:

Cheers that’s working for me now. Now I just need to configure some lights to dim with it :grinning:

For the “state”, I’ll fix it
 anyway it’s nothing important :-).

For the battery, it’s a nightmare in most zigbee handlers. I’ll use my zigbee sniffer to understand how it’s working, but I didn’t had time to check this :-).

I’ve tried using both your code @kristian.andrews and the updated code by @carl.debilly . The dimmer registers as a “thing”, I change the device type in the IDE but I get no events registering? I’ve tried factory resetting and repairing a few times but still nothing.

Any ideas what could be going wrong? I know others had this issue but your latest code fixed it for them.

Hey guys. Thank you all who managed to contribute to the current device handler. I took the plunge and bought four of these baddies. No offense to the people who worked on the synchronized dimming, but the latest Smart Lighting SmartApp update has made your code superfluous. The latest update has added a mirroring function. You basically set the bulbs in your room to follow the on/off state and dimming level of the Tradfri dimmer. I was very impressed by its responsiveness.

Here’s a thread where the function was discovered.

Hi,

Has anyone actually got this to work on firmware 11115720.

I have tried all the different device handlers mentioned and the dimmer pairs okay with Smartthings but doesn’t generate any events apart from a couple of times when it went from off to on but then stopped working immediately after.

I have tried this with two different dimmers so I know they are not faulty.

Am I supposed to modify the code for the DJ in some way?

I am totally stumped.

Thanks in advance,

Nick

Hello Kikura,

I just put together all the changes based on the updated handler from carl.debily and came up with this:

/**
*  TRÅDFRI Dimmer v0.4
*
*  Copyright 2017 Kristian Andrews (v0.1)
*  Modified 2018-01 by Carl de Billy (v0.2)
*   and published on Github:
*   https://github.com/carldebilly/SmartThings-Stuff/edit/master/devicetypes/andrews-k/tradfri-dimmer-v0-2.src/tradfri-dimmer-v0-2.groovy
*
*  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.
*
*  To do:
*  1) make the handler "useful" (able to control another _real_ device)
*  2) support battery reporting
*/
metadata {
    definition (name: "Tradfri Dimmer v0.4", namespace: "andrews.k", author: "Kristian Andrews") {
        capability "Sensor"
        capability "Configuration"
        capability "Switch"
        capability "Switch Level"

        fingerprint endpointId: "01", profileId: "0104", deviceId: "0810", deviceVersion: "02", inClusters: "0000, 0001, 0003, 0009, 0B05, 1000", outClusters: "0003, 0004, 0006, 0008, 0019, 1000"
    }


    simulator {
        // TODO: define status and reply messages here
    }
    
    // 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:"switch level.setLevel"
            }
        }

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

        main(["switch"])
        details(["switch", "refresh"])
    }
    
}

def configure() {
    log.debug "Configiring Reporting and Bindings."
    def configCmds = []
    
    //state = {}

    configCmds += "zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0001 {${device.zigbeeId}} {}" // battery
    configCmds += "zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0008 {${device.zigbeeId}} {}" // intensity changes
    configCmds += "delay 2000"

    return configCmds + refresh()
}


def refresh() {
    log.debug "refreshing..."
}

// parse events into attributes
def parse(String description) {
    def now = now()
    
    computeVelocity(now)
    
    if (description?.startsWith("catchall:")) {
        def descMap = zigbee.parseDescriptionAsMap(description)
        
        def cluster = descMap.clusterInt
        def command = descMap.commandInt
        def data = descMap.data
        
        if(cluster == 0x0008) {
            switch(command) {
            case 0x00:
                def level = Integer.parseInt(data[0], 16)
                def speed = Integer.parseInt(data[1]+data[2], 16)
                log.debug "cmd-$command: Go to level. Level=$level, speed=$speed."
                state.velocity = 0
                state.level = level
                break
            case 0x01:
                def direction = data[0] == "00" ? "up" : "down"
                def rate = Integer.parseInt(data[1], 16)
                if(rate == 0xFF) rate = 5
                log.debug "cmd-$command: Moving. Direction=$direction, rate=$rate."
                //state.velocity = direction == "up" ? rate : -1 * rate
                state.velocity = direction == "up" ? 15 : -15
                break
            case 0x04:
                def level = Integer.parseInt(data[0], 16)
                def speed = Integer.parseInt(data[1]+data[2], 16)
                log.debug "cmd-$command: Go to level with on/off. Level=$level, speed=$speed."
                state.velocity = 0
                state.level = level
                if(level == 0)
                    state.switch = 0
                else
                    state.switch = 1
                break
            case 0x05:
                def direction = data[0] == "00" ? "up" : "down"
                def rate = Integer.parseInt(data[1], 16)
                if(rate == 0xFF) rate = 5
                log.debug "cmd-$command: Moving with on/off. Direction=$direction, rate=$rate."
                //state.velocity = direction == "up" ? rate : -1 * rate
                state.velocity = direction == "up" ? 15 : -15
                break
            case 0x07:
                log.debug "cmd-$command: Stopped Moving."
                state.velocity = 0
                break
            }
        }
        else {
            log.debug "CATCH-ALL Map: $descMap"
        }
    }
    sendEvents()
}

def computeVelocity(now) {

    def velocity = state.velocity ?: 0

    if(!velocity) return // nothing to do
    
    def currentLevel = state.level ?: 0
    def currentTs = state.timestamp = state.timestamp ?: now
    def duration = (now - currentTs) / 1000000

    if(!duration) return // nothing to do
    
    def increment = (Integer)(duration * velocity);
    
    log.debug "now: $now, cur: $currentTs, dur: $duration, Inc: $increment, ts: $state.timestamp"
    
    state.level = currentLevel + increment

    if(state.level > 0xFF) {
        state.level = 0xFF
    }

    if(state.level < 0x00) {
        state.level = 0x00
    }
    
    log.debug "Level: $state.level"

    sendEvents()
}

def sendEvents() {
	Integer level = (state.level ?: 0) * 100 / 0xFF
    def sw = state.switch ? "on" : "off"
    sendEvent(name: "level", value: level)
    sendEvent(name: "switch", value: sw)
}

// handle commands
def on() {
    log.debug "Executing 'on'"
    state.switch = 1
    state.velocity = 0
    if(!state.level) {
        state.level = 0xFF
    }
    sendEvents()
}

def off() {
    log.debug "Executing 'off'"
    state.switch = 0
    state.velocity = 0
    sendEvents()
}

def setLevel(int lev) {
    log.debug "Executing 'setLevel' $lev"
    
    Integer newLevel = lev * 0xFF / 100
    state.level = newLevel
    state.velocity = 0
    sendEvents()
}

For me this does report events but I think there is a big in the detection of the turn timing as it jumps fully on or off whenever it is turned. I can’t really follow how it is working but I added some debug lines and you can see the turn start time never updates
 Anyway this should at least let you see something reported.

You can try my more clunky code if you like, this one has the critical device registration added so it should report events properly:

/**
 *  Tradfri Dimmer v0.2
 *
 *  Copyright 2017 Kristian Andrews
 *
 *  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.
 *
 *  In this handler the following actions are recognised
 *    turning clockwise slowly increased the level, the amount is determined by the time turning
 *    turning clockwise fast increased the level by 50
 *    turning anticlockwise slowly decreases the level, the amount is determined by the time turning
 *    turning anticlockwise fast decreases the level by 50
 *
 *  There are several reported actions that I can't decipher
 *    
 *  When the level reaches 0 the switch is turned off, any level above 0 the switch is on
 *  
 *  Can be used to control lights by the use of a SmartApp such as Synchronised Dimming
 *
 *  To do:
 *  1) Debug why the light flashes when I turn off, maybe I don't need to report events for the ones that are set or the commands should be reversed?
 *  e.g. when Off is set from the app GUI do I need to send an Off event as well?
 *  2) Update so that a fast turn clockwise/anticlockwise can turn the lights on and off but maintain the set level
 */
metadata {
	definition (name: "Tradfri Dimmer v0.2", namespace: "andrews.k", author: "Kristian Andrews") {
		capability "Sensor"
		capability "Switch"
		capability "Switch Level"
        capability "Configuration"

		//fingerprint endpointId: "01", profileId: "0104", deviceId: "0810", deviceVersion: "02", inClusters: "0000, 0001, 0003, 0009, 0B05, 1000", outClusters: "0003, 0004, 0006, 0008, 0019, 1000"
	}


	simulator {
		// TODO: define status and reply messages here
	}
    
    // 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:"switch level.setLevel"
            }
        }

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

        main(["switch"])
        details(["switch", "refresh"])
    }
    
}

// parse events into attributes
def parse(String description) {
	log.debug "Parsing '${description}'"
	// TODO: handle 'switch' attribute
	// TODO: handle 'level' attribute
	def name = null
    def value = null
    def name2 = null
    def value2 = null
    
    // Check if the stored variables are initialised
    if (state.level == null) {
    	state.level = 100
    }
    
    if (state.OnOff == null) {
    	state.OnOff = 1
    }
    
    if (state.start == null) {
    	state.start = now()
    }
    
    if (state.clockwise == null) {
    	state.clockwise = 0
    }
    
    if (description?.startsWith("catchall:")) {
    	//def descMap = zigbee.parseDescriptionAsMap(description)
        
        log.debug "Catch all: $description"
        log.debug zigbee.parseDescriptionAsMap(description)
        
        // Responds to Zigbee events sent by the dimmer
        // Probably not the most elegant solution
        if (description.endsWith("00 0000 05 00 00C3")) {
        
        	// Start Turn clockwise
            log.debug "cw"
            
            // Store when the turning started and the direction
            state.start = now()
            state.clockwise = 1
        } else if (description.endsWith("00 0000 01 00 01C3")) {
        	// Start turn anticlockwise
            log.debug "acw"
            
            // Store when the turning started and the direction
            state.start = now()
            state.clockwise = -1
        } else if (description.endsWith("00 0000 07 00 ")) {
        	// Stop turning
            log.debug "Stop"
            
            // Calculate duration of turn
            def turnTime = now() - state.start
            //log.debug "Turn ms: $turnTime"
            
            // If the turn is too long ignore it, it probably came from a missed event
            if (turnTime > 2500) {
            	turnTime = 0
            }
            
            // How much change to the level
            // 2000 ms = full up or down
            int change = turnTime / 20
            
            //log.debug change
            
            if (state.clockwise == 1) {
            	// If clockwise, increase the level and turn on
            	
                // Update the stored state
                state.level = state.level + change
                
                // If above 100 reset to 100
                if (state.level > 100){
                	state.level = 100
                }
                
                // Create the ST event details
                name = "level"
                value = state.level
                
                // Turn on switch if off
                if (state.OnOff == 0){
                	// Create the ST event details
                	name2 = "switch"
                	value2 = "on"
                    
                    // Update the stored state
                    state.OnOff = 1
                }
                
                // Set state to not turning
                state.clockwise = 0
            } else if (state.clockwise == -1){
            	// If anticlockwise, decrease the level
                
                // Reduce the stored level
                state.level = state.level - change
                
                // If below 0 reset to 0
                if (state.level < 0){
                	// Make sure it doesn't go below 0
                	state.level = 0
                }
                
                // Create the ST event details
                name = "level"
                value = state.level
                
                // If level = 0 then turn off switch
                if (state.level == 0) {
                	// Update stored state
                	state.OnOff = 0
                    
                    // Create ST event details
                    name2 = "switch"
                    value2 = "off"
                }
                
                // Set state to not turning
                state.clockwise = 0
            }
        } else if (description.endsWith("00 0000 04 00 000100")) {
        	// Fast turn anti-clockwise
            log.debug "fast acw"
            
            // turn down level by 50
            state.level = state.level - 50
            
            // If below 0 reset to 0
            if (state.level < 0){
            	state.level = 0
            }
            
            // Create ST event details
            name = "level"
            value = state.level
            
            // if reached 0 turn off switch
            if (state.level == 0) {
            	if (state.OnOff == 1) {
	            	state.OnOff = 0
    	            name2 = "switch"
        	        value2 = "off"
                }
            }
        } else if (description.endsWith("00 0000 04 00 FF0100")) {
        	// Fast turn clockwise
            log.debug "fast cw"
            
            // turn up level by 50
            state.level = state.level + 50
            
            // make sure it doesn't go above 100
            if (state.level > 100) {
            	state.level = 100
            }
            
            name = "level"
            value = state.level
            
            if (state.OnOff == 0) {
            	state.OnOff = 1
            	name2 = "switch"
            	value2 = "on"
            }
        } else if (description.endsWith("00 0000 07 00 ")) {
        	// Unknown reply - appears after most turns
            log.debug "Unknown catchall 1"
        } else {
            log.debug "Other Catch all: '$description'"
            // The output I have seen so far from the dimmer
            // catchall: 0104 0008 01 01 0100 00 D035 01 00 0000 04 00 000100 - fast turn anti-clockwise
            // catchall: 0104 0008 01 01 0140 00 D035 01 00 0000 04 00 000100 - different type of fast turn anti-clockwise?
            // catchall: 0104 0008 01 01 0100 00 D035 01 00 0000 04 00 FF0100 - fast turn clockwise
            // catchall: 0104 0008 01 01 0140 00 D035 01 00 0000 04 00 FF0100 - different type of fast turn clockwise?
            
            //def descMap = zigbee.parseDescriptionAsMap(description)
        	//log.debug zigbee.parseDescriptionAsMap(description)
        }
    } else {
    	log.debug "Not catch all: $description"
    }
    
    // createEvent returns a Map that defines an Event
    def result = createEvent(name: name, value: value)
    def result2 = createEvent(name: name2, value: value2)
    
    // If there is any result log it
    if (name != null) {
		log.debug "Result 1: ${result?.descriptionText}"
    }
    if (name2 != null) {
    	log.debug "Result 2: ${result2?.descriptionText}"
	}
    
    // returning the Event definition map creates an Event
    // in the SmartThings platform, and propagates it to
    // SmartApps subscribed to the device events.
    return [result, result2]
}

// handle commands
def on() {
	log.debug "Executing 'on'"
	// Handles 'on' commands from the SmartThings app or others
    
    // if switched off, turn on and set level to 50
    state.level = 50
    state.OnOff = 1
    
    // Send switch on and level events
    sendEvent(name: "switch", value: "on")
    sendEvent(name: "level", value: 50)
}

def off() {
	log.debug "Executing 'off'"
	// Handles 'off' commands from the SmartThings app or others
    
    // Update the stored state
    state.level = 0 // Set level to 0
    state.OnOff = 0 // Set to off
    
    // Send events to report set level and switch off
    sendEvent(name: "switch", value: "off")
    sendEvent(name: "level", value: 0)
}

def setLevel(int lev) {
	log.debug "Executing 'setLevel' $lev"
	// Handles 'setLevel' commands from the SmartThings app or others
    
    // If the level has changed
    if (lev != state.level) {
        if (lev == 0) {
        	// If 0 switch off
        	
            // Update the stored state
            state.level = lev
            state.OnOff = 0
            
            // Send events for the updates
            sendEvent(name: "switch", value: "off")
            sendEvent(name: "level", value: 0)
        } else {
        	// Set the stored level
            state.level = lev
            
            // If above 100 set to 100
            if (state.level > 100) {
            	state.level = 100
            }
            
            // If the switch is off turn it on
            if (state.OnOff == 0) {
            	state.OnOff = 1 // Update stored state to on
                sendEvent(name: "switch", value: "on")
            }
            
            // Send event to set the level (needed?)
            sendEvent(name: "level", value: state.level)
        }
    }
}

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

With this I can change the level gradually even if the code isn’t correct :slight_smile:

I hope this helps,
Kris.

By the way, I just tried using the Smart Lighting app together with my version of the device handler, it works great!
To set it up you can do the following:

  1. In the app go to Automation -> SmartApps
  2. Click “Add a SmartApp”
  3. Select “Lights & Switches” -> “Smart Lighting”
  4. Click on “New Lighting Automation”
  5. In the “Which devices do you want to control” select the bulbs you want to adjust
  6. In “What do you want to do?” select “Mirror Behaviour”
  7. In “Mirror which switch?” select the IKEA Wireless Dimmer (whatever you called it)
  8. Click “Next” then “Save” then “Save” again

There you go, you should now have a light that responds to the dimmer!
Cheers,
Kris.

Hi,

I have tried to pair these devices , they show up as a thing eventually , then I can assign the device handler but I can’t get them to do anything, no log entries no nothing, has anyone else had this issue?

Current Version: 0x12248572
Raw Description 01 C05E 0810 02 06 0000 0001 0003 0009 0B05 1000 06 0003 0004 0006 0008 0019 1000

Thanks
Mike

I am using this TRÅDFRI Dimmer v0.4 DH and I replaced these lines in the configure function with my zigbe ID and Network ID.

def configure() {
Change these lines:
configCmds += “zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0001 {${device.zigbeeId}} {}” // battery
configCmds += “zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0008 {${device.zigbeeId}} {}” // intensity changes

To Something that looks like this: (use your devices Zigbee Id and Device Network Id values)

configCmds += "zdo bind 0x8E68 0x01 0x01 0x0001 {000B57FFFE8A4C24} {}" // battery
configCmds += "zdo bind 0x8E68 0x01 0x01 0x0008 {000B57FFFE8A4C24} {}" // intensity changes

With this change, I can now see logging in the IDE when moving the dimmer.

Adding which lights to control ( mentioned two comments above by kristian.andrews)
my lights are dimming!!!

  1. In the app go to Automation -> SmartApps
  2. Click “Add a SmartApp”
  3. Select “Lights & Switches” -> “Smart Lighting”
  4. Click on “New Lighting Automation”
  5. In the “Which devices do you want to control” select the bulbs you want to adjust
  6. In “What do you want to do?” select “Mirror Behaviour”
  7. In “Mirror which switch?” select the IKEA Wireless Dimmer (whatever you called it)
  8. Click “Next” then “Save” then “Save” again

Thanks for the Device Handler Kristian, Carl, and Haoto

Can someone confirm if it’s possible to connect the dimmer to both ST and directly to IKEA lights? I’m having problems connecting IKEA drivers to ST but I thought I could connect the dimmer to both St and the drivers and control the drivers that way!

Hi Mikey887
Did you get it to work. I am trying to se oth 0.2 and 0.4 DH but canÂŽt get it to work. No events are being logged from the dimmer.

thanks
philip

I am trying this right now but Up until now I haven’t been able to get it to list events from the dimmer in the ST hub. I will update you on my progess.

yes, but its super flakey , i think its the actual device isnt great at registering events, i can just about get it to register on and off dimming just doesnt work at all

Hi Guys,

Reporting here with a UK v2 Hub with the v0.4 with the manual edit of the igbe ID and Network ID as suggested by Jared_LeC. Still, I do not see any events happening in the IDE and the lamp I have setup to mirror, does not mirror at all.

Any ideas?

Hello,

As there has been a few issues I just carried out a bit of a test by deleting my dimmer and all the related device handlers to try it from fresh. I also have a UK v2 hub, so if it works for me you should be OK.

I tried the v0.4 handler and I don’t get any logs, probably it is a bug in the Zigbee registration part, I will play around with it when I have a little time.

I then deleted this and the device and tried v0.2 from this thread, again I had trouble because I had commented out a line for testing earlier!

So I deleted everything again, then added the corrected device handler and searched for the dimmer again. After correcting the handler the dimmer was detected correctly as “Tradfri Dimmer v0.2” and now I can see the logs, as below:

Instead of adding more code here I have added the handler that definitely works to my Github:

Please give this a go and see how you get on. Just make sure you only have one device handler so v0.4 doesn’t take over automatically.

I found the easiest way to get the dimmer back into pairing mode is just to remove the battery and put it back in after a few seconds. I did this, searched in the app and it was detected straight away.

So, overall this is working fine for me now. I’ll have another look at the v0.4 dimmer soon and see if I can get it working.

Just for info, the dimmer works based on the time you turn it for rather than the angle. Turn it slowly for normal dimming and fast to jump up or down 50% at a time.

Let me know if you get stuck,
Kris.

Hi Kris,

Thanks for the detailed instructions. I did remove the device completely, then removed the handler, then added yours - all 343 lines of it. Then added the Tradfri with the battery out option. It was defaulted to a Samsung TV handler but I chose the Ikea Tradfri v0.2 that I had added. It was the only one there was, so no risk of a mixup.

And still
 complete silence. Nothing in the log. Nothing in the app no matter how hard I rotate on the magnetic stand.

Any ideas how I can further diagnose?

ilyan