UK Light switches – My experiences (2020)

Hi, I had exactly the same problem with the Yagusmart Single Switch - turned off after 2 minutes, in the SmartThings IDE it seems as if the device itself sends an “off” request to the hub. I thought it might be related to the absent capacitor (the leaflet in the box says there should be one in the box but there was none, so I installed it without a capacitor). It appeared as a “Thing” when I tried to connect it to the hub, I changed the handler to the Zigbee Switch and it started to turn off after 2 minutes. I tried Zigbee Switch Power - no success, then I read this thread and tried Zigbee Multi Switch Power - and finally it works, though I had to press the switch for 10 sec and search for this device in the SmartThings app again. Have no idea why it worked though - Zigbee Multi Switch Power seems to be a handler for a mains switch with a power meter, not for a single-gang light switch.

Interesting update:

it seems that what actually helps is pairing the device for the second time, no matter what handler is used.

And there’s another person with a similar problem: https://www.gitmemory.com/issue/zigpy/zha-device-handlers/535/715596185

Seems there’s something related to timer that turns the switch off.

1 Like

@DiMaroo thanks for the motivation. I tried a couple of more times and managed to get it working with Zigbee Multi Switch Power :slight_smile:

One thing though, when I turn on the physical switch, it doesn’t show as ON in Smartthings, however if I then turn it ON in ST, then turn it OFF, it turns it off. Its not end of the world, but would have been nice if it fully worked. Do you notice the same behaviour with your switch? Thanks.


Edit 1: please disregard my last comment, I just now reconnected the switch back to power (I had put it away as I bought it as an spare) and now it shows ON and OFF fine in ST, so it looks like a power cycle fixed it.

I must say, this new version switch does some really weird stuff! but at least we know how to get it working, PERSISTANCE is the key and try random stuff! :slight_smile:

Now that we know the workaround, I would like to understand what actually happens with the switch.

I tried to add the fingerprint of the device to my own device handler based on ZigBee Switch, so that the switch doesn’t identify itself as a “Thing” anymore:

// Yagusmart
    fingerprint profileId: "0104", inClusters: "0000, 0004, 0005, 0006", outClusters: "000A, 0019", manufacturer: "_TZ3000_9hpxg80k", model: "TS0011", deviceJoinName: "Yagusmart Light Switch"

And tried to debug what happens when the switch turns itself off. Here’s the raw message that I can see in the logs when the switch goes off:

9284a211-2f1b-4ffc-9bc8-d4c524109501 18:21:47: debug [raw:0104 0006 01 01 0000 00 B8A3 00 00 0000 0A 01 00001000014021000002402100000180300102803000, profileId:0104, clusterId:0006, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:B8A3, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:0A, direction:01, attrId:0000, encoding:10, value:00, isValidForDataType:true, unparsedData:[01, 40, 21, 00, 00, 02, 40, 21, 00, 00, 01, 80, 30, 01, 02, 80, 30, 00], additionalAttrs:[[attrId:4001, attrInt:16385, encoding:21, value:0000, isValidForDataType:true, consumedBytes:10], [attrId:4002, attrInt:16386, encoding:21, value:0000, isValidForDataType:true, consumedBytes:10], [attrId:8001, attrInt:32769, encoding:30, value:01, isValidForDataType:true, consumedBytes:8], [attrId:8002, attrInt:32770, encoding:30, value:00, isValidForDataType:true, consumedBytes:8]], data:[00, 00, 10, 00, 01, 40, 21, 00, 00, 02, 40, 21, 00, 00, 01, 80, 30, 01, 02, 80, 30, 00], clusterInt:6, attrInt:0, commandInt:10]
9284a211-2f1b-4ffc-9bc8-d4c524109501 18:21:47: debug description is catchall: 0104 0006 01 01 0000 00 B8A3 00 00 0000 0A 01 00001000014021000002402100000180300102803000

As we can see, after ~120 sec the switch sends an Attribute Report (0x0A) command (direction = 0x01, which means it’s the server sends a command to the client, in this case, the switch sends the command to the Hub). It reports itself as turned off (attrId=0000, value=0), says there’s no On timeout (attrId=0x4001, value=0) and no OffWaitTIme (attrId=0x4001, value=0). Then there are two attributes which I don’t know (0x8001 with value=1 and 0x8002 with value=0). So apparently it’s not a Hub which turns the light off, it’s the switch itself which turns off.

But when you press the switch manually to turn it off, there’s another command:

9284a211-2f1b-4ffc-9bc8-d4c524109501 19:31:45: debug [raw:0104 0006 01 01 0000 00 B8A3 00 00 0000 0A 01 00001000, profileId:0104, clusterId:0006, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:B8A3, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:0A, direction:01, attrId:0000, encoding:10, value:00, isValidForDataType:true, data:[00, 00, 10, 00], clusterInt:6, attrInt:0, commandInt:10]
9284a211-2f1b-4ffc-9bc8-d4c524109501 19:31:45: debug description is catchall: 0104 0006 01 01 0000 00 B8A3 00 00 0000 0A 01 00001000

