Satel - satelIsConnected()

Hi,

I create a rule (satel.rules)

import org.openhab.core.library.types.*
import org.openhab.core.types.Command
import org.openhab.core.types.*
import org.openhab.core.items.GenericItem
import java.util.Date
import org.openhab.binding.satel

val String RFN = "satel.rules"
  
//--------------------------------------
rule "Switch ogrod on"
when
    Item DuskStart_Event received update ON
then
//if (satelIsConnected()) {
  logInfo(RFN, "Ogrod ON: Start")
  sendCommand("sat_out24_ogrod", "ON")
  logInfo(RFN, "Ogrod ON: End")
//}
end

If I uncomment function “satelIsConnected()” I get following error:

2016-12-03 16:36:35.780 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ‘Switch ogrod on TEST’: An error occured during the script execution: The name ‘satelIsConnected()’ cannot be resolved to an item or type.

I wonder if I am doing something wrong?

I use opebhab2 offline beta4 with:

openhab> bundle:list | grep -i sate
194 | Active    |  80 | 1.9.0.b4              | openHAB Satel Binding

Are you coming from OH 1.8? If so, when you installed the Satel binding did you have to install the Satel Actions as a separate jar file?

The error looks like the Actions (i.e. the satel functions you call from Rules) are not included with the binding. I do not see a Satel Actions add-on listed in PaperUI.

What you might need to do is download the latest add-ons from here, and follow the instructions here to add the missing org.openhab.action.satel-1.9.0-SNAPSHOT.jar file to openHAB 2.0.

Come back here and let us know if it works so the Action can be added to the distro.

No, its fresh installation of OH2 from repo on ubuntu. Like you said there is no satel actions add-on listed in extensions->actions in PaperUI.

I run compatibility layer:

openhab> feature:start openhab-runtime-compat1x
openhab> bundle:list | grep -i compat
193 | Active    |  80 | 2.0.0.b4              | openHAB 1.x Compatibility Layer

I PaperUI I switch ON “Include Legacy 1.x Bindings” in configuration->system.

I try to upload JAR from OH1. But with no success:

==> /var/log/openhab2/openhab.log <==
2016-12-07 15:40:44.446 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] doFindMethod: Suitable but non-accessible method found in class org.openhab.action.satel.internal.SatelActionService
2016-12-07 15:40:44.447 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] findMethod: Suitable but non-accessible method setSatelCommModule found in class org.openhab.action.satel.internal.SatelActionService, subclass of org.openhab.action.satel.internal.SatelActionService
2016-12-07 15:40:44.448 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] bind method [setSatelCommModule] not found; Component will fail
2016-12-07 15:40:44.448 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] bind method [setSatelCommModule] not found

What do you mean by “I try to upload JAR”?

You put the action jar file (NOT the binding jar file) into addons? Or did you try something else?

Hi,

I download:

wget https://openhab.ci.cloudbees.com/job/openHAB1-Addons/lastSuccessfulBuild/artifact/bundles/action/org.openhab.action.satel/*zip*/org.openhab.action.satel.zip

and copy jar:

root@atom:~/org.openhab.action.satel/target# ls
org.openhab.action.satel-1.9.0-SNAPSHOT.jar

into directory:

/usr/share/openhab2/addons/

Do you see anything in the log when OH starts at least talking about it loading the Action?

Is the satel binding installed as well? Often the Action add-on is dependent upon the Binding jar. It is also possible that the compatibility layer Action cannot access the bundle installed Binding.

So try uninstalling the Satel binding and instead put a copy of the jar file from the same zip you got the Action jar file into the addons folder.

I would help, but I have no idea if OH1 actions work in OH2. I tested binding addon only and it worked well.
From the log it seems satel action does not see the binding module, so either it is not installed or maybe not in the right way. The last case is that it is not compatible with OH2.

They do.

I’ve tested OH 1.x Action/Binding combos (i.e. Actions that also require the Binding to work) in OH 2. However for the one I tested I put both the 1.9 binding jars into the addons folder. I believe @majherek installed the binding through PaperUI and only put the action jar in addons. This might be the root of the problem which is why I suggested to uninstall the binding and put both jar files into addons.

Hi druciak,

Binding addon in version 1.9.0.b4 works well in OH2.

196 | Active | 80 | 1.9.0.b4 | openHAB Satel Binding

But in OH2 offline distribution for ubuntu there is no action binding for satel. When I copy

org.openhab.action.satel-1.9.0-SNAPSHOT.jar

into OH2 addon directory

/usr/share/openhab2/addons/

OH2 try to deploy it, and following error appear in log:

2016-12-07 15:40:44.446 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] doFindMethod: Suitable but non-accessible method found in class org.openhab.action.satel.internal.SatelActionService
2016-12-07 15:40:44.447 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] findMethod: Suitable but non-accessible method setSatelCommModule found in class org.openhab.action.satel.internal.SatelActionService, subclass of org.openhab.action.satel.internal.SatelActionService
2016-12-07 15:40:44.448 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] bind method [setSatelCommModule] not found; Component will fail
2016-12-07 15:40:44.448 [ERROR] [org.openhab.action.satel            ] - [org.openhab.action.satel.action(197)] bind method [setSatelCommModule] not found

Now I remove (physically)

majherek@atom:/usr/share/openhab2$ sudo mv ./runtime/karaf/system/org/openhab/binding/org.openhab.binding.satel/1.9.0.b4/org.openhab.binding.satel-1.9.0.b4.jar ~/
majherek@atom:/usr/share/openhab2$ sudo mv ./runtime/karaf/system/org/openhab/addons/openhab-addons-external/1.9.0.b4/openhab-addons-external-1.9.0.b4-satel.cfg ~/

And put satel addons in version 1.9.0 into OH2.

majherek@atom:/usr/share/openhab2$ find -iname "*satel*"
./addons/org.openhab.action.satel-1.9.0-SNAPSHOT.jar
./addons/org.openhab.binding.satel-1.9.0-SNAPSHOT.jar

openhab> feature:list  | grep sat
openhab-binding-satel                     | 1.9.0.b4         |          | Uninstalled | openhab-aggregate-xml   | Satel Binding

openhab> bundle:list |grep -i sate
206 | Installed |  80 | 1.9.0.201612051712    | openHAB Satel Action
207 | Installed |  80 | 1.9.0.201612051712    | openHAB Satel Binding
openhab> bundle:start 206
Error executing command: Error executing command on bundles:
        Error starting bundle206: Could not resolve module: org.openhab.action.satel [206]
  Unresolved requirement: Import-Package: org.openhab.binding.satel
    -> Export-Package: org.openhab.binding.satel; bundle-symbolic-name="org.openhab.binding.satel"; bundle-version="1.9.0.201612051712"; version="0.0.0"
       org.openhab.binding.satel [207]
         Unresolved requirement: Import-Package: gnu.io

openhab> bundle:start 207
Error executing command: Error executing command on bundles:
        Error starting bundle207: Could not resolve module: org.openhab.binding.satel [207]
  Unresolved requirement: Import-Package: gnu.io

In error log is similar:

2016-12-08 22:38:28.576 [ERROR] [org.openhab.action.satel            ] - FrameworkEvent ERROR - org.openhab.action.satel
org.osgi.framework.BundleException: Could not resolve module: org.openhab.action.satel [206]
  Unresolved requirement: Import-Package: org.openhab.binding.satel
    -> Export-Package: org.openhab.binding.satel; bundle-symbolic-name="org.openhab.binding.satel"; bundle-version="1.9.0.201612051712"; version="0.0.0"
       org.openhab.binding.satel [207]
         Unresolved requirement: Import-Package: gnu.io

        at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
2016-12-08 22:33:51.669 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.satel-1.9.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.satel [207]
  Unresolved requirement: Import-Package: gnu.io
    at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245)[8:org.apache.felix.fileinstall:3.5.0]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217)[8:org.apache.felix.fileinstall:3.5.0]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509)[8:org.apache.felix.fileinstall:3.5.0]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[8:org.apache.felix.fileinstall:3.5.0]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[8:org.apache.felix.fileinstall:3.5.0]
2016-12-08 22:33:51.671 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.action.satel-1.9.0-SNA
PSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.action.satel [206]
  Unresolved requirement: Import-Package: org.openhab.binding.satel
    -> Export-Package: org.openhab.binding.satel; bundle-symbolic-name="org.openhab.binding.satel"; bundle-version="1.9.0.201612051712"; version="0.0.0"
       org.openhab.binding.satel [207]
         Unresolved requirement: Import-Package: gnu.io

        at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245)[8:org.apache.felix.fileinstall:3.5.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217)[8:org.apache.felix.fileinstall:3.5.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509)[8:org.apache.felix.fileinstall:3.5.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[8:org.apache.felix.fileinstall:3.5.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[8:org.apache.felix.fileinstall:3.5.0]

Maybe I am doing something wrong…

Who made binding in version 1.9.0.b4?

I am not OH2 expert, but from the logs it seems that there is a problem with one dependency: gnu.io. Not sure how can you solve it, definitely we need someone who knows OH2 very well.

I will try to install openhab2-online installation, and I will put only those extentions, which I need -> and I will install satel binding and action extension from internet.

I will be back after weekend, I think, when I try fresh installation of OH2.

I just did a quick test and for sure you need 2 additional OH2 features: openhab-transport-serial and openhab-runtime-compat1x. Install them from Karaf shell and let me know if it helped.

Ok, it seems I got to point described by you in your second post. I am also getting “[setSatelCommModule] not found; Component will fail” in the log.
It seems your original configuration was OK, but something indeed is wrong with the action bundle. Will try to investigate…

I think I solved the issue with this PR: https://github.com/openhab/openhab/pull/4882. Once it is merged you can download action bundle binary from cloubees and test it. I did some tests on latest beta4 and it worked well.
Let me know if it works for you as well. Once you confirm, I will add Satel Action to OH2 compatible features.

Merged; thanks @druciak!

Hi,

I confirm: everythink is working now. And no errors in log using satelIsConnected().

Thank you, @watou :slight_smile:

1 Like