-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
No transformation service available #128
Comments
Hello, i have the same issue.. Any ideas on why this is a problem? |
So I have looked into this issue. There is simply no compat delegator for the transformation service. But there is a Helper Class that should work without declarative services. |
Hello, |
I also have been looking in to this and it seems that this is OH 1.x vs OH2 compatibility issue.
So the serial binding with regex transformation will work for OH1 but won't for OH2 What to do now? Is it necessary to migrate the serial binding to OH2? |
Have you checked that a TransformationService is available from your Karaf console? I think the TransformationHelper class is the best solution. |
It won't ever be possible. Th interface types specified in osgi xml don't match.. |
The RegexTransformationService for OH2 implements interface org.eclipse.smarthome.core.transform.TransformationService. The RegexTransformationService for OH2 specified in serialBinding requires implementation of interface org.openhab.core.transform.TransformationService. Because there is no way of including org.eclipse.smarthome.core.transform.TransformationService in the OH1 addons and OH2 will never have org.openhab.core.transform.TransformationService regex implementation, you can't possibly have OH2 binding. There are multiple solution to this. I guess i would go for b) just to keep the code of serial binding at the same place for OH1/2.. Should i do this? |
Hm.. i also found out that the previous implementation with pattern matching was better because it could handle fast serial port updates. If the device sends the temperature twice fast you get a partial string e.g. With the old code you will match both 10deg and 11deg.. -> Values fine. It is also very unpredictable so hard to find the issue.. You can also in theory have a partial data (e.g. Tmp: 1) which will ignore everything completely.. So without definition of next data separator the serial binding is kinda useless |
So can we move back to the old way? I have some fast devices so I also run into this issue. How much time do you think it would take to fix the serial binding for openHAB2? |
Hm... i have a partial fix done locally but it just fixes the issue with TransactionService not available in OH2. I can create a pull request tomorrow but it won't fix the rapid command issue. Now what? |
@sipvoip are you experiencing message drops when using serial binding with regex and OH1? |
Ok i have been thinking about this for a while and i think i will have a good solution tomorrow. I will create a fix and a pull request asap (i also need this be in release soon) The fix will be following:
This way the code will be able to parse multiple commands as the old version and won't depend on the transformation service and OH version. It also won't break compability with regex syntax. I think that the transformations are meant to be used in rules only so there should be no issue from architectural point of view. Binding depending on another component that has to be installed manually can only lead to confusion |
Implemented, just need to wait for the this pull request to be merged so i can create a branch for the fix. It will work according to the new RegexTransformationService described here I will let you know when there will be official branch.. |
Is there a .jar I can try? |
not yet |
I still have a bit trouble with the repeating patterns (or fast commands).. The RegexTransformation uses ^REGEX_PATTERN$ with DOTAL to find the group.. that is fine if you want to extract number from simple string like "Temp: 10\n"... but if you get two responses it looks like "Temp: 10\nTemp: 10\n".. the pattern match just wont match the string because the ^ and $ and DOTAL means that the whole string has to be matched in order to get the group... so in that case the whole received string gets ignored. Could anyone help with this? I would post sniplets of code so you could see what's going on |
What does DOTAL mean? Never heard of it before. If you're implementing a new/pseudo transformation service, you should be able to use whatever pattern works; no need to stick with the one you're quoting, is there? |
A great explanation can be found (here) [ http://docs.oracle.com/javase/tutorial/essential/regex/pattern.html] ... The new REGEX matcher has to comply with the existing functionality so we don't break the config files of everybody that uses it. |
Yes, but remember it's the output from the transformation that matters. How that output is produced doesn't. |
Hello, anyone tried the provided JAR? |
No, sorry but I not use this binding anymore. |
Okay.. the fix was merged.. you can expect this working in next release... until the you can use the provided jar... Thanks everyone for your support. |
So if I get it right, this issue here can be closed. Thanks @marekhalmo for dealing with it in the serial binding! |
@kaikreuzer glad i could help :) |
Related PRs: * eclipse-archived/smarthome#2412 * openhab/openhab-distro#317 Signed-off-by: John Cocula <john@cocula.com>
Found an issue when migrating to openHAB 2, it looks like transformation are not working at least with the serial binding. I think it has to do with 1x compatibility layer because it works fine in 1.8.3.
Item:
Number Septic_Level_Sensor {serial="/dev/ttyPort3,REGEX(.?([0-9]+).)"}
Seeing:
2017-02-25 16:28:10.896 [ERROR] [binding.serial.internal.SerialDevice] - No transformation service available!
I have REGEX transform installed according to paper.
The text was updated successfully, but these errors were encountered: