[OBSOLETE] j64Harmony - Amazon Echo + Harmony Hub Integration

I have everything installed at mac mini and It running well, However, I try the “previous channel” at Web or in SmartThing Apps, Nothing happen, I try mute, volume increase, decrease, Surfing and turn to HBO channel, all well. Do not know why previous channel does not work ?, Could someone try and feedback ? By the way, the timing 750ms is too short to allow Harmony input the channel number, 800ms is very good…

Great news @retradista! I wanted to cut out all of those manual steps so recently added that functionality to automatically add the smart app/device types. It “should” be able to re-run multiple times without an issue but clearly is not working in your case. If you ever run across a possible reason why it did not work let me know so I can update the app.

When you originally setup your harmony hub you must have gone to myHarmony.com and downloaded the software used to define all the devices and activities for your hub. That required a user/password so would be the one you would want to use in this case.

I will have to add some extra debugging info onto the screen so we can see why it is not sending that previous channel command. The app expects a a command called “previous” on the device but that must not be how it is defined in your hamony hub device. I will add some code to make that easier to figure out and will let you know when it is out there.

If you are a programmer and want to have some fun debugging the code, there is a SendCommand method in the Hub.cs file. It will search all of the devices for your channel device. If you set a breakpoint there and look through that device structure there is a command that should be called “previous”. I just noticed that one of my devices calls it “ChannelPrev” so that would cause a problem if i had selected that as my Channel device in the j64 app.

If you do discover the correct command name you can manually fix the smart things device by going into the smart things IDE and changing the device id to match. So in this case I would have to set it to “j64HarmonyChannel-ChannelPrev”.

You can also easily try different command names via the j64 API by using this url: http://localhost:2065/SetChannel/PrevChannel The last part of that URL is the command name you are sending so you can always just experiment with it until you find the right name.

BTW - I run everything on my mac also but have never found a good way to debug the code over there. So I use visual studio inside a windows VM to do all my debugging.

Hi,
I don’t recall doing that and when I go to myHarmony.com, it looks like they have retired that.

Here is the IDE Live info

04858770-d121-4673-b764-b32332d6df6b 9:48:45 AM: error java.lang.IllegalArgumentException: identifier required @ line 131 04858770-d121-4673-b764-b32332d6df6b 9:48:45 AM: debug Updating device Cooking Channel 04858770-d121-4673-b764-b32332d6df6b 9:48:45 AM: debug Updating device History Channel 04858770-d121-4673-b764-b32332d6df6b 9:48:44 AM: debug Updating device Eleven 20 04858770-d121-4673-b764-b32332d6df6b 9:48:44 AM: debug Updating device DVR 04858770-d121-4673-b764-b32332d6df6b 9:48:43 AM: debug Updating device Surfing 04858770-d121-4673-b764-b32332d6df6b 9:48:43 AM: debug Updating device Sound 04858770-d121-4673-b764-b32332d6df6b 9:48:43 AM: debug getChildDevices(false), children=13 2108c1f3-7f99-4723-ab2e-f3a94e80bed0 9:48:43 AM: trace HUE BRIDGE RESPONSES 2108c1f3-7f99-4723-ab2e-f3a94e80bed0 9:48:43 AM: trace Location: index:05, mac:BCAEC58F0429, headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBLZWVwLUFsaXZlDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkFjY2VwdC1FbmNvZGluZzogZ3ppcCwgZGVmbGF0ZQ0KQ29udGVudC1MZW5ndGg6IDU5Ng0KSG9zdDogMTkyLjE2OC4xLjQ4OjM5NTAw, body:eyJqNjRBcHBJZCI6IjBmYzcxODJhLWRmNmMtNDcwYS1hNGFlLWQ0NjI5NzgyYmQ2YSIsImo2NElwIjoiMTkyLjE2OC4xLjEzMyIsImo2NFBvcnQiOjIwNjUsIlJvdXRlIjoiL2luc3RhbGxBbGxEZXZpY2VzIiwiUGF5bG9hZCI6W3siTmFtZSI6IlNvdW5kIiwiRGV2aWNlVmFsdWUiOm51bGwsIkRldmljZVR5cGUiOjB9LHsiTmFtZSI6IlN1cmZpbmci

@BoomerTheWeim - when you go to setup your harmony hub you would download the myharmony app from that site or at least that is how it worked for me. When you create an account inside of there, that is the one i am referring to.

So it looks like it had an error on line 131 of the smart app. The only time I have ever seen that is when Smart Things returned a device from the children.find but there was not actually a device out there. Given all of the problems that have been going on with smart things over the last few days I am assuming it is related to that.

From the output I “think” it is trying to update your “cooking channel” device. If you want to try working around that issue you can comment line 131 & 132 of the j64 Harmony smart app where it is setting that name and label. That should allow it to continue on and add those other devices.

    else {
     	log.debug "Updating device ${name}"
/*
        channelDevice.name = name
        channelDevice.label = name
*/
	}

Ok got it. Thanks

