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

dth_remotes

(Jamiethegoalie) #1

Purchased an IKEA tunable white bulb packaged with a 5 button switch. Have paired both with the ST hub. Got the bulb to work very easily, couldn’t find a DH for the button though. Figured this was my cue to wade into programming for ST. Did some reading, muddled through the documentation and community posts. “Borrowed” a4refillpad code for the Xiaomi Zigbee Button to try and view the messages sent to the hub.
Here is the code I’m using

/**
*/
metadata {
definition (name: “Tradfri Button Test”, namespace: “jamiethegoalie”, author: “jamiethegoalie”) {
capability "Battery"
capability "Button"
capability "Holdable Button"
capability "Actuator"
capability "Switch"
capability "Momentary"
capability "Configuration"
capability "Sensor"
capability “Refresh”

	attribute "lastPress", "string"
	attribute "batterylevel", "string"
	attribute "lastCheckin", "string"

fingerprint profileId: “0104”, deviceId: “0810”, inClusters: “0000, 0001, 0003, 0009, 0B05, 1000”, outClusters: “0003, 0004, 0005, 0006, 0008, 0019, 1000”, manufacturer: “IKEA of Sweden”, model: “lumi.sensor_switch”, deviceJoinName: “”

}


tiles(scale: 2) {

	multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true) {
		tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
       		attributeState("on", label:' push', action: "momentary.push", backgroundColor:"#53a7c0")
        	attributeState("off", label:' push', action: "momentary.push", backgroundColor:"#ffffff", nextState: "on")   
		}
        tileAttribute("device.lastCheckin", key: "SECONDARY_CONTROL") {
			attributeState("default", label:'Last Update: ${currentValue}',icon: "st.Health & Wellness.health9")
        }
	}        
   
    valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) {
		state "battery", label:'${currentValue}% battery', unit:""
	}
    standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "default", action:"refresh.refresh", icon:"st.secondary.refresh"
    }
    standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "configure", label:'', action:"configuration.configure", icon:"st.secondary.configure"
	}
    
	main (["switch"])
	details(["switch", "battery", "refresh", "configure"])
}

}

def parse(String description) {
log.debug “Parsing ‘${description}’”
// send event for heartbeat
def now = new Date().format(“yyyy MMM dd EEE h:mm:ss a”, location.timeZone)
sendEvent(name: “lastCheckin”, value: now)

def results = []
// if (description?.startsWith('on/off: '))
// results = parseCustomMessage(description)
if (description?.startsWith(‘catchall:’))
results = parseCatchAllMessage(description)

return results;
}

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)

 zigbee.configureReporting(0x0000, 0x0000, 0x10, 0, 600, null)
 //zigbee.configureReporting(0x0006, 0x0000, 0x10, 0, 600, null)

}

def refresh(){
log.debug “refreshing”
}

private Map parseCatchAllMessage(String description) {
Map resultMap = [:]
def cluster = zigbee.parse(description)
log.debug cluster
if (cluster) {
switch(cluster.clusterId) {
case 0x0000:
resultMap = getBatteryResult(cluster.data.last())
break

		case 0xFC02:
		log.debug 'ACCELERATION'
		break

		case 0x0402:
		log.debug 'TEMP'
			// temp is last 2 data values. reverse to swap endian
			String temp = cluster.data[-2..-1].reverse().collect { cluster.hex1(it) }.join()
			def value = getTemperature(temp)
			resultMap = getTemperatureResult(value)
			break
	}
}

return resultMap

}

Here is part of the log:
3644a338-036c-4800-ab0b-064c231481d8 9:50:01 PM: debug SmartShield(clusterId: 0x8021, command: 0x00, data: [0x11, 0x00], destinationEndpoint: 0x00, direction: 0x00, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: null, options: 0x0040, profileId: 0x0000, senderShortId: 0x85ae, sourceEndpoint: 0x00, text: null)
3644a338-036c-4800-ab0b-064c231481d8 9:50:01 PM: debug Parsing 'catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 1100’
3644a338-036c-4800-ab0b-064c231481d8 9:49:54 PM: debug Configuring Reporting and Bindings

Pushing the button doesn’t initially send anything to the log. After I press the configure button in the app the next time I press a button on the switch log entries show up.

I’m looking for some guidance on setting up the bindings so I can view the button press messages.

Sorry for the long post. I couldn’t figure out how the scrollable window for code worked.


IKEA Trådfri
IKEA Tradfri RGB Bulbs (ZigBee with "CIE xy" color scheme)
[UPDATED 4/19/17] Hue B Smart (Smart and FAST Hue Lighting)
IKEA Trådfri
IKEA Trådfri
Looking for Recommended Switches for U.K. under £20 instead of Hue Dimmer
(Craig Taylor) #2

I can’t even get your handler to show events posting in the log, after pressing the ‘configure’ button in the app.

Can you post your part of the event log which you believe marries to button presses sir?


(Jamiethegoalie) #3

I just tried it again to make sure it was working as I thought it was. Here’s the full log for the button
3644a338-036c-4800-ab0b-064c231481d8 10:21:25 AM: error groovy.lang.MissingMethodException: No signature of method: script14917476848861328595405.getBatteryResult() is applicable for argument types: (java.lang.Short) values: [0] @ line 108
3644a338-036c-4800-ab0b-064c231481d8 10:21:25 AM: debug SmartShield(clusterId: 0x0000, command: 0x07, data: [0x8d, 0x00, 0x00, 0x00], destinationEndpoint: 0x01, direction: 0x01, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: null, options: 0x0040, profileId: 0x0104, senderShortId: 0x85ae, sourceEndpoint: 0x01, text: null)
3644a338-036c-4800-ab0b-064c231481d8 10:21:25 AM: debug Parsing 'catchall: 0104 0000 01 01 0040 00 85AE 00 00 0000 07 01 8D000000’
3644a338-036c-4800-ab0b-064c231481d8 10:21:25 AM: debug SmartShield(clusterId: 0x8021, command: 0x00, data: [0x1b, 0x00], destinationEndpoint: 0x00, direction: 0x00, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: null, options: 0x0040, profileId: 0x0000, senderShortId: 0x85ae, sourceEndpoint: 0x00, text: null)
3644a338-036c-4800-ab0b-064c231481d8 10:21:24 AM: debug Parsing 'catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 1B00’
3644a338-036c-4800-ab0b-064c231481d8 10:21:24 AM: debug SmartShield(clusterId: 0x8021, command: 0x00, data: [0x1b, 0x00], destinationEndpoint: 0x00, direction: 0x00, isClusterSpecific: false, isManufacturerSpecific: false, manufacturerId: 0x0000, messageType: 0x00, number: null, options: 0x0040, profileId: 0x0000, senderShortId: 0x85ae, sourceEndpoint: 0x00, text: null)
3644a338-036c-4800-ab0b-064c231481d8 10:21:23 AM: debug Parsing 'catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 1B00’
3644a338-036c-4800-ab0b-064c231481d8 10:21:16 AM: debug Configuring Reporting and Bindings.
3644a338-036c-4800-ab0b-064c231481d8 10:21:13 AM: debug refreshing

First line is me pushing the refresh button in the ST app. Second line is me pressing the Configure button. After that I press the centre button on the Ikea switch. Everything after the “Configure Reporting and Bindings” message is logged after I press the button. Pressing the button again doesn’t produce any further log messages. The only way to get more logging is to press Configure again.

Later on I thought maybe the log messages were delayed from the Configure press. I tried just pressing Configure and waiting. Nothing appeared in the log until I pressed a button on the switch.

Thanks in advance for any light you can shed on this.


(www.smartukhome.co.uk) #4

I brought one today to see what I can do I haven’t done a DH like this before. But at £15 pounds I was hoping one day this thing will work


(Jamiethegoalie) #5

Hi @tmleafs

Hope you have better luck than I have.

How did you become a Leafs fan in the UK?


(Jamiethegoalie) #7

You picked a tough time to start following the leafs. :grinning: Things are looking up now though

I’m a Habs fan, would love to see the Leafs knock off the Caps. Don’t fancy facing that lineup.if we make it into later rounds.

I’m the other side of the sport coin. I’m in Canada and got hooked on football (soccer to me…lol) about 15 years ago. A buddy brought me out to a Celtic pub to watch the Hoops. I’ve been hooked ever since.


(bakdeniz) #8

Hi Jamie,

What did you change in the original code fom a4refillpad?


(Jamiethegoalie) #9

I don’t remember exactly what I changed now, mostly trying to pare the code down to just what I needed.

I was looking through some of the posts in the forums and came across some posts on the Hue Dimmer Switch which is also ZLL. I grabbed the code from here

Git rid of everything but the parse message description. Here is what I have

/**

  • Hue Dimmer Switch
  • Copyright 2016 Stephen McLaughlin
  • 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: “Tradfri Button Test”, namespace: “jamiethegoalie”, author: “jamiethegoalie”) {
capability "Configuration"
capability "Battery"
capability "Refresh"
capability "Button"
capability “Sensor”

   // fingerprint profileId: "0104", endpointId: "01", application:"02", outClusters: "0019", inClusters: "0000,0001,0003,000F,FC00", manufacturer: "Philips", model: "RWL020", deviceJoinName: "Hue Dimmer Switch (ZHA)"

	attribute "lastAction", "string"
}


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

tiles(scale: 2) {
	// TODO: define your main and details tiles here
    multiAttributeTile(name:"lastAction", type: "generic", width: 6, height: 4){
        tileAttribute ("device.battery", key: "SECONDARY_CONTROL") {
			attributeState "battery", label:'${currentValue}% battery',icon:"st.Outdoor.outdoor3", unit:"", backgroundColors:[
				[value: 30, color: "#ff0000"],
                [value: 40, color: "#760000"],
				[value: 60, color: "#ff9900"],
				[value: 80, color: "#007600"]
			]
		}
        tileAttribute ("device.lastAction", key: "PRIMARY_CONTROL") {
			attributeState "active", label:'${currentValue}', icon:"st.Home.home30"
		}

	}

    valueTile("battery2", "device.battery", decoration: "flat", inactiveLabel: false, width: 5, height: 1) {
		state("battery", label:'${currentValue}% battery', unit:"")
	}
    standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 1, height: 1) {
        state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
    }
    standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "default", label:"bind", action:"configure"
    }

}

        main "lastAction"
    details(["lastAction","battery2","refresh","configure"])

}

// parse events into attributes
def parse(String description) {
log.trace description
//def msg = zigbee.parse(description)

//log.trace msg

}

/*
getBatteryResult
*/
//TODO: needs calibration
private Map getBatteryResult(rawValue) {
log.debug "Battery rawValue = ${rawValue}"
return result
}

/*
parseCatchAllMessage
*/
private Map parseCatchAllMessage(String description) {
Map resultMap = [:]
def cluster = zigbee.parse(description)
log.debug cluster

return resultMap

}

def refresh() {
log.debug “Refresh”

def refreshCmds = []

refreshCmds += "st rattr 0x${device.deviceNetworkId} 0x01 0x0001 0x0020"; // WORKS! - Fetches battery from 0x02


return refreshCmds

}

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

// Configure Button Count

sendEvent(name: “numberOfButtons”, value: 4, displayed: false)

// Monitor Buttons
//TODO: This could be zigbee.configureReporting(0xFC00, 0x0000, 0x18, 0x001e, 0x001e); but no idea how to point it at a different endpoint
configCmds += "zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0xFC00 {${device.zigbeeId}} {}"
configCmds += "delay 2000"
configCmds += "st cr 0x${device.deviceNetworkId} 0x01 0xFC00 0x0000 0x18 0x001E 0x001E {}"
configCmds += “delay 2000”

// Monitor Battery
//TODO: This could be zigbee.batteryConfig(); but no idea how to point it at a different endpoint
configCmds += "zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0001 {${device.zigbeeId}} {}"
configCmds += "delay 2000"
configCmds += “st cr 0x${device.deviceNetworkId} 0x01 0x0001 0x0020 0x20 0x001E 0x0258 {}”
// configCmds += “st cr 0x${device.deviceNetworkId} 0x01 0x0001 0x0020 0x20 0x001E 0x001e {}”

configCmds += "delay 2000"

return configCmds + refresh()

}

def configureHealthCheck() {
log.debug "configureHealthCheck"
Integer hcIntervalMinutes = 12
refresh()
sendEvent(name: “checkInterval”, value: hcIntervalMinutes * 60, displayed: false, data: [protocol: “zigbee”, hubHardwareId: device.hub.hardwareID])
}

