Harmony Hub Integration

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.

I figured out what the issue was. I only installed the [Logitech Harmony Hub C2C.groovy] driver code, and I guess it was looking for the [Harmony Activity.groovy] driver. It seems to be working once I installed that driver as well.

1 Like

A couple of things Iā€™ve noticed about the integration. One, the activity switch seems to take a long time to update if the activity is started somehow other than from the switch. This seems to be a known issue based on some posts I read above. A more bizarre issue Iā€™ve noticed though is, almost immediately after turning the switch on, the switch turns back off again in hubitat. If I hit the ā€œrefreshā€ button, it will show as on again. I tried to solve this issue by setting up a rule to refresh the switch a few seconds after it turns on. Iā€™m also seeing an issue where the switch will randomly turn off, and then back on again in hubitat even though the activity was running the whole time. This causes issues with any rules I have setup to use the switch turning on or off as a trigger though. Any idea why this is happening?

Which specific integration are you using? Hopefully the one based off of the ST Harmony Hub integration? That's one I believe most of us are currently using.

Assuming that is the correct integration... Yes, you should expect a delay of up to about 5 minutes... Not ideal, for sure...

I haven't noticed this. But truth be told, I probably would not notice it as I use the integration to simply start an activity as part of a larger routine/scene. I do not use the status of the Harmony Activity 'Switches' for anything currently. I'll try to test it later and report back my findings.

Yes, Iā€™m using the app that mattw put together. The main reason I noticed it is because I recently set up Rooms Manager, and am using the activity switches as a way of showing that the room is ā€œengagedā€ I noticed that it would briefly show engaged, but then revert back to vacant. It was then I saw the switch would turn on and then back off again when I started the activity.

Try changing line 370 of the Logitech Connect App from

poll()

to

runIn(10, poll)

This eliminated the ā€˜on to quick offā€™ problem you mentioned above for me during my quick testing. The app was polling the Harmony Activity status before the command to turn on the activity was finished. The above just waits 10 seconds before running the poll() command.

1 Like

That seemed to have worked for me too. Thanks!

Where do you find the HarmonyAccessToken and accessToken on the Smartthings IDE page? I clicked on the Logitech Harmony Connect App but I'm not sure of where to get the tokens from. Thanks

@mattw Thanks for the port !! Works like a charm.

Sounds interesting.

Many thanks @mattw, this worked a treat for me!

@mattw Just wanted to throw a thanks out there for getting this working. It was one of the last items on my SmartThings to HE migration list!

@mattw incredible port! After getting through the many options I used your code and got it up and running. The polling is quite off from when you shut down the activity from remote/alexa to HE. If I do a refresh in the device it does update. So I am curious like others if the polling can be significantly reduced.

Great job and hope to hear an answer! This gives me new automation to try in RM now.

In the App, I believe the following section of code sets up the recurring 5 minute poll. Remember, this is polling the Logitech Cloud for the status of the activities, I believe. Just how important is it to have instant feedback that an activity has changed? You don't want to pound on the cloud every few seconds, right?

image

No but I do need the status to update sooner than 5 min. Do you think every minute is too much?

Give it try at let us know. You'll go from an avg of 2.5 minutes for an update to 30 seconds (on avg). Others (@halfrican.ak) have come up with some novel solutions for more 'instant updates', by adding a smart device to the Harmony Activity. This device needs to be seen by both the Harmony Hub and Hubitat, independently of one another. Then, when the Harmony Activity turns on the shared smart device, Hubitat also sees the transition and you can then update the status of the activity. Seems like just knowing something changed would be enough, so that Hubitat could issue a poll() of the harmony cloud... So many ideas... :wink:

1 Like

So I use a WeMo Insight on the TV to help is discovering if there is power BUT it seems to be not 100% reliable for my living room automations. I have about a 80% success rate of my light automations activating. The goal of the Harmony is to ensure I am seeing activity in watching TV and then I can make actions based on that. Hence why 5 minutes is too long.

Here is the topic where @halfrican.ak came up with the Harmony Instant Status update workaround...

Instant Harmony Hub Status Updates!

1 Like