SmartThings ZigBee Class method signatures

Is there any documentation on the full set of methods under zigbee.* ?

In particular:

zigbee.addBinding
zigbee.removeBinding

There’s a few examples of addBinding in the public github, but I’ve not been able to track down anything for removeBinding.

Seems to want 5 arguments based on error message when trying to use it:

Possible solutions: removeBinding(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)

Alternatively does anybody know what a “zdo unbind” should look like, or an “st raw” equivalent?

“method signature” is not a zigbee term. Zigbee is an independent third party protocol and well documented. SmartThings supports 3 Zigbee profiles:

Zigbee Home Automation 1.2
Zigbee Light Link (partial)
Zigbee 3.0 (partial)

Zigbee messages use “clusters” of predefined values.

The following page from the old documentation shows how SmartThings looks at Zigbee clusters:

The external links on that page are dead, here are the current ones:

ZCL:

ZCL for Zigbee 3.0 with internal links (this is probably the one you need)

And here’s the one for ZHA if you are working with an older device:

As far as constructing a ZDO payload, assuming it’s for nonvolatile bindings, the request would include source address, source endpoint, cluster ID, destination address and destination endpoint for each binding entry. But I don’t know if SmartThings uses an abstraction layer or not.

Tagging @tpmanley

1 Like

Thanks, I edited the topic so that it’s hopefully clearer what I am asking.

Within the “zigbee” Class there are many methods, some are detailed at https://docs.smartthings.com/en/latest/device-type-developers-guide/building-zigbee-device-handlers.html

For example zigbee.command, zigbee. configureReporting, etc.

As the documentation is incomplete I simply need to know what the zigbee.removeBinding() method is expecting, as mentioned the error message when I try to call it suggests it expects 5 arguments of Object type.

There’s some examples of the zigbee.addBinding() method in the public github, for example https://github.com/SmartThingsCommunity/SmartThingsPublic/search?q=addbinding - but trying to extrapolate arguments for that method into something that would work for zigbee.removeBinding() isn’t proving fruitful.

For example:

zigbee.addbinding(zigbee.LEVEL_CONTROL_CLUSTER)

adds a binding appropriately.

But if I try to call:

zigbee.removeBinding(zigbee.LEVEL_CONTROL_CLUSTER)

I get the error mentioned above.

Similarly for zdo commands, I can do:

zdo bind 0x83B6 0x01 0x01 0x0702 {588E81FFFE678F2C} {}

without issue, but there’s no documentation or examples that I’ve found for a corresponding unbind command.

Simply swapping “bind” for “unbind” doesn’t seem to work.

The alternative is to do an “st raw” equivalent, but the syntax for that eludes me too.

1 Like

@MartynWendon. Here is the method declaration:

removeBinding(cluster, srcAddr, srcEndpoint, destAddr, destEndpoint)

For example, try this:

zigbee.removeBinding(zigbee.LEVEL_CONTROL_CLUSTER, zigbee.zigbeeId, zigbee.endpointId, zigbee.zigbeeEui, zigbee.SOURCE_ENDPOINT)

zigbee.zigbeeId is the EUI of the device which is what you need for the srcAddr (since it’s from the point of view of the device) and zigbee.zigbeeEui is the EUID of the hub which is what you need for the destAddr.

3 Likes

That’s great, thanks very much for that!

Would there be any updated documentation for this sort of stuff in general?

I can mention this to the documentation team but to be honest I’m not sure what their backlog is like. If something like this comes up again in the meantime we can do our best to answer questions.

1 Like

Thanks again, even just a doxygen type output of methods & signatures would be helpful :slight_smile:

Also, for removeBinding() I don’t seem to get any response back (nothing received in parse() method).

When I do a zdo bind or an addBinding() I get a 0x8021 bind response back into parse() as expected.

For a zdo unbind or removeBinding() I would expect an 0x8022 unbind response back to parse().

I guess it could be the device not sending it, but I tested with a few different device types and the behaviour seems consistent.

The unbind does work though, for example the clusters that are unbound from stop reporting as expected.

Is the response back to parse() missing from the zigbee implementation in the hub?

Also for future thread reference the zdo unbind syntax to unbind the hub from a cluster on a device is:

zdo unbind unicast 0x83B6 {588E81FFFE678F2C} 0x01 0x0B04 {286D970002053877} 0x01

zdo unbind unicast DEVICE_NETWORK_ID {DEVICE_ZIGBEE_ID} DEVICE_ENDPOINT CLUSTER_ID {HUB_EUI} HUB_ENDPOINT

That’s as generated by removeBinding()

1 Like