def updated() {
log.debug “in updated()”

configureHealthCheck()
}

And here is the log

3644a338-036c-4800-ab0b-064c231481d8 4:41:03 PM: trace read attr - raw: 85AE010001082000201D, dni: 85AE, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, value: 1d
3644a338-036c-4800-ab0b-064c231481d8 4:40:33 PM: trace read attr - raw: 85AE010001082000201D, dni: 85AE, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, value: 1d
3644a338-036c-4800-ab0b-064c231481d8 4:40:26 PM: trace catchall: 0104 FC00 01 01 0040 00 85AE 00 00 0000 07 01 86000000
3644a338-036c-4800-ab0b-064c231481d8 4:40:25 PM: trace read attr - raw: 85AE0100010A200000201D, dni: 85AE, endpoint: 01, cluster: 0001, size: 0A, attrId: 0020, result: success, encoding: 20, value: 1d
3644a338-036c-4800-ab0b-064c231481d8 4:40:24 PM: trace catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 2800
3644a338-036c-4800-ab0b-064c231481d8 4:40:22 PM: trace catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 2800
3644a338-036c-4800-ab0b-064c231481d8 4:40:21 PM: trace catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 2900
3644a338-036c-4800-ab0b-064c231481d8 4:40:20 PM: trace catchall: 0104 FC00 01 01 0040 00 85AE 00 00 0000 07 01 86000000
3644a338-036c-4800-ab0b-064c231481d8 4:40:19 PM: trace catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 2800
3644a338-036c-4800-ab0b-064c231481d8 4:40:19 PM: trace catchall: 0104 FC00 01 01 0040 00 85AE 00 00 0000 07 01 86000000
3644a338-036c-4800-ab0b-064c231481d8 4:40:19 PM: trace catchall: 0000 8021 00 00 0040 00 85AE 00 00 0000 00 00 2800
3644a338-036c-4800-ab0b-064c231481d8 4:40:12 PM: debug Refresh
3644a338-036c-4800-ab0b-064c231481d8 4:40:12 PM: debug Configiring Reporting and Bindings.
3644a338-036c-4800-ab0b-064c231481d8 4:40:02 PM: trace read attr - raw: 85AE010001082000201D, dni: 85AE, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, value: 1d
3644a338-036c-4800-ab0b-064c231481d8 4:38:52 PM: trace read attr - raw: 85AE010001082000201D, dni: 85AE, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, value: 1d

The first entry occurs when I push a button. Then it seems to refresh every 30 seconds. I press the Bind button in the ST App and the next time I press a button I get the list of catchall messages. Then it logs the read attr two more times and then waits. The next time I press the button after that it will log the read attr message again

I think I need to research ZLL and ZHA a little bit more to understand how it binds/sends messages


(bakdeniz) #10

Have you seen the thread below? The DH used here from @thegilbertchan seem to be a bit more simple. Maybe it is a bit better starting point?


(www.smartukhome.co.uk) #11

Everyone given up?

doesn’t matter what I do can only get it to work after a configure press and then every button gives a different reply on every button


(Gavin Melling) #12

Can you print the replies from pressing a single button (let’s say +) 5 times in a row, then a secondary button (let’s say -) 5 times in a row.

Hopefully we can start spotting a pattern.


(www.smartukhome.co.uk) #13

problem is it stops replying after only one button press but you receive like 4 lines


(Gavin Melling) #14

So 1 button press gives you 4 lines - then subsequent button presses don’t respond with anything?


(www.smartukhome.co.uk) #15

Its 3 lines
This is one button press (Middle)

e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:27: debug Parse returned Ikea Button received 'catchall: 0104 0001 01 01 0140 00 F180 00 00 0000 07 01 00'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:27: debug Parse returned Ikea Button received 'catchall: 0104 0001 01 01 0140 00 F180 00 00 0000 07 01 00'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:27: debug Parsing: catchall: 0104 0001 01 01 0140 00 F180 00 00 0000 07 01 00
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:26: debug Parse returned Ikea Button received 'catchall: 0000 8021 00 00 0040 00 F180 00 00 0000 00 00 0300'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:26: debug Parse returned Ikea Button received 'catchall: 0000 8021 00 00 0040 00 F180 00 00 0000 00 00 0300'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:26: debug Parsing: catchall: 0000 8021 00 00 0040 00 F180 00 00 0000 00 00 0300
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:25: debug Parse returned Ikea Button received 'catchall: 0104 0500 01 01 0140 00 F180 00 00 0000 04 01 861000'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:25: debug Parse returned Ikea Button received 'catchall: 0104 0500 01 01 0140 00 F180 00 00 0000 04 01 861000'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:18:25: debug Parsing: catchall: 0104 0500 01 01 0140 00 F180 00 00 0000 04 01 861000

Then nothing till I press configure then middle button again

e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:37: debug Parse returned Ikea Button received 'catchall: 0104 0001 01 01 0140 00 F180 00 00 0000 07 01 00'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:37: debug Parse returned Ikea Button received 'catchall: 0104 0001 01 01 0140 00 F180 00 00 0000 07 01 00'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:37: debug Parsing: catchall: 0104 0001 01 01 0140 00 F180 00 00 0000 07 01 00
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:37: debug Parse returned Ikea Button received 'catchall: 0000 8021 00 00 0040 00 F180 00 00 0000 00 00 0400'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:37: debug Parse returned Ikea Button received 'catchall: 0000 8021 00 00 0040 00 F180 00 00 0000 00 00 0400'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:37: debug Parsing: catchall: 0000 8021 00 00 0040 00 F180 00 00 0000 00 00 0400
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:36: debug Parse returned Ikea Button received 'catchall: 0104 0500 01 01 0140 00 F180 00 00 0000 04 01 861000'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:36: debug Parse returned Ikea Button received 'catchall: 0104 0500 01 01 0140 00 F180 00 00 0000 04 01 861000'
e037dbdf-f319-4cd0-a1d0-b86b1512c1a5  19:20:36: debug Parsing: catchall: 0104 0500 01 01 0140 00 F180 00 00 0000 04 01 861000

(Jamiethegoalie) #16

@tmleafs
Still working on this too, haven;t had any time lately though. I am seeing the same thing as you in my logs.


(Keith Spragg) #17

I have bought one of these remotes in the hope that someone will be able to figure it all out, too!

Since I tried pairing it with my system and couldn’t do anything with it, I reset one of the lights and had a mess with the remote using that.

I noticed that pressing left and right always ends up doing one of the ‘scenes’ (like in hue, where it changes the warmth of the light) in a set order. Also, pressing up and down would do nothing if the light was already at the brightest or dimmest. I’m wondering if the remote has some communication with the light to pre-determine the brightness level, or current scene, which is why we can’t get much to happen with the remote when you’re looking at the logs?

Anyway, thanks for the hard work thus far, and here’s hoping we can get it working over time.


(Keith Spragg) #18

Looking at the code - I was trying to get it do the check that I’ve read elsewhere to do the check of the endpoints that it supports. So far, I’m failing miserably - the joys of a very steep learning curve!

So, taking the device handler that JamieTheGoalie had posted, I tried using one of the other buttons rather than the middle one.

I pressed configure, then the left arrow button on the remote - then repeated the procedure to see what I got.
I found I got two commands, the same as others had said…

'catchall: 0000 8021 00 00 0040 00 AF37 00 00 0000 00 00 1500'
This type of line looks the same, but with an escalating number at the end - 1500, 1600, 1700, 1800, 1900, 1a00, etc.

'catchall: 0104 0000 01 01 0140 00 AF37 00 00 0000 07 01 8D000000'
This type of line stays the same every time.

I then repeated with the right arrow button and got the same - escalating numbers and the same second line.

Looking at 0x8021 in the Zigbee specs, it looks like a Bind Command has been issued by the Device Handler, and then the button being pressed is the response from the device.

Here’s the link to the spec I found the info in, and then follows a copy/paste of the info:
Zigbee Specifications Link (external)

2.4.4.2.2 Bind_rsp

The Bind_rsp command (ClusterID=0x8021) shall be formatted as illustrated in Figure 2.84.

Octets: 1
Status

Figure 2.84 Format of the Bind_rsp Command Frame

Table 2.112 specifies the fields of the Bind_rsp command frame.

Table 2.112 Fields of the Bind_rsp Command

Name
Status

Type
Integer

Valid Range
SUCCESS,
NOT_SUPPORTED,
INVALID_EP,
TABLE_FULL or
NOT_AUTHORIZED

Description
The status of the Bind_req command.

2.4.4.2.2.1 When Generated

The Bind_rsp is generated in response to a Bind_req. If the Bind_req is processed
and the Binding Table entry committed on the Remote Device, a Status of
SUCCESS is returned. If the Remote Device is not a Primary binding table cache
or the SrcAddress, a Status of NOT_SUPPORTED is returned. The supplied
endpoint shall be checked to determine whether it falls within the specified range.
If it does not, a Status of INVALID_EP shall be returned. If the Remote Device is
the Primary binding table cache or SrcAddress but does not have Binding Table
resources for the request, a Status of TABLE_FULL is returned.

2.4.4.2.2.2 Effect on Receipt

Upon receipt, error checking is performed on the request as described in the
previous section. Assuming the Status is SUCCESS, the parameters from the
Bind_req are entered into the Binding Table at the Remote Device via the
APSME-BIND.request primitive.

----------- END OF COPY -----------

So, what I think is happening is that the device is trying to run the binding process, then failing, and not sending any further data over the network because it’s not successfully binding.

I read something about this the other day, and I thought I’d saved some pages about that, but can’t seem to find them today - will keep a good eye out for them as I trawl through my findings again.

Hope this stuff helps you guys too.


(Keith Spragg) #19

Over on the Light Device handler information page, a fantastic primer has been posted by @SmartHomePrimer:

From what I’ve been reading, that suggests that the device is joining the same Zigbee network, and then being used as a secondary controller (I think that’s the right Zigbee terminology). At the moment, I am waiting for the electrics in the bathroom to be sorted out (they’re MR16 not GU10), so can’t test what happens after - but I am wondering if the hub will see the commands that are sent to the lights or not, seeing as it would now be bound to the lights directly. If the hub can see the commands, you might get a much better idea of what’s going on!


(Douglas Krug) #20

Indeed you can. I didn’t mention in that post, but if you have the SmartThings app open, you can see the dimming slider moving as you rotate the dimmer or adjust dimming with the remote. You can also see the state change to OFF when you turn the dimmer all the way down, toggle with the remote or the motion sensor turns off the bulb(s).

However, the UI does not seem to be accurate where multiple bulbs are concerned, but if one were linked to the other(s) that might not matter.


IKEA Floalt pairing Smarttthings Hub
(Richard Mercer) #21

I also bought one of these last weekend and I’m attempting to get this working with ST. Here are my finding so far.

I have repurposed some ST code from Github for a dimmer but it doesn’t seem to be sending button presses. Each time I press a button, it sends the read attr command with the battery level. It will do this the first button press, but then not on any other for about a minute. Then the next button press, it will send it’s battery level again. I doesn’t seem to actually send any data for the actual button press.

Below is the code I am using if anyone else wants to experiment. I’m new to ZigBee/ST development, but I don’t see a device even sending a command for ST to interpret when pressing buttons, so don’t know what I could possibly do to handle it.

Some thoughts on where to look next in case it jogs someone else memory:

  1. Is it not sending/receiving button presses because of a missing capability being declared?
  2. Has it been paired full with the base station?

Log entry when pressing button:
cd078d87-5704-4c1a-b073-5ec2dcbd3390 09:00:15: debug Parse returned [name:battery, value:100, descriptionText:5 Button Remote battery was 100%]
cd078d87-5704-4c1a-b073-5ec2dcbd3390 09:00:15: debug Battery
cd078d87-5704-4c1a-b073-5ec2dcbd3390 09:00:15: debug description is read attr - raw: 6BF0010001082000201E, dni: 6BF0, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, value: 1e
cd078d87-5704-4c1a-b073-5ec2dcbd3390 08:58:58: debug Parse returned [name:battery, value:100, descriptionText:5 Button Remote battery was 100%]
cd078d87-5704-4c1a-b073-5ec2dcbd3390 08:58:58: debug Battery
cd078d87-5704-4c1a-b073-5ec2dcbd3390 08:58:58: debug description is read attr - raw: 6BF0010001082000201E, dni: 6BF0, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, value: 1e