@joe64 I check the command at LogicTech Harmony Forum, and most of article do mention the command is “ChannelPrev”, However, I try to modify the Device ID in SmartThing IDE to “j64HarmonyChannel-ChannelPrev”. But It seem after I change and update the Device in IDE, and I run again at SmartThings and WebAPI, all still useless, Do not know where is still got wrong…?

I just checked in a change to github that could help to track down the issue. If you want to get the latest copy of the source code and restart the app, it will now write a file called myHubConfig.json into the wwwroot directory. That will show us all of the devices and how the different commands are named. Be sure to change back the network id on that device in the IDE. Also this should not overlay the local configuration of device names but it does not hurt to save off all of the *.json files in that wwwroot directory first.

You were right. It was an ST issue and not with your app at all. I tried resyncing a few hours later and it worked like a charm.

In the future will we be able to control more than 1 device? I also have an Amazon Fire TV. It would be great if I could pause/unpause it as well.

As for DirecTV could we bring up the Guide and the recorded list as well as speak the directional arrows and speak either Select or Exit?

It would be great if I could control most functions that are controlled via Harmony thru voice control with Alexa.

@Fubie - Yes, that is something i want to add. Right now I have limited support for the different type of devices but would like to add a better way to define and send commands to other devices like apple tv, roku, etc.

One thing I have found with the Echo though is that the more phrases you get in there the harder it is for Alexa to recognize them properly. I find that i have to get pretty creative with naming things to keep it all straight which is why i named a few channels “one oh oh five” or “ten eighty” instead of the actual name of the network.

Finally got server to work. I created a Windows10 VM. But a problem. Alexa recognizes the command but Harmony isn’t transmitting the IR. Harmony is working (i tested on the Harmony app). I checked the Harmony login information on the hubs and gateways. All looks good. What did I miss?

There are some extra steps to get asp.net setup on your machine. Check step 1 getting started for info on that:

if you are on windows, make sure to use that dnvm upgrade command that i mentioned in the doco. Windows seems to require an extra step.

Let me know how it goes.

I installed the framework , rebooted and ran dnvm. before. It’s not recognizing the commands

So tried it on a Mac. Installed framework, copyed github . Got this when I ran j64start:

Last login: Thu Mar 24 20:06:46 on ttys000
Jacks-Mac:~ jackr$ cd j64.harmonyapp
Jacks-Mac:~ jackr$ cd desktop
Jacks-Mac:desktop jackr$ cd j64.harmonyapp
Jacks-Mac:j64.harmonyapp jackr$ ./j64start
Running dnu restore for Xmpp
failed to locate libcoreclr with error dlopen(/usr/local/lib/dnx/runtimes/dnx-coreclr-darwin-x64.1.0.0-rc1-update1/bin/libcoreclr.dylib, 10): Symbol not found: ___sincos_stret
Referenced from: /usr/local/lib/dnx/runtimes/dnx-coreclr-darwin-x64.1.0.0-rc1-update1/bin/libcoreclr.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/lib/dnx/runtimes/dnx-coreclr-darwin-x64.1.0.0-rc1-update1/bin/libcoreclr.dylib
ERROR: could not run “dnu restore” for j64.Harmony.Xmpp. Try to run it manually
Jacks-Mac:j64.harmonyapp jackr$

What am I doing wrong?

I started working on a similar thing for my DirecTV receiver. No intermediate device necessary, as the DirecTV accepts web commands over the local network.

Haven’t gotten too far, just tried to get the Pause button working to start. And it does, if I name it “bathroom lights” or something like that. But if I give it a name that has the word “pause” anywhere in it, the Echo hears me properly, but just does nothing. Have you noticed anything similar, and if so, found a way around it?

Echo processes some words as reserved commands, so you can’t use them as the names of home automation devices. For example, I used to have a switch called “power” but that is now an echo reserved word. So if I say turn power off, instead of turning off the switch named power, echo turns itself off.

The same is true for “play” and “pause.”

There’s no list of these anywhere that I’ve seen, you just have to figure them out because you get exactly the result you got – – echo hears the phrase correctly, but doesn’t apparently do anything.

We do have a topic which discusses the ones that we found so far. But the short answer is just rename “pause” to be something else. Some people have found that “pause Roku” or “pause TV” will work when just “pause” doesn’t. I use “hold” Now just because I was trying to pick something that echo wouldn’t be likely to reserve in the future.

1 Like

If you are using a virtual machine, make sure that you can hit the j64 web app from outside of that machine, you may be hitting a network issue where the smart things hub cannot talk to the j64 web app. I have a mac and run windows virtual machines. However I have to set the network into bridged mode so that the VM will get an IP on the local network. If you don’t do that it will not be accessible from outside of that host machine.

If you go into the smart things IDE, and look at the setting for the smart app you will see what IP address it is trying to use when contacting the j64 web app. So in the IDE you would go to the menu option My Locations → List Smart Apps at bottom of that page → then click on the j64Harmony smart app. You will see the settings showing the IP address it tries to contact when sending commands to the j64 app.

One other thing to check is that you have assigned the correct device to send the sound, channel, etc commands. In the j64 web app go to configure->device names and make sure the right one is selected.