Harmony Hub Integration

Ah! ok ill look into that. Was it when you saved the device handler ? Or is it in a log somewhere?

Open your log page in another tab when trying to create the devices.

Let me know if thatā€™s the case and Iā€™ll update the git repo. Maybe I didnā€™t commit my changes. I know this worked for me.

@Keo

I just confirmed it. The app code calls for
at line 99 in the app

section("") {
                app( name: "harmonyDevices", title: "Add a device...", appName: "KuKu Harmony", namespace: "turlvo", multiple: true, uninstall: false)
        } 

in the drive code

definition (name: "Hubitat Harmony_Default", namespace: "keo", author: "Keo") {

I believe I just changed the line in the driver to read turlvo and everything installed smooth.

trying to read the thread -- if I am reading things right, this setup requires ST? Bummer
mine is currently a paperweight :slight_smile:

1 Like

You just need the ST to Harmony Integration, which is cloud to cloud. I am not sure you even need the ST Hub powered on for that to work. Once you have it set up, you can borrow the Auth Keys to paste into Hubitat. You will then end up with Hubitat to Harmony (Hub to Cloud) which has been working very well for me for months now.

My original Hubitat integration, posted above, was 100% local. It required the harmony-api node.js server running in your house to serve as a bridge to the Harmony hub over the LAN. This worked fairly well, but myself and others noticed the Harmony hub was sometimes sluggish, probably due to the excessive polling by the harmony-api node.js server.

2 Likes

:point_up_2:
I have had my ST hub unplugged for weeks and the Auth key works fine for Hubitat. I also had the sluggish hub issue @ogiewon mentioned with the harmony-api, which is why I went this route.

Works great for me.

3 Likes

All working !!

@mattw so to bother you with another question. However, it seems the "all off" switch that you added to the hub driver is actually addressing all the hubs on the account. If I activate the "all off" switch on either of my hubs both of them shutoff all current activities. I don't think this is the intended result?

I am seeing the same issue as @halfrican.ak . If I use the hubitat alexa skill to turn off my bedroom TV the one downstairs goes off.

It looks like I mistook alloff as ending any activity on the hub and overlooked the activityoff command. I modified the driver to call this method instead which works on my single hub. It seems like it should fix it for multiple hubs. I committed the change on Github.

Also, @bravenel graciously made some modifications to support the new async http commands and submitted a pull request. Unfortunately I've been a little busy and recently got around to merging the request. So there's changes to the app available as well :slight_smile:

1 Like

Is bedroom TV a Harmony Activity or Logitech Harmony Hub C2C device type? The off() command should work correctly on activities since it includes the hub ID and activity ID when making the request. If it's a Hub device type, the post above should hopefully fix it.

1 Like

Yes, the hubs themselves show as C2C devices, thanks for the quick fix, will test soon.

That worked for me.

I did see the below error in the logs.

[app:84]2018-06-27 15:00:31.472:errorgroovy.lang.MissingPropertyException: No such property: hubs for class: java.lang.String on line 411 (pollResponse)

I'm seeing this error as well in multiple spots in the code.

Sorry, I didn't fully test @bravenel's asynchttp changes. It looks like the response from asynchttp is slightly different and also not working for this case.

According to the Documentation AsyncResponse follows SmartThing's implementation and now has a getJson() method that returns the parsed JSON object. getData() returns the raw unparsed string which is why that error is displayed. I tried changing it to the new parameter (response.json) but it's returning null.

[app:162] 2018-06-29 15:34:19.628: Harmony - response.json: null
[app:162] 2018-06-29 15:34:19.626: Harmony - response.data: {hubs={11...[truncated rest of data]

@bravenel, do you know if there's any issues with the getJson() method on an AsyncResponse?

I have rolled back to the syncronous http methods for now since these were parsing into JSON correctly and have commited it to Github (only a change to the app).

Yup. I was digging through it and saw that the response data is not being returned as json as it uses ='s now. Didn't have time to do much more than that.

So we just replaced that one line of code,

ResponseValues = response.data

with

ResponseValues = response.json

and that works for us. We aren't getting null from response.json.

I don't know if this is related to your issue but see below

I installed the app code and drivers code that @mattw posted. I see both of my Harmony Hubs listed under my devices, but I'm trying to figure out how to have the ability to turn on/off specific activities. Specifically, I want to be able to turn them on/off with HomeKit via the homebridge app. It sounds like I need to add a virtual switch for my activities, but I'm not 100% clear on how to get that to work.