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.
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…
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.
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.
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.
From the Harmony App > Harmony Setup > Devices - Authorize connection to SmartThings and enable access to the virtual switch in SmartThings.
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
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.
On the Manual Authentication step, paste the two values copied from the ST install.
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.
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.