Here there are no additional parameters apart from just 0x00 with value=0.

Not sure how it can be used to prevent the switch from turning off, and moreover, not sure why the switch works with the Zigbee Multi Switch Power device handler. Will continue my investigations. If anyone knows the Zigbee specification and can help - it will be much appreciated.

And I forgot to mention that exactly at the same time when the switch turns off, there’s an event in the hub log:

zbjoin: {"dni":"B8A3","d":"BC33ACFFFEFE2D2D","capabilities":"80","endpoints":[{"simple":"01 0104 0100 01 04 0000 0004 0005 0006 02 0019 000A","application":"41","manufacturer":"_TZ3000_9hpxg80k","model":"TS0011"}],"parent":"0000","joinType":0,"joinDurationMs":1506,"joinAttempts":1}

Maybe this is related somehow

1 Like

Not sure if you made any more progress on this, but I have exactly the same issue with a couple of 2 gang and a single gang Yagusmart switches. Strangely a 3 gang bought at the same time works without the 2 min issue.

In any case, I had am a complete noob with ST, however I had a look at the default DH for multi-switch to try and compare to the multi switch power. I noticed at the bottom there was an entry for a Orvibo switch to disable a 2 min heart beat. It sounded interesting so I copied my manufacturer ID (_TZ3000_fvh3pjaz) in instead of Orvibo and published the DH - and it works! Or at least seems to, created switch and child switch for my 2 gang and it has been on for 30 mins now without problem.

I am going to try this now with the single gang and also the other 2 gang and confirm.

Mark you saved me from returning the switch, I thought it was broken! using the device type ZeeBee Multi Switch Power worked like a charm, no issues with my automations also!

Let’s tag @tpmanley and @BroderickCarlin, they might have some idea why this specific switch does this and what could be a workaround in a DH.

I can confirm that modifying the zigbee multi switch DH to make use of the entry at the bottom specifically for Orvibo devices and changing the manufacturer ID from “Orvibo” to the one for the Yagusmart switch (in my case “_TZ3000_fvh3pjaz”) works. It has been good for 24hrs now. The section in the DH refers to a 2 min heartbeat for Orvibo devices, it would seem to be the same for Yagusmart.

2 Likes

Looking to get my first ‘smart switch’ for a normal/‘dumb’ light and looks like Yagusmart seems to be the one of choice (please correct me if you think another would be better).

I’m only looking to purchase 1 gang (don’t see why I’d need any more gangs?!), as that will suffice, however, what is the difference between 1 Gang and 1 Gang WiFi? Link here and see screenshot;

At the same time, are they also relatively simple to set-up, or require custom controllers etc.?

1 gang has zigbee connection, while 1 gang wifi has wifi connection.
For smartthings you should choose the zigbee one.
This device should work with the standard zigbee switch dh…

1 Like

Thanks @blashman!

Hi @predshaw,

this is a very good news.
Could you please, add a copy of your dh, so we can clearly see the needed changes?

Thanks in advance!

1 Like

Hi @predshaw
You couldn’t fill me in on how you were able to see the code for the Zigbee multi switch device handler? I can select it for a device in the ide but cannot find it in the examples menu for creating a new device handler. Can I view default device handler code elsewhere?

You can download most of the device handlers from the SmartThings Github

You can either integrate the Github (bit of a pain) or just save the hander to a text file then copy and paste in by selecting ‘create from code’ in the IDE

2 Likes

As siwilson says, I found the code at the github and then copied and pasted it in, modified it a bit to work with my Yagusmart switch and then created the new DH.

1 Like

blahman, I know the DH code can be tidied up a lot but the only change I made is:

private Boolean isOrvibo() {
device.getDataValue(“manufacturer”) == “_TZ3000_fvh3pjaz”
}

It’s line 235 of the standard zigbee multi switch DH. By default the manufacturer on this line is obviously “Orvibo” but I replaced it with yagusmart manufacturer ID of “_TZ3000_fvh3pjaz”.

If you need I can paste in the whole code for reference.

For single gang, I had to delete chunks of the code that related to Child switches, else it would create ghost switches that didn’t exist.

Interestingly, my 3 gang Yagusmart switch works using the 3A Zigbee Switch DH. I am sure it could be made to work using the modified multi switch DH, by default it only creates one child but am sure it would be easy to make it do both childs, but I never needed to so never tried it.

Thank you very much!
I finally understood the change made and it’s working fantastically.
I would add that adding your manufacturer ID and model on line 37, your device will be recognized perfectly when asking Smartthings to look for new devices.

Single Switch should work out-of-the-box with the stock Zigbee Switch from Smartthings.
The 3 gang with should also work with the method you found, just by changing the manufacturer ID.