Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Tuya into separate bundle #675

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cdjackson
Copy link
Contributor

@cdjackson cdjackson commented Sep 25, 2021

@dschall - firstly, sorry this has taken so long. The past few months have been a bit hectic moving around the world, selling and buying houses, and changing jobs etc, all with the world in a mess.

I've refactored your PR into a separate bundle. Maybe you can take a look to see if it works as I can't really test.

Thanks

Intended to replace #629

Signed-off-by: Chris Jackson [email protected] (+4 squashed commits)
Squashed commits:
[8c397c9] Add tests for ZigBeeConverterTuyaButton

Signed-off-by: Daniel Schall [email protected]
[d68a96a] Fix build break

Signed-off-by: Daniel Schall [email protected]
[9a37f0e] Add Tuya button support

Signed-off-by: Daniel Schall [email protected]
[af45e77] Create Tuya specific handler binding

Signed-off-by: Chris Jackson [email protected]

@cdjackson cdjackson added this to the 3.2 milestone Sep 25, 2021
@cz6ace
Copy link

cz6ace commented Oct 21, 2021

Hello @cdjackson,
I'm interested in this PR to be merged into the main OH3 release. I can do a real test as I have Tuya switches (one 3-button type). Is there obvious reason it won't work in OH 3.1?

Thank you,
Libor

@cdjackson
Copy link
Contributor Author

Thanks @cz6ace

Is there obvious reason it won't work in OH 3.1?

No - I don't think so. If you take this bundle and drop it in your addons folder, I think it ought to work. Let me make one more small change to move the channel definition into the Tuya binding otherwise you'd need to also update the main zigbee binding and this should be better decoupled (I just missed that earlier).

@cdjackson
Copy link
Contributor Author

I've now moved the channel definition into the separate Tuya bundle, so once CI completes this should work as a standalone bundle.

I've also rebased on the current master.

@cz6ace
Copy link

cz6ace commented Oct 24, 2021

Hello Chris,

thank you. I do not know so once CI completes exactly means - merging into the main branch?

I tried the updated version, copied the thuya into /usr/share/openhab/addons folder and there is an dependency error:
2021-10-24 11:23:03.154 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.zigbee.tuya-3.2.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zigbee.tuya [303] Unresolved requirement: Import-Package: org.openhab.binding.zigbee.internal

I looked into the 3.1.0 karaf into the zigbee bundle, the package is there, but probably issue will be the meta information in the manifests.
Don't waste your time, it might be 3.1.0 and 3.2.0 incompatibility, I'll try another computer, install there 3.2.0 and will play with it in the sandbox.

@cdjackson
Copy link
Contributor Author

I would hazard a guess that the issue is the library version since it was updated recently. It should be ok in 3.2 if you do a clean install of the snapshot so please let me know how you go.

@cdjackson
Copy link
Contributor Author

In case anyone is testing this, I suspect it doesn't work at the moment. I'm currently doing a larger refactoring to support more complex customisation (initially to support the Tuya roller blinds) and as I have one of these I will be able to do some general level of testing.

Hopefully I'll have something further to test on this in the next week or two.

@cz6ace
Copy link

cz6ace commented Nov 10, 2021

Hello Chris,

after a pause (need to solve issue with homematic & heating system after migration to a new control unit) I tried brand new install from the snapshot:

$ cat /etc/apt/sources.list.d/openhab.list
deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg unstable main

$ apt show openhab
Package: openhab
Version: 3.2.0~S2554-1
Priority: optional
Section: java
Source: openhab
...

still, after copying the Tuya bundle:
cp org.openhab.binding.zigbee.tuya/target/org.openhab.binding.zigbee.tuya-3.2.0-SNAPSHOT.jar /usr/share/openhab/addons/

I can see the same error:

2021-11-11 00:05:23.924 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.zigbee.tuya-3.2.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zigbee.tuya [267]
  Unresolved requirement: Import-Package: org.openhab.binding.zigbee.internal

        at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.300.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.16.300.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.7.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.7.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.7.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.7.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.7.0]

What are the correct steps to install the new bundle? Or should I copy other bundles into addons?

@cdjackson
Copy link
Contributor Author

As I posted above, this will not work at the moment. I'm currently refactoring this further to resolve this.

Signed-off-by: Chris Jackson <[email protected]> (+4 squashed commits)
Squashed commits:
[8c397c9] Add tests for ZigBeeConverterTuyaButton

Signed-off-by: Daniel Schall <[email protected]>
[d68a96a] Fix build break

Signed-off-by: Daniel Schall <[email protected]>
[9a37f0e] Add Tuya button support

Signed-off-by: Daniel Schall <[email protected]>
[af45e77] Create Tuya specific handler binding

Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
@jflalande
Copy link

Dear all,
I found this PR after reading the original thread where the patch was proposed. I am also facing the problem of "Unknown command 253" for a 3 buttons scene Switch (Moes) which maybe would be considered as a tuya device. So I guess the patch would solve the issue, as far as I understand.
I can try the new tuya bundle if required, as I just deployed OH3 3.3.0~S2656-1. But I not really know if Chris has finished his refactoring and where to find it.
And finally... Happy Christmas !

@cz6ace
Copy link

cz6ace commented Jan 9, 2022

@jflalande , Hi, I am afraid it is not fully refactored yet. Now it is not even compilable.

[INFO] Reactor Summary for openHAB Add-ons :: Bundles :: ZigBee Reactor 3.2.0-SNAPSHOT:
[INFO]
[INFO] openHAB Add-ons :: Bundles :: ZigBee Reactor ....... SUCCESS [  2.061 s]
[INFO] openHAB Add-ons :: Bundles :: ZigBee Binding ....... FAILURE [  8.282 s]
[INFO] openHAB Add-ons :: Bundles :: ZigBee Serial Driver . SKIPPED

@cz6ace
Copy link

cz6ace commented May 1, 2022

Hi @cdjackson ,

is this pull request abandoned or do you plan to work on it in the future?

Thx,
libor

@cdjackson
Copy link
Contributor Author

cdjackson commented May 1, 2022 via email

@cz6ace
Copy link

cz6ace commented May 1, 2022

It is not abandoned, but I have had a lot of other things going on over the past few months and this has unfortunately dropped down the priority list.

Tell me about it, I'm glad that it is still on the list ;-) No stress.

@cdjackson cdjackson modified the milestones: 3.3, 3.4 Jun 24, 2022
@kaikreuzer kaikreuzer removed this from the 3.4 milestone Dec 19, 2022
@cz6ace
Copy link

cz6ace commented Apr 17, 2023

Hi, is it dead now? If not, do you remember what has to be done to finish this and can someone else help with this? I'd like to help, but I'm afraid I'll need few initial hints where to start and where to look for some docs.

@jflalande
Copy link

Hi, same here. I can test, but for now I understand that this specific bundle is not finished yet. Just found my MOES 3 tuya button, changed the battery, and I still see that openhab complains about the 253 command in the zigbee logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants