Harmony binding works with OH2?

Hi Folks,

danielwalters86 wrote

So i have an issue with this:

EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/Harmony_Activity_choose] | {org.osgi.service.event.EventHandler}={event.topics=openhab/command/, service.pid=org.openhab.harmonyhub, password=, host=10.7.2.40, component.name=org.openhab.binding.harmonyhub.binding, component.id=214, username=*, service.id=337, service.bundleid=167, service.scope=bundle} | Bundle(org.openhab.binding.harmonyhub_1.7.0 [167])]
java.lang.IllegalStateException: Harmony Hub Gateway is not properly configured, or the connection is not yet started

What I’ve done, ist copied all harmonybindings in addons

root@smarthome:/usr/share/openhab2/addons# ls -la harmony
-rw-r–r-- 1 root root 6744 Jan 31 13:52 org.openhab.action.harmonyhub-1.7.0.jar
-rw-r–r-- 1 root root 17167 Jan 31 13:52 org.openhab.binding.harmonyhub-1.7.0.jar
-rw-r–r-- 1 root root 4388670 Jan 31 13:52 org.openhab.io.harmonyhub-1.7.0.jar

root@smarthome:/usr/share/openhab2/conf/services# cat harmony.cfg
####### Harmony Hub Binding #####################################
harmonyhub:host=10.7.2.40
harmonyhub:username=********
harmonyhub:password=********

So what ist wrong? In 1.7 it works fine. ;.-)

Have fun
Stefan

That was posted before OH2 beta which seems to have causes a few issues/broken some things.

However, why are you using the old versions instead of the 1.8 or even 1.9 snapshots? Try using up-to-date versions as that may solve your troubles, let us know if that doesn’t work.

Just a FYI, I have the OH2 port almost ready to go,
https://github.com/openhab/openhab2-addons/pull/639 I expect to have a few
more changes before it gets included, but its mostly working. I’ll try and
get something posted soon.

On Sun, Jan 31, 2016 at 8:55 AM Daniel Walters bot@community.openhab.org wrote:

danielwalters86 https://community.openhab.org/users/danielwalters86 Daniel
Walters https://community.openhab.org/users/danielwalters86
January 31

That was posted before OH2 beta which seems to have causes a few
issues/broken some things.

However, why are you using the old versions instead of the 1.8 or even 1.9
snapshots? Try using up-to-date versions as that may solve your troubles,
let us know if that doesn’t work.

Visit Topic
https://community.openhab.org/t/harmony-binding-works-with-oh2/6986/2
or reply to this email to respond.

To stop receiving notifications for this particular topic, click here
https://community.openhab.org/t/harmony-binding-works-with-oh2/6986/unsubscribe.
To unsubscribe from these emails, change your user preferences
https://community.openhab.org/my/preferences


Sent from my mobile.

I built the OH2 harmony hub addon from src about 1.5 weeks ago, seems to be working well so far :slight_smile:

Sounds great, and I promise that I will review it soon then!

Any update here? Would love to get this working!

@danielwalters86, would you mind either linking me someplace to learn how to build the bindings from their source, or give me a brief overview on it? I’m a little hazy on it.

I just uploaded the latest here
https://github.com/digitaldan/openhab2-addons/releases/download/1.0/org.openhab.binding.harmonyhub-2.0.0-SNAPSHOT.jar

make sure to read the readme here

Awesome! Coming back to see this way too late haha. Gonna try this tonight. I got some rad IR flameless candles that I want to link up with my hue lights.

Does anyone have some examples of accessing the auto generated harmony things/items from rules? I am trying to get this working with the echo/hue emulator binding…

My current approach is to use a proxy item associated with the echo to trigger a rule that then send the string to the harmony hub or device. I can watch the string update in the thing area within habmin, but no action occurs. I have tried sendCommand and postUpdate. I believe a “button push” uses sendCommand, so i assume that is the correct one to use based upon the binding examples showing a sitemap with switch items utilized as button pushes.

Any help or examples would be appreciated.

-tp

Could you post your rules and items if possible? It’s hard to see the issue without them.

1 Like

Before i post my sorry attempt, would be willing to show some of your working examples? Do you have sitemap and rules setup to work with your autogenerated things/items for harmony hub?

I dont want to waste your time troubleshooting my ignorant attempt, with some examples, i am sure i could work it out.

Thanks for the time,
-tp

Got it working. Sorry for the hassle. Thanks for the binding!

-tp

Hello,

I’m pulling my hair out with the Harmony Binding. I’ve installed the binding using the paper UI, the “things” were found and added. I want to run an activity and wrote the Items and Sitemaps as I had it in OH1. (with the minor change in the items due to the channels). In the log, it says the change in state for the activity but then I run into to a “Unauthorized policy write haDevice denied” in the log.

