Adding support for Tuya ZS3L / TZ3000 / TS0043 / TS0042 / TS0041 to Zigbee Bindings

Hi @Sunshine,
is there a JAR available for OH3 that I could test ?
I’m currently starting my migration from 2.5.10 to OH3 and I would like to see how well it behaves there before I move.
@schalli is developing on oH2.5.10 guess this JAR would not work on OH3.

Regards
Thomas

Can I ask why someone doesn’t make a PR for this so that it is available to everyone rather than providing a patch? I can’t see any forks on GitHub, so I guess this is being developed privately only?

@chris, it’s on my list, especially now that everything seems to work fine.

I wanted to get your feedback first whether the approach I took is even going in the right direction.
Let me know and I’ll start a PR this week!

Thanks,
Daniel

1 Like

I’m not really sure what the approach is - is the source published somewhere? I did look on GitHub but didn’t find any recent forks that seemed to contain this - can you point me at it, and I’ll take a look.

@chris, here’s a draft PR:
Add Tuya button support by dschall · Pull Request #629 · openhab/org.openhab.binding.zigbee (github.com)

Just checked with my second switch. The ordering you have is correct. The first switch shipped with an error in the manual where the buttons where numbered differently.
No change required.

Thanks - I had a quick look, and in general I think it’s ok. I will have some comments, but so far the only issue I noted is some of the log statements aren’t the “standard” format I use which might screw some of the log processing (I know - picky!).

Generally though it looked like it fits in with the binding concept :+1:. Let me know when you’re happy with it and I’ll do a review to get it merged.

Hey @chris,

please take a look. I have added tests and I think the PR is ready.

Thanks,
Daniel

@chris , the PR is still sitting around.
Can you please merge or do you have comments?

Thanks,
Daniel

1 Like

Sorry - I’ve been very busy trying to move house - not easy in the current climate. I will look at this in a few weeks once things settle down (after the 19th).

Hi, do you plan to work on this PR for the upcoming release of OH3 ? (I guess it is not an high priority) I am just waiting with my tuya buttons on my desk :slight_smile:

Just some quick update, because it’s been so long:
I had stopped working on the Tuya switches because my Zigbee network seemed to become instable with them. I can’t really pin it on them, but my controller started resetting about once a week with these devices in the network, complaining about an unsupported ASH command received (or something, it’s been a while…).

I am planning to get myself another Zigbee stick to be able to work with the Tuya devices in an isolated environment, but so far I haven’t had the money to spend on that :slight_smile:

Hi! I wanted to try the patch but im a noob and I don’t know what to do with the downloaded file :slight_smile:

Hi @benjamin_lasserre,

welcome to the community!

If you want to try this patch, you’ll need to clone the project from github and check out my branch / PR:
Add Tuya button support by dschall · Pull Request #629 · openhab/org.openhab.binding.zigbee · GitHub
Then you need to compile it and upload the addon’s JAR files into your OH addons folder.

Alternatively, If you let me know what version of the bindings you are using, I can compile a version of the addon for you.

HTH,
Daniel

@schalli sorry - I missed that this PR is still open - apologies it slipped down (or off) my horizon. If you can resolve the conflicts then let’s try and get this reviewed and merged.

@chris , I rebased my changes on the laster master branch and fixed the build breaks.
I also removed the vendor filter from the Tuya devices, because they can be anything.
Filtering by modelId should be sufficient.

Please review (and merge).

Hi Daniel:

I compiled the zigbee binding with the merged additions for the scene controller.
It created a 3.4.0 snapshot .jar file
I am running openhab 3.3.0 and the 3.4.0 Snapshot binding gives an error and won’t load.
Unresolved-requirement import:package com.zsmartsystems.zigbee

Is it possible to create the .jar file for the 3.3.0 version of Openhab, and if yes, how?

Thank you
Carlos

Hey Carlos,

I’m not an expert on this and I wouldn’t recommend this approach, but have you tried updating the zigbee jar and the com.zmartsystems.* jars with missing dependencies?
Hopefully, that doesn’t create more missing dependencies.

Alternatively, what I would prefer, you can compile the project yourself and backport my change to the 3.3.0 branch. Then upload your compiled zigbee jars to your openhab addon folder.
The unchanged jars have the same version, so there should not be any missing dependencies with this approach.

Hey Clark, were you successful?
Just FYI, started playing with the Tuya buttons again, and I successfully backported, compiled, and uploaded the new jar to my OH test instance running 3.3.0.
It works, but there are a few bugs I need to take care of.
I’ll send out a PR soon.

Here’s a PR to address the duplicate transaction issue:
Add timestamp to duplicate command detection by dschall · Pull Request #783 · openhab/org.openhab.binding.zigbee (github.com)