Guide: How To Control Logitech Harmony Hub Without the Crappy Harmony Ultimate Plugin

628 views
Skip to first unread message

SimonBG

unread,
Feb 28, 2016, 6:42:19 PM2/28/16
to Tasker
Some of you may have seen me firing emails to the developer of the super outdated "Harmony Ultimate Tasker Plugin" (HUTP). I needed it to work so much that I even tried learning Java with the attempt to fix the bad app. Long story short, I can't compile without errors and I don't have time to learn SMALI and since the developer has completely abandon us - I took different approach.

I learned the protocol language between (XML JABR) and with some compating between the broken plugin and origianl Harmony app I was able to find the solution.

What was broken and what this method fixes:
- repeating commands (you execute "DirectionUp", TV moves up twice).
- infinite commands (Amazon FireTV)
- device (HUB) freezes for 30-45 seconds.
- It will most likely work for Older/Newer version of android as longs as the other 2 apps mentioned bellow support it. 

So here is a step by step guide:

1. Download "Packet Capture" by Grey Shirts
2. Start it agree with whatever it asks you and hit the green triangle on top right. Packet capturing (traffic sniffing) starts:


3. Go to Tasker, execute a IR command with the "HUTP", preferably one that is broken.

4. Go back to Packet Capture and hit stop, then click the log. You will see a list of applications, click on the "HUTP" and you will see something like this:



 The blue is outbound (from phone to HUB), red is response from hub.

5. Scroll down till you see outbound command that contains "IRCommand", in my case that is line #11 (and it will most likely be the same line for you):


6. We need improve the code (string being send) as most likely Logitech added "press and hold" functionality to the protocol and HUTP was never updated for that. So we need to add an argument :timestamp after "status=press. It will look like this:
<ig type..............................................
.......................................
.........................................
.............."DirectionUp"}:status=press:timestamp=0</oa></iq>

7. Then we need to double this line#11 (the whole thing that is circled in red) with the added :timestamp argument and one more change, like this:

<ig type..............................................
.......................................
.........................................
.............."DirectionUp"}:status=release:timestamp=55</oa></iq>

NOTICE the "press" changed to "release" and time stamp from "0" to "55". 55 is average based on what Harmony app. You can change that if commands repeat for you - decrease it. If they don't work at all - increase it.

How did I come up with this? I sniffed the traffic from the original Harmony app and compared to HUTP. It does work slightly different and a bit more complicated so I advise you to start with HUTP traffic. For example, the Harmony app keeps connection alive and the time stamp keeps increasing to tens of thousands, vs the HTUP killing the connection after each command and I believe that is represented with the line #12 (orange circle).


8. So how do we send the correct string to the HUB? You need a plugin called "Send/Expect". Great plugin, great developer ( I accomplished this with some help from him). Before you jump to Send/Expect plugin, from Packet Capture click the 3 dots on top right, then "Save Upstream" and save the file somewhere (you need to add extension, .txt works).

9. Open the saved "Upstream" and copy EVERYTHING. Open Send/Expect plugin and type in your Harmony Hub ip address, port number is "5222". If you don't know the IP, you can see it on the Packet Capture log page.
Then hit "Add Send" and paste the entire string. After that make the corrections explained in 6 and 7 (duplicate the command, add timestamp, release etc.), You can add new lines to make it look easier to understand.

10. Add pause at the end, 150 ms works for me. It will fail without pause:




So far, this example was for one command only. Now, how do we make this easier to use? Instead of capturing every single command, just replace "DirectionUp" (if we are using my example) with "%command" and in your task in Tasker, right before that make variable set "%command to DirectionUp. This way, you can save "Device X" profile in Send/Expect plug in, and just change the argument of the variable right before executing the Send/Expect action.
<ig type..............................................
.......................................
.........................................
.............."%Command"}:status=release:timestamp=55</oa></iq>

NOTES: 
-You need to capture traffic for different device as there are other arguments like device ID and so on that are different for each device. Same if you have different hubs. Send/Expect Profiles makes the whole process easier. Also, it is possible to implement "press and hold" as part of the protocol is "status=hold" - you will need to experiment with Harmony app for the right trimmings and will need to send multiple times with short pauses in between (5-15ms).
- To get list of all command names (instead of capturing traffic one by one), go to Harmony app , edit devices, "Add/Fix command":



I have been using Harmony Hub like that for over a month and it works flawless and no noticeable lag. If you guys don't understand something - please ask. Will try to respond as I can.

One advice - once you get this working - DO NOT UPDATE HARMONY.


Jens Hoofs

unread,
Mar 2, 2018, 5:53:58 PM3/2/18
to Tasker
Hi, does this still work?
Both plugins die Tasker in the appstore keep crashing when i use Them.

Jens Hoofs

unread,
Mar 4, 2018, 3:42:44 PM3/4/18
to Tasker
For anyone else searching for a solution. The above Will work but seems to timeout when the Harmony original app is nog running. The Tasker plugins have the exact same problem. Curently om working on a work around that keeps the Harmony app active.
Reply all
Reply to author
Forward
0 new messages