Zigbee Debugging / Development for New Driver

So I'm very new to all of this, I did not come from the ST environment.

I've purchased a hubitat and a few trial devices to see if I can make it work for my application.
The device that I have purchased did not have a ST DH code nor does it seem to work as a generic device.

It is a 4 button wall mount scene switch supplied by 3asmarthome.com.au

  1. I paired the device by putting into pairing mode and running new device wizard..

  2. Hubitat detects the device and assgins the driver as a SmartThings Presence Sensor V2.

  3. The details from "more..."

Manufacturer:Feibit CO.,LTD Product Name:SmartThings Presence Sensor V2Model Number:FB56+ZSN08KJ2.3deviceTypeId:41
manufacturer:Feibit CO.,LTD
address64bit:00124B0017AE8D81
address16bit:A8ED
model:FB56+ZSN08KJ2.3
basicAttributesInitialized:true
application:null
endpoints.04.manufacturer:Feibit CO.,LTD
endpoints.04.idAsInt:4
endpoints.04.inClusters:0000,0003
endpoints.04.endpointId:04
endpoints.04.profileId:0104
endpoints.04.application:null
endpoints.04.outClusters:0003,0004,0005,0006,0001
endpoints.04.initialized:true
endpoints.04.model:FB56+ZSN08KJ2.3
endpoints.04.stage:4
endpoints.03.manufacturer:null
endpoints.03.idAsInt:3
endpoints.03.inClusters:0000,0003
endpoints.03.endpointId:03
endpoints.03.profileId:0104
endpoints.03.application:null
endpoints.03.outClusters:0003,0004,0005,0006,0001
endpoints.03.initialized:true
endpoints.03.model:null
endpoints.03.stage:4
endpoints.02.manufacturer:null
endpoints.02.idAsInt:2
endpoints.02.inClusters:0000,0003
endpoints.02.endpointId:02
endpoints.02.profileId:0104
endpoints.02.application:null
endpoints.02.outClusters:0003,0004,0005,0006,0001
endpoints.02.initialized:true
endpoints.02.model:null
endpoints.02.stage:4
endpoints.01.manufacturer:null
endpoints.01.idAsInt:1
endpoints.01.inClusters:0000,0003
endpoints.01.endpointId:01
endpoints.01.profileId:0104
endpoints.01.application:null
endpoints.01.outClusters:0003,0004,0005,0006,0001
endpoints.01.initialized:true
endpoints.01.model:null
endpoints.01.stage:4

  1. Irrespective of the device driver chosen, the device status remains "unknown" and I cannot see any zigbee debug activity - all potential places I look for logs are blank.

So my question is, in the event that pre-existing DH code does not exist, how does one go about debugging zigbee events for a new device driver?

Am I missing something or is my hub/zigbee misbehaving?

Once I sort all this out - is there a reference for writing Hubitat DH's?

This is a 3 gang model that might be similar enough as a start. This last post describes changing 3 switches into two. That should be helpful to go from three to four.

This post by @veeceeoh might be of help in debugging the driver, and I'm sure you'll get great suggestions from him as well.

Here's information on porting a Smartthings DTH to a Hubitat Driver, as it is called.

This has a signature simular to the Iris Fob, I would try that driver with this device. After changing to that driver be sure to click the configure command.
The Iris Fob has a presence function, you will not likely not use this and it can be disabled in driver details.

As @SmartHomePrimer states, the device handler code from the "HUI ZigBee Wall Switch 3 Gang" device handler obtained from that SmartThings forums thread could be used as a starting point to adapt into a Hubitat device driver.

I didn't read through the thread deeply and only just skimmed a couple of the ST device handler code offerings, but if it's just buttons and mains-powered switches, it shouldn't need to be a terribly complex device driver.

1 Like

This has a signature simular to the Iris Fob, I would try that driver with this device. After changing to that driver be sure to click the configure command.
The Iris Fob has a presence function, you will not likely not use this and it can be disabled in driver details.

You're right. I tried this last night. I had good progress. I can detect events for each button.

The only problem is the iris DH doesn't support release events, and the 3A switch toggles between an on and off state. blue light = off, red light = on.

So you get an event "Button 1 was held", but you can't detect when it was turned off. No other zigbee DH's for switches worked.

I also don't know if the switch supports commands to turn off/toggle the switches via zigbee. I suspect it does, would be very useful for mutiple interlinked switches. So the driver needs some more exploration.

Are the inbuilt DH code available for modification for custom drivers etc on github or similar?

We are going to release a few drivers that can be used as examples, but we will not be publishing all of them.

1 Like

Would I be able to request developer?!? access to a few examples to complete a DH set for the 3A products on the basis that the results would be available to you or via the community.

The other thing that I will mention is that there are maybe two brands of products that are approved for Australian Standards, have the global mark approval, work in 240v and work with the AS standard light switch fixture.

This is one of them. It's a big hurdle here - I'm keen to improve the local situation and options.

We don't have the likes of developer access, but I will post up a zigbee driver example.

Mike,

That would be super helpful.

Some example driver code posted here:

Did you get anywhere with a working driver for the 1, 2 and 3 gang switches from FeiBit/3A?

I have done the same, bought a cheap zigbee 4 button switch with the hope that I can replace some slow and unreliable IFTTT driven voice commands with just a button press.

I am new to both zigbee and Hubitat.

I have paired the switch to Hubitat successfully, none of the existing drivers are a match.
I tried a few of the recommended switch drivers without success so I figured I could just debug my way through a similar driver to make it work.

  1. I assume since the device is paired with the Hubitat hub, a button push on the zigbee device should push an event into the hub which ought to show up on the debug or event log for the device. The light on the switch flashes but I see no triggered event in Hubitat. Is there something special you need to do see the "raw" events? Surely zigbee doesn't require a regular "poll" to see if a button was pressed?

  2. The Hubitat driver provides a user interface where you can type in the button number and generate virtual button presses that do appear in the logs and events. Not sure why you would need to do this - testing?

  3. Can you fully test if a zigbee device/driver is working properly without hooking it up to a rule? i.e. If working you can see all the real world button presses in the debug/events right?

Is there a document or video someone can point me to for how to write new zigbee drivers from scratch, including troubleshooting? I feel like I am missing some crucial piece of information to get moving.

Many thanks,
M.

Here is the detail of the paired switch:

  • endpointId: 01
  • application: 41
  • manufacturer: _TZ3000_xabckq1v
  • model: TS004F
  • softwareBuild:
  • inClusters: 0000,0001,0003,0004,0006,1000
  • outClusters: 0019,000A,0003,0004,0005,0006,0008,1000
  • isMultiEP: false

The only raw messages I see in the logs are every three hours, like some kind of keep alive.