13:23:43.107 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘Harmony_Activity’ received command ToggleBlinds
13:23:43.487 [WARN ] [rg.jivesoftware.smack.XMPPConnection] - Connection closed with error
net.whistlingfish.harmony.protocol.HarmonyProtocolException: Got error response [401.2]: Unauthorized policy write haDevice denied
at net.whistlingfish.harmony.protocol.OAReplyProvider.parseIQ(OAReplyProvider.java:61)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.util.PacketParserUtils.parseIQ(PacketParserUtils.java:440)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:170)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:47)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:81)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
13:23:48.115 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber ‘org.eclipse.smarthome.core.thing.internal.ThingManager@1a0d27a’ takes more than 5000ms.
13:23:48.115 [WARN ] [ome.core.thing.internal.ThingManager] - Handler for thing ‘harmonyhub:hub:HarmonyHub’ takes more than 5000ms for processing event
13:23:53.122 [WARN ] [ome.core.thing.internal.ThingManager] - Handler for thing ‘harmonyhub:hub:HarmonyHub’ takes more than 5000ms for processing event
13:24:13.116 [ERROR] [harmonyhub.handler.HarmonyHubHandler] - Could not start activity
java.lang.RuntimeException: Failed communicating with Harmony Hub
at net.whistlingfish.harmony.HarmonyClient.sendOAPacket(HarmonyClient.java:270)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.startActivity(HarmonyClient.java:368)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.startActivityByName(HarmonyClient.java:377)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.handleCommand(HarmonyHubHandler.java:97)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:371)[104:org.eclipse.smarthome.core.thing:0.8.0.b5]
at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:1)[104:org.eclipse.smarthome.core.thing:0.8.0.b5]
at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:170)[98:org.eclipse.smarthome.core:0.8.0.b5]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Caused by: org.jivesoftware.smack.SmackException$NoResponseException
at net.whistlingfish.harmony.HarmonyClient.getNextPacketSkipContinues(HarmonyClient.java:282)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.sendOAPacket(HarmonyClient.java:268)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
… 10 more
13:24:13.341 [WARN ] [rg.jivesoftware.smack.XMPPConnection] - Connection closed with error
net.whistlingfish.harmony.protocol.HarmonyProtocolException: Got error response [401.2]: Unauthorized policy write haDevice denied
at net.whistlingfish.harmony.protocol.OAReplyProvider.parseIQ(OAReplyProvider.java:61)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.util.PacketParserUtils.parseIQ(PacketParserUtils.java:440)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:170)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:47)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:81)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
13:24:32.537 [INFO ] [marthome.event.ItemStateChangedEvent] - Nest_last_connection changed from 2016-06-25T13:23:31.177+0000 to 2016-06-25T13:24:32.461+0000
13:24:37.703 [DEBUG] [overy.HarmonyHubDiscoveryParticipant] - StartScan called
13:24:37.712 [DEBUG] [onyhub.discovery.HarmonyHubDiscovery] - Creating Harmony server on port 44707
13:24:43.153 [ERROR] [harmonyhub.handler.HarmonyHubHandler] - Could not start activity
java.lang.RuntimeException: Failed communicating with Harmony Hub
at net.whistlingfish.harmony.HarmonyClient.sendOAPacket(HarmonyClient.java:270)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.startActivity(HarmonyClient.java:368)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.startActivityByName(HarmonyClient.java:377)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.handleCommand(HarmonyHubHandler.java:97)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:371)[104:org.eclipse.smarthome.core.thing:0.8.0.b5]
at org.eclipse.smarthome.core.thing.internal.ThingManager$2.call(ThingManager.java:1)[104:org.eclipse.smarthome.core.thing:0.8.0.b5]
at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:170)[98:org.eclipse.smarthome.core:0.8.0.b5]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Caused by: org.jivesoftware.smack.SmackException$NoResponseException
at net.whistlingfish.harmony.HarmonyClient.getNextPacketSkipContinues(HarmonyClient.java:282)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.sendOAPacket(HarmonyClient.java:268)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
… 10 more
13:24:43.153 [WARN ] [software.smack.tcp.XMPPTCPConnection] - notifyReconnection()
java.lang.RuntimeException: Failed communicating with Harmony Hub
at net.whistlingfish.harmony.HarmonyClient.sendOAPacket(HarmonyClient.java:270)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.sendOAPacket(HarmonyClient.java:259)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.getCurrentActivity(HarmonyClient.java:358)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient$1.reconnectionSuccessful(HarmonyClient.java:140)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.XMPPTCPConnection.notifyReconnection(XMPPTCPConnection.java:914)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:825)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:396)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at org.jivesoftware.smack.ReconnectionManager$2.run(ReconnectionManager.java:148)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
Caused by: org.jivesoftware.smack.SmackException$NotConnectedException
at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:584)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
at net.whistlingfish.harmony.HarmonyClient.sendOAPacket(HarmonyClient.java:267)[191:org.openhab.binding.harmonyhub:2.0.0.b3]
… 7 more

Would you mind posting how you got it to work with your working example?

It’s been a while, but i believe i setup the items in the hub first, and when i added the binding and discovered the hub, the additional items came with it (roku and tv).

I created proxy switch items to use with rules and the echo.
Switch eVolume "Level" ["Switchable"]

rule "TV Volume" when Item eVolume received update then if (eVolume.state == OFF) { sendCommand(harmonyhub_device_HarmonyHub_36462390_buttonPress, "VolumeDown") sendCommand(harmonyhub_device_HarmonyHub_36462390_buttonPress, "VolumeDown") } else if (eVolume.state == ON) { sendCommand(harmonyhub_device_HarmonyHub_36462390_buttonPress, "VolumeUp") sendCommand(harmonyhub_device_HarmonyHub_36462390_buttonPress, "VolumeUp") } end

Sadly, I, too, cannot get the binding to find anything.

Already tried with a totally clean snapshot setup with only the Harmony Hub binding installed (via PaperUI). Nothing. So I added the hub manually by using the name my Harmony App (on my phone) is using, which is working fine.

I only get the error that a hub with the name specified could not be found.

I worked this out. I didn’t know the binding was actually using other ports for the communication. Looking at the logs (debug) I recognized that the binding was starting a local Harmony server - and then I realized: I am using iptables to block all traffic except certain ports. Opening up all of them (for now) fixed this issue.

TLDR: Open up your ports, if you want the binding to discover anything!