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.
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.
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.
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.
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
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]
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.