dev:22021-05-01 06:29:31.203 debugMessage Map: '[raw:5360010001082000201E, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0020, encoding:20, command:0A, value:1E, clusterInt:1, attrInt:32]'
dev:22021-05-01 06:29:31.155 debugparse(): 'read attr - raw: 5360010001082000201E, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, command: 0A, value: 1E'
dev:22021-05-01 03:20:51.951 debugMessage Map: '[raw:536001000108210020C8, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0021, encoding:20, command:0A, value:C8, clusterInt:1, attrInt:33]'
dev:22021-05-01 03:20:51.904 debugparse(): 'read attr - raw: 536001000108210020C8, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0021, encoding: 20, command: 0A, value: C8'
dev:22021-05-01 00:31:18.144 debugMessage Map: '[raw:5360010001082000201E, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0020, encoding:20, command:0A, value:1E, clusterInt:1, attrInt:32]'
dev:22021-05-01 00:31:18.098 debugparse(): 'read attr - raw: 5360010001082000201E, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, command: 0A, value: 1E'
dev:22021-04-30 21:27:37.221 debugMessage Map: '[raw:53600100000801002041, dni:5360, endpoint:01, cluster:0000, size:08, attrId:0001, encoding:20, command:0A, value:41, clusterInt:0, attrInt:1]'
dev:22021-04-30 21:27:37.174 debugparse(): 'read attr - raw: 53600100000801002041, dni: 5360, endpoint: 01, cluster: 0000, size: 08, attrId: 0001, encoding: 20, command: 0A, value: 41'
dev:22021-04-30 18:33:04.931 debugMessage Map: '[raw:5360010001082000201E, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0020, encoding:20, command:0A, value:1E, clusterInt:1, attrInt:32]'
dev:22021-04-30 18:33:04.884 debugparse(): 'read attr - raw: 5360010001082000201E, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, command: 0A, value: 1E'
dev:22021-04-30 12:34:51.379 debugMessage Map: '[raw:5360010001082000201E, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0020, encoding:20, command:0A, value:1E, clusterInt:1, attrInt:32]'
dev:22021-04-30 12:34:51.332 debugparse(): 'read attr - raw: 5360010001082000201E, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, command: 0A, value: 1E'
dev:22021-04-30 09:14:01.476 debugMessage Map: '[raw:536001000108210020C8, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0021, encoding:20, command:0A, value:C8, clusterInt:1, attrInt:33]'
dev:22021-04-30 09:14:01.429 debugparse(): 'read attr - raw: 536001000108210020C8, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0021, encoding: 20, command: 0A, value: C8'
dev:22021-04-30 06:36:37.512 debugMessage Map: '[raw:5360010001082000201E, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0020, encoding:20, command:0A, value:1E, clusterInt:1, attrInt:32]'
dev:22021-04-30 06:36:37.465 debugparse(): 'read attr - raw: 5360010001082000201E, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, command: 0A, value: 1E'
dev:22021-04-30 03:20:45.880 debugMessage Map: '[raw:53600100000801002041, dni:5360, endpoint:01, cluster:0000, size:08, attrId:0001, encoding:20, command:0A, value:41, clusterInt:0, attrInt:1]'
dev:22021-04-30 03:20:45.832 debugparse(): 'read attr - raw: 53600100000801002041, dni: 5360, endpoint: 01, cluster: 0000, size: 08, attrId: 0001, encoding: 20, command: 0A, value: 41'
dev:22021-04-30 00:38:23.937 debugMessage Map: '[raw:5360010001082000201E, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0020, encoding:20, command:0A, value:1E, clusterInt:1, attrInt:32]'
dev:22021-04-30 00:38:23.886 debugparse(): 'read attr - raw: 5360010001082000201E, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, command: 0A, value: 1E'
dev:22021-04-29 18:40:10.587 debugMessage Map: '[raw:5360010001082000201E, dni:5360, endpoint:01, cluster:0001, size:08, attrId:0020, encoding:20, command:0A, value:1E, clusterInt:1, attrInt:32]'
dev:22021-04-29 18:40:10.538 debugparse(): 'read attr - raw: 5360010001082000201E, dni: 5360, endpoint: 01, cluster: 0001, size: 08, attrId: 0020, encoding: 20, command: 0A, value: 1E'

@mr.murraybrandon I had some minor success using the same device with my old SmartThings hub.
Unfortunately, it does not work when directly paired to Hubitat hub.. :frowning:
The simple driver for SmartThings is here : https://raw.githubusercontent.com/kkossev/SmartThings/main/PoweredByTuyaTS004F.groovy
Then using HubConnect the 'Powered by Tuya' 4 buttons scene switch can be used in HE :

Unfortunately, only single press button events are registered even in ST... So no double-click and button hold events.. :frowning: And there is a small, but noticeable and annoying delay of about half of a second.

When the same driver is used in HE, the raw messages are different than these that are logged in ST. The raw data is the same as in your post, that makes it impossible to distinguish between different actions and different buttons. So seems like this device is using something non-standard in the Zigbee communication, that the SmartThings hub handles somehow (similar to ST handling IKEA switches), but the same workarounds are not available for HE.