Harmony Hub Integration

I have been experimenting with the harmony-api server found in this GitHub repo

I am running this on a Raspberry PI that I also run Homebridge on. Just a few minutes ago I was able to use a Virtual HTTP Switch Driver (shamelessly taken from an old ST post) and got it to turn on my "Watch TV" activity and then turn off the Harmony Hub's current activity (which shuts down all of my AV equioment.) I am going to work at packaging this up as an intermediary Harmony Hub workaround solution until Hubitat release an official integration. I should have something fairly easy to install and use within a day or two and will share the information here.


Thank you for this @ogiewon. Maybe looking at the kuku harmony post in the ST forums will be helpful as well.

Yes, that is exactly where I started. However, KuKuHarmony does NOT handle Harmony Activities at all, if I read correctly… It seems KuKu is focused on individual device commands, not activities. He mentions in some of his posts to use the official ST/Harmony integration for Harmony Activities.

All I really need at this point is the simple ability to turn on/change an activity and shut everything down. That would allow me to replace my current dependency on SmartThings for how I use the Harmony Hub integration.

So, for now, I think I am going to try the KISS (keep it simple, stupid) approach. I am not a very good groovy programmer, so perhaps someone else will want to take up the challenge to make a more sophisticated App that automatically queries the Harmony hub for Activities and creates child devices for each one? That would be a good start. I may try to tackle that once I get the basics working… :slight_smile:


Ahh…I didn’t realize that. What you are working on is exactly what I need as well. Look forward to see what you come up with. This and hue would allow me to bring over most of my devices.


Harmony is the only thing I have left in ST get it working and I would be golden.

Early adopters, here is a very basic Logitech Harmony Hub integration for Hubitat. The install and configuration is manual, but it does appear to work in my limited testing over the past 24 hours.

You will need to get the harmony-api server up and running on another system on the same LAN as your Harmony Hub and Hubitat Elevation hub. I did this on a Raspberry Pi that I also use for Homebridge.

Here is the ReadMe from my Hubitat GitHub repository that should help get you started. Let me know how it goes. If you want to help improve the ReadMe, please feel free to submit a pull request with you edits.


Arggg…now I have another App to try tonight. My wife is not gonna be happy…but I will be if this works.

Thanks in advance…and if this works…I’ll have just one integration left to be all in. Huey, Huey…Where art thou? Me thinks @patrick can find him.


I just update the “HTTP Momentary Switch” driver as I noticed that these devices would sometimes get stuck in the “on” state, which should never happen by design. I have modified the code and revised my GitHub repo accordingly.

Although this is a cloud to cloud solution, it works until a local solution is finalized.

Control Hubitat from Harmony Activities

  1. Setup Hubitat SmartThings Integration

  2. Create a simulated switch in SmartThings

  3. Use Rule Machine in Hubitat to assign actions based upon the virtual switch turning on.
    Note: So the virtual switch in Hubitat is ready to activate again, set a rule to turn it off after a 1 second delay.

  4. From the Harmony App > Harmony Setup > Devices - Authorize connection to SmartThings and enable access to the virtual switch in SmartThings.

  5. Create an activity (Ex. Dining Room OFF) and set the home controls to turn the virtual switch on when the activity starts. This could also be assigned to an existing activity, and as a second example, you would have the virtual switch trigger a rule via RM that dims your lights when the Harmony activity starts.

You can also go the other direction if you need to - Control Harmony from Hubitat

  1. Setup Other Hub

  2. Install the Logitech Harmony Trigger SmartApp in SmartThings (Marketplace > SmartApps > + More)

  3. Using the Logitech Harmony Hub Control SmartApp, configure it to react to the state of your virtual switch, which is linked to your OH switch in SmartThings, and it will now start a Harmony activity.


I was interested in the harmony-api with KuKu since it runs locally but I haven’t had a chance to get it setup on my Pi.

But! I did get the native SmartThings Harmony (Connect) SmartApp and Hub/Activity DTHs ported over. Main issue is getting OAuth setup since I don’t have an API key and I’m not sure if Logitech is going to respond to my request for one. In the meantime the auth tokens can just be copied over from SmartThings after it’s successfully authenticated there. There isn’t any refresh or expiration on the tokens from what I see. Only if the account password is changed or they’re otherwise revoked. So once it’s setup once, it should continue working without any intervention. Disclaimer: This might be against TOS somewhere, but seems to be an open API if you have an auth token.

  1. Login to graph.api.smartthings.com
  2. Click My Locations > smartapps > Logitech Harmony (Connect)
  3. Save both HarmonyAccessToken and accessToken (easy to confuse by name)
  4. Install both drivers and app from github here.
  5. On the Manual Authentication step, paste the two values copied from the ST install.
  6. Hubs/Activities should be found. The page refreshes every 15 seconds during setup so they might not show up right away.

Luckily there weren’t too many code changes required. Obviously the OAuth entry changes and also needed to modify the asynchttp methods to the regular synchronous ones. I think there’s possibly an issue with Hubitat’s sendEvent isStateChanged handling. Repeat events should be handled automatically, but each time polling is called (every 5 minutes) there’s a log entry even if the state hasn’t changed. I added in a check for the activity switch status to prevent this for now.

This is still a cloud connection to Logitech’s servers so not completely local yet, but at least a start and not requiring any extra hardware.

Let me know if it works for you!


Thank you so much! That works great. I tried my “goodnight” activity, which turns off my Insteon lights downstairs and my entertainment system. Worked perfect!

1 Like

KuKu Harmony is working in Hubitat now. There is a ton of code that needs to be cleaned up, but you can get the code from here:


May I suggest you add this to the Code Share category and tag it as a Community_app.


One thing I used in ST integration was the ability to tell set a specific Harmony Hub “all off” so that all activities were terminated. I do see the “all off” command in the hub device in Hubitat, but I don’t see a way to call it via a “switch” using RM?

That’s a pretty good idea. I modified the Hub driver to add switch capability and mapped the off() command to alloff(). This seems like a pretty safe change and should make it easier in RM to call off as a switch, since by default the Hub driver doesn’t have any compatible capabilities to have it show up in the custom commands selection. Just FYI on() command doesn’t take any action. The changes are up on Github.

1 Like

Thanks Matt! That will make it easier for sure.

Sorry to bother, not seeing the update in github, or at least it’s not showing a new commit?

Sorry I forgot to sync the repository. It should be up there now.

1 Like


Works great @mattw.
@ogiewon, have you tried this Logitech Harmony Connect port? It works great and you don’t have to schedule a RPi reset every 3 days :wink: