Logitech harmony ultimate

this looks very promising.
I have been debating whether or not I should get an iTach but this looks like and even better solution.

I like how with harmony you can set up activities / macros and it remembers devices states.
So only send on / off commands when needed etc.

is this in a usable state at the moment?
The binary talk looked a bit confusing :-\

I think the answer is ‘no’ to this, but, could you use this to execute scenes from the Harmony remote?

[quote=“gdeboos, post:61, topic:175461”]this looks very promising.
I have been debating whether or not I should get an iTach but this looks like and even better solution.

I like how with harmony you can set up activities / macros and it remembers devices states.
So only send on / off commands when needed etc.

is this in a usable state at the moment?
The binary talk looked a bit confusing :-[/quote]

I’ve been a bit busy in the last few days and forgot to write up a guide to use it in it’s current form. It is usable, but not as a plugin yet. You will have to use things like ssh, scp, and other commands to set it up. Then, each activity or device command will be it’s own separate scene with a couple lines of code.

I do have to say that even though it works there is quite a bit of lag between executing a scene and the command action being performed. The problem is that each call is treated separately and the email and password has to be authenticated with logitech (this causes a significant delay). In it’s current form, I see this being useful for just starting activities, powering off, or other commands that are not really time sensitive. Anything that requires immediate feedback should be done with the remote or with Harmony’s app.

Maybe aechelon can chime in to see if this behavior can be changed. I’m not sure if there is a way to keep an authenticated connection open and just send commands.

Unfortunately, no. I would also like this possiblity though.

The best and simplest way of achieving it would be if it was possible for the Hub to invoke URLs, which it currently will not: http://forums.logitech.com/t5/Harmony-Hub-Based-Remotes/Is-it-possible-for-the-Harmony-Smart-to-invoke-a-URL/m-p/1187733#M8157

Any news on this?

I’ve only had a few hours here and there, but the plug-in is coming along.

Executing scenes directly with the binary is actually very straightforward.
I’ll try to put a write-up on this together this evening.

I don’t even think you’ll need to ssh into the Vera. You should be able to use the UI to upload the binary and call it directly using os.execute from custom luup code in your scene.

Sending multiple commands through a single connection is supported in the API but the binary doesn’t expose that through the command line. I’ll add that to the wish list.

[quote=“aechelon, post:66, topic:175461”]Executing scenes directly with the binary is actually very straightforward.
I’ll try to put a write-up on this together this evening.[/quote]

I’m really sorry that I didn’t write this up. If you don’t do it tonight, I’ll work on it tomorrow.

I tried to execute it after uploading it through the ui, but it didn’t work. Maybe I missed something.

This would be awesome. It would make sending multiple commands quicker and more usable.

Really excited to try this out…I’ll be glad to beta test any setup steps that either of y’all come up with.

Thanks for your work!

Here is my very rough outline of what needs to be done. I wrote it up in just a few minutes before heading out to work. Let me know if you see any errors, or if you need more info on any of the steps.

[ol][li]Download HarmonyHubControl binary from here:
http://code.mios.com/trac/mios_lhh/browser/precompiled[/li]
[li]Enable ssh access? (don’t remember if you need to do anything for this)[/li]
[li]Get ssh password from the back of the vera3, for veralite do the following:
open /etc/cmh.conf from a backup
password=xxxxxxxxxxx
more info on ssh password http://forum.micasaverde.com/index.php?topic=9797.0[/li]
[li]Copy the file into your vera using scp into the /bin folder
scp HarmonyHubControl root@[vera’s ip address]:/bin/HarmonyHubControl
more info on scp http://forum.micasaverde.com/index.php/topic,2525.msg10150.html#msg10150[/li]
[li]ssh into your vera
ssh root@[vera’s ip address][/li]
[li]Give execute permissions to the binary
chmod 755 /bin/HarmonyHubControl[/li]
[li]Run the commands to list activities, devices, or full config from the command line. Spend some time running the different commands from here to make sure everything works (start activities, send device commans, power off)
HarmonyHubControl [my harmony login email] [my harmony login password] [my harmony hub’s ip address] [command]
Commands:
list_activities
get_current_activity_id
start_activity [ID]
issue_device_command [deviceId] [command]
list_devices
get_config
more info on device commands http://forum.micasaverde.com/index.php/topic,14928.msg160002.html#msg160002[/li]
[li]Create scenes for any command you would like to use. Put one of the following in the luup tab for the scene (remember to hit “save lua” before closing the scene):
Start activity luup (-1 to turn off):
os.execute(“HarmonyHubControl [my harmony login email] [my harmony login password] [my harmony hub’s ip address] start_activity [activity id]”)
Device command luup:
os.execute(“HarmonyHubControl [my harmony login email] [my harmony login password] [my harmony hub’s ip address] issue_device_command [device id] [device command]”)[/li][/ol]

Nice!

Very nice write-up!

Running the binary after uploading through the UI doesn’t work because it needs execute permissions (chmod +x HarmonyHubControl). Beyond that you make a very good point – the user will need to run the binary via the command line to retrieve scene IDs and commands, and that requires ssh access (which is not a bad thing to have in general).

Thanks for putting that together, I’ll add it to the README!

Just to be sure - this won’t work on pre Vera 3 versions right?

Correct. The binary is Vera3/VeraLite only.

[quote=“aechelon, post:71, topic:175461”]Very nice write-up!

Running the binary after uploading through the UI doesn’t work because it needs execute permissions (chmod +x HarmonyHubControl). Beyond that you make a very good point – the user will need to run the binary via the command line to retrieve scene IDs and commands, and that requires ssh access (which is not a bad thing to have in general).

Thanks for putting that together, I’ll add it to the README![/quote]

Thanks! Feel free to make any modifications you deem necessary.

I was playing around with the binary and thought it would be nice to be able to run a scene that checks the current activity of my Harmony Smart Control, then depending on the result it changes to a different activity.

My use case is to check if nobody is using the tv/speakers and start the airplay activity for the receiver only. I would run this activity when I flip my “party mode” switch on, or when I arrive home to have instant airplay access from my iPhone. It saves me from having to open the HomeWave or Harmony apps, and go straight to whichever media app I want to use.

Here is the code:

[code]local handle = io.popen(“HarmonyHubControl [email] [password] [ip address] get_current_activity_id”)
local harmonyOutput = handle:read(“*all”)
handle:close()

local currentActivity = string.match(harmonyOutput, ‘Current Activity ID is : (-?[0-9]*)’)

luup.log("(HarmonyHubControl) Current activity: "…currentActivity)

– Check if current activity is -1 (off)
if currentActivity == “-1” then
luup.log(“(HarmonyHubControl) Currently off. Turning AirPlay mode on”)
– Start desired activity
os.execute(“HarmonyHubControl [email] [password] [ip address] start_activity [activity ID]”)
end

return true[/code]

If you need help with creating something similar, let me know and I’ll try to help you out.

Hey aechelon, I just noticed that Harmony added a sleep feature to their app (15, 30, 60, 90, and 120 minutes options). Any idea of how to call these from the binary?

Thanks for putting this together!

Unfortunately, on executingthe HarmonyHubControl binary, i’m getting the following errors:

LOGITECH WEB SERVICE LOGIN : SUCCESS
HARMONY COMMUNICATION LOGIN : FAILURE
ERROR : swapAuthorizationToken : Communication failure

It looks like it’s having a hard time connecting to the hub (the IP address has been triple checked), so I tried to get a response from the machine on port 5222. Here’s the result from telnet:

<?xml version='1.0' encoding='iso-8859-1'?>MAX_CLIENTS=4Connection closed by foreign host

Anyone running into any similar situations?

I’m assuming you can ping the IP of the Harmony hub just fine?

Sent from my iPad using Tapatalk

[quote=“silencery, post:77, topic:175461”]Thanks for putting this together!

Unfortunately, on executingthe HarmonyHubControl binary, i’m getting the following errors:

LOGITECH WEB SERVICE LOGIN : SUCCESS
HARMONY COMMUNICATION LOGIN : FAILURE
ERROR : swapAuthorizationToken : Communication failure

It looks like it’s having a hard time connecting to the hub (the IP address has been triple checked), so I tried to get a response from the machine on port 5222. Here’s the result from telnet:

Anyone running into any similar situations?[/quote]

Hmmm, I have no idea why it’s doing that. To rule out a bug with the binary in vera you could try one of the other libraries for controlling the harmony remote from your computer, like https://github.com/petele/pyharmony/. I’m not sure how technical you are, but you will need to get python working and run this from the terminal/command prompt. That said, I haven’t tried pyharmony, so I’m not sure if it still works.

Thanks for the tips guys. Based on the telnet response, it looks like there’s a 4 client max limit to the hub, but I don’t see that documented anywhere (maybe I missed it?). Even so, I’m not sure how I could have hit the limit since I only have one other client connecting (Android app).

The good news is, the binary finally started working but its intermittent. A few updates:

Yup, totally pingable. Here are the connectivity stats:
— 192.168.3.117 ping statistics —
765 packets transmitted, 743 packets received, 2% packet loss
round-trip min/avg/max = 1.078/2.567/399.187 ms

There is a bit of packet loss, so that might have something to do with it, but i’m not sure how this would tie into the MAX_CLIENTS error.

Interestingly enough, even when the binary isn’t working, the android app always works. My best guess would be the official Android App is better with working on ‘fuzzy’ connections whereas the binary may not be forgiving enough on lossy signal. I’ll see if i can provide the Hub a better wifi signal in the interim.

I do have a python box online, and the pyharmony test i setup worked.