Create a DIY Zigbee Switch (S2C / S2C PRO)

(Vijay Gopinathan) #1

Hi All,
My idea is to create a own zigbee switch/dimmer and pair it with gateway.

  1. I used digi xstick and configured it.
  2. Got a Digi S2C zigbee module and changed parameters like PAN ID, Channels etc so that it is pairable
  3. The gateway detected it as a thing (unknown device type)

This is where I am now. Now i want this thing to be detected as a onOff switch / dimmable switch and then control the corresponding relay / triac based dimmer.

Any hints on how to make this thing as a switch? Anyone tried with S2C modules and a custom switch? Any pointers are welcome.

I am in parallel trying the custom firmware on meshbee which is kind of clone of Hue. But i prefer the previous approach.

Thanks for the help,

(Ben Francis) #2

I have played with the XBee Zigbee Mesh Kit and configured S2C modules as a controller, router and end device with the XCTU software. I never got as far as figuring out how to get them to use clusters from the Zigbee Home Automation profile though, which is what the gateway’s Zigbee adapter is looking for.

I asked Digi about this and they sent me a link to configure the S2C for the Home Automation profile

That’s as far as I got though, I couldn’t figure out what to do next. @dhylands may have some ideas?

(Vijay Gopinathan) #3

Thanks for the info. I have seen the link and I did configure by XBees with these parameters. The gateway (xstick) is able to detect the S2C as a thing (unknown thing) as of now (with these configurations).

But the inclusion process is about announcing the device and then sending the endpoints information back to controller. See the post below, a pretty old post but it explains how devices are included in the network.

There, finally the controller needs some additional information to detect it as a on/off switch. I don’t know how that happens in the mozilla gateway here.

Also what I don’t understand is, as part of end-point-announce process the HA profile has some parameter to say this device is on/off switch. But still in the link above this device is detected as unknown type. If the endpoint type is onoff why do you need additional device driver? I fail to understand this.

(Dave Hylands) #4

The zigbee adapter uses a classifier to determine the type of device that it found. The code can be found here:

In particular, for an on-off switch, it looks for an endpoint with cluster number 6, which is called the “General On/Off” cluster.

(Vijay Gopinathan) #5

It was super useful. I was able to add my Zigbee S2C as a on/off switch. Thank you very much for the hint.

Now after adding it to UI, i get an error message
“getValue for property on for: zb-xxxxxxxx-thing returning undefined”

Looks like the thing has no property for on/off. Any hint on resolving this error?

Thanks for the help,
Best Regards, Vijay

(Dave Hylands) #6

The fact that it haw “-thing” at the end means that it was able to see your device, but the classifier still didn’t detect the right clusters. If the right clusters are detected then it would have shown up as “-onOffSwitch”

If you start the gateway using the command:

npm start -- -d

Then you can use the script from (you’ll need to using first). This will print some output which includes the clusters that were recognized. With my Centralite smart plug, the cluster portion of the output looks like this:

    "activeEndpoints": {
        "1": {
            "deviceId": "0100",
            "deviceVersion": 0,
            "inputClusters": [
                "0000 - genBasic",
                "0003 - genIdentify",
                "0004 - genGroups",
                "0005 - genScenes",
                "0006 - genOnOff",
                "0b04 - haElectricalMeasurement",
                "0b05 - haDiagnostic"
            "outputClusters": [
                "0019 - genOta"
            "populated": false,
            "profileId": "0104"

The fact that it shows “0006 - genOnOff” indicates that its an onOffSwitch and the “0b04 - haElectricalMeasurement” makes it a smartPlug.

The profileId would also need to correct “0104” (260 decimal) is the ZHA or home automation profile