Has anyone using this binding had any success using the activityStarting trigger? I’ve tried the sample rule found here to no avail.
All that seems to work is the currentActivity channel. I can’t get either the activityStarting or activityStarted triggers to work.
I’m guessing the channels may not be setting up correctly but I don’t know how to confirm that. I see no obvious errors in the log even with DEBUG mode turned on.
Yes, works fine, just tried it (did not even know this triggers exists).
29-Sep-2017 13:45:17.166 [INFO ] [org.eclipse.smarthome.model.script.EXTRA ] - HARMONY: Hub is going off...
29-Sep-2017 13:46:05.225 [INFO ] [org.eclipse.smarthome.model.script.EXTRA ] - HARMONY: TV is starting...
29-Sep-2017 13:46:27.084 [INFO ] [org.eclipse.smarthome.model.script.EXTRA ] - HARMONY: TV is started
29-Sep-2017 13:47:15.551 [INFO ] [org.eclipse.smarthome.model.script.EXTRA ] - HARMONY: Hub is going off...
rules:
rule "Starting TV"
when
Channel "harmonyhub:hub:HarmonyWZ:activityStarting" triggered TV_mit_Bose
then
logInfo("EXTRA", "HARMONY: TV is starting...")
end
rule "TV started"
when
Channel "harmonyhub:hub:HarmonyWZ:activityStarted" triggered TV_mit_Bose
then
logInfo("EXTRA", "HARMONY: TV is started")
end
rule "Going off"
when
Channel "harmonyhub:hub:HarmonyWZ:activityStarting" triggered PowerOff
then
logInfo("EXTRA", "HARMONY: Hub is going off...")
end
rule "Hub off"
when
Channel "harmonyhub:hub:HarmonyWZ:activityStarted" triggered PowerOff
then
logInfo("EXTRA", "HARMONY: Hub is off - no activity")
end
Note that if you have spaces in your Harmony sketch name you have to escape them with underscores:
TV mit Bose from Harmony hub becomes TV_mit_Bose in your rule.
I’m using the underscores and also testing with the basic rules as per the docs example.
Could you please check your HarmonyHub thing configuration screen and see if it matches mine? Are the two triggers just represented with the gray circled H or are they the blue circled “switch” like the currentActivity channel?
Did you do a bundle:list or a bundle:list |grep -i harmony on the karaf console to see if there are any old harmony bindings still installed?
You could also try feature:list|grep -i harmony, that should look like:
feature:list|grep -i harmony
openhab-binding-harmonyhub │ 2.2.0.SNAPSHOT │ x │ Started │ addons-2.2.0-SNAPSHOT │ Harmony Hub Binding
I tried the feature:list you recommended and received the same result as you.
I did stumble across an error in the log after I tried to rename the HarmonyHub thing to HarmonyMain. I get the following error in the log after saving the change:
2017-09-30 21:05:16.772 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred while calling thing updated at ThingHandler 'org.openhab.binding.harmonyhub.handler.HarmonyHubHandler@692c1f4': null
java.util.concurrent.TimeoutException: null
at java.util.concurrent.FutureTask.get(FutureTask.java:205) [?:?]
at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:194) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:83) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:67) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.core.thing.internal.ThingManager.thingUpdated(ThingManager.java:423) [105:org.eclipse.smarthome.core.thing:0.9.0.201709260841]
at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:217) [105:org.eclipse.smarthome.core.thing:0.9.0.201709260841]
at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:140) [105:org.eclipse.smarthome.core.thing:0.9.0.201709260841]
at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:1) [105:org.eclipse.smarthome.core.thing:0.9.0.201709260841]
at org.eclipse.smarthome.core.common.registry.AbstractRegistry.updated(AbstractRegistry.java:183) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.core.common.registry.AbstractRegistry.updated(AbstractRegistry.java:1) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:57) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutUpdatedElement(AbstractProvider.java:81) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.core.common.registry.AbstractManagedProvider.update(AbstractManagedProvider.java:126) [98:org.eclipse.smarthome.core:0.9.0.201709260841]
at org.eclipse.smarthome.io.rest.core.internal.thing.ThingResource.update(ThingResource.java:347) [115:org.eclipse.smarthome.io.rest.core:0.9.0.201709260841]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [15:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) [85:org.eclipse.jetty.servlet:9.3.14.v20161028]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [85:org.eclipse.jetty.servlet:9.3.14.v20161028]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [171:org.ops4j.pax.web.pax-web-jetty:6.0.6]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [82:org.eclipse.jetty.security:9.3.14.v20161028]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [171:org.ops4j.pax.web.pax-web-jetty:6.0.6]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [85:org.eclipse.jetty.servlet:9.3.14.v20161028]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [171:org.ops4j.pax.web.pax-web-jetty:6.0.6]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.server.Server.handle(Server.java:534) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [84:org.eclipse.jetty.server:9.3.14.v20161028]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [76:org.eclipse.jetty.io:9.3.14.v20161028]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [76:org.eclipse.jetty.io:9.3.14.v20161028]
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [76:org.eclipse.jetty.io:9.3.14.v20161028]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [87:org.eclipse.jetty.util:9.3.14.v20161028]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [87:org.eclipse.jetty.util:9.3.14.v20161028]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [87:org.eclipse.jetty.util:9.3.14.v20161028]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [87:org.eclipse.jetty.util:9.3.14.v20161028]
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [87:org.eclipse.jetty.util:9.3.14.v20161028]
at java.lang.Thread.run(Thread.java:748) [?:?]
Then I noticed the thing name is out of sync with the Channels in the PaperUI. The name is displayed as:
HarmonyHub HarmonyMain
while the channels still display:
Yes, that is a bit strange.
I have no idea what could cause this. Maybe a missing restart of OpenHAB after renaming?
Are you sure the renaming of things works for other bindings?
I would check/test that to make sure you don’t have a problem in your runtime setup.
Earlier today I tried setting up a new VM for a clean install of openHAB to see if I could get the Harmony Hub working but it experiences the exact same symptoms of my production VM. That should rule out any corruption of my openHAB setup.
My clean install was to a Debian 9 VM with the latest openhab2 snapshot. There are no other addons installed except for the Harmony binding. I also tried 3 different versions of java to see if it made any difference, which it doesn’t.
It exhibits the exact same behavior as my production VM which is Debian 8 with the lastest OH2 snapshot and zulu 8 java. I have many bindings installed.
13-Dez-2017 13:40:28.325 [INFO ] [org.eclipse.smarthome.model.script.EXTRA ] - HARMONY: TV is starting...
13-Dez-2017 13:40:49.698 [INFO ] [org.eclipse.smarthome.model.script.EXTRA ] - HARMONY: TV is started
Upgrade to the latest snapshot runtime (not only the binding) and do the setup according to the docs.
Still doesn’t work for me. I use the current snapshot every time I’ve attempted to install the binding. I’ve created at least 6 different VMs using different OS’s and java versions to no avail.
Every single time the triggers show up listed under Channels in PaperUI. I’m convinced that so long as they show up there they will not function properly. I can’t say why.
There was a version in between on my system where those channels did not show up, but they worked. Meanwhile (on #1119) they do show up always.
I remember reading somewhere when openHAB is not connected directly to the router where the hub is connected (for example the hub is connected through an access point) it could cause problems. But that is a long time ago. And I must admit that I have that case (harmony hub is connected through an access point).
Really sorry, I have no idea where you problem could be …