XBee to SmartThings Continued.

So A quick re-cap of what we've done so far from a flow viewpoint.

A few assumptions are made including that the hub is allowing connections.

e.g. "Add a Thing"

The frame layout of a Simple Descriptor Request as received into our XBee
The frame layout of a Simple Descriptor Request as received into our XBee

So by way of an explanation I'll use my garage door opener project for a description of how this all connects.

For this project the device needs to handle the mandatory clusters for the device type as noted in the ZigBee Home Automation specification.

The device only needs the ability to toggle a relay to open the door and report back whether its closed or not.

In order to turn on the relay it needs to support On/Off output clusters and to report open or closed it needs to support Binary Input Clusters

(The whole input vs output can be confusing)

As we can see in the Zigbee HA spec. ALL devices share two mandatory clusters.

Basic and Identify.

So with this information we will use the following clusters when we reply with the Simple Descriptor Response we will say that incoming clusters supported will be

Basic - 0x0000

Identify - 0x0003

On/Off - 0x0006

and our outgoing clusters will be

Binary Input - 0x000F

After sending out the Simple Descriptor the hub knows that the endpoint is a Zigbee Home Automation (ZHA) endpoint. From here the packets will change from ZDO packets to ZHA packets and the hub will query the endpoint further as shown below.

SmartThings now has enough information to fingerprint and identify the device. If there is a device handler that matches the information,ation we have given it, namely the Cluster in/out fingerprint and the version/manufacturer/model then the "thing" will be associated with its correct device handler and will appear as the correct device on SmartThings. If no matching device handler exists, the device will appear as "Thing".

 

 

More to come as I get time..

Write a comment

Comments: 0