j64Harmony - Amazon Echo + Harmony Hub Integration

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.

Thanks for that link @JDRoberts. I frequently have to experiment with different names to get alexa to recognize names that i create. I find that I sometimes have to get especially creative with channel names so i will use names like “one oh oh five” instead of 1005 or “cable tv” instead just “tv”.

1 Like

That means that something went wrong with the install of asp.net core, not sure how to fix that one. However, send me a PM if you would like to talk over the phone and maybe we could share your desktop and figure it out.

Changed to bridged mode in VM and made sure IP address match. All is working !! Thanks

That is awesome!

I am stuck on getting the iOS SmartThings app to execute the commands. I followed the instructions, the app was pushed to SmartThings. I see the devices in ST, I see them in the iOS app. I can execute the command in the j64 web tool to test. All of that works. But in SmartThings, nothing happens. I have tried all kinds of combos and nothing happens. in j64 web app I have authorized my ST Hub successfully. I know the Harmony part is working correctly because the tests work in the J64 web page. But the ST is a no go. Any ideas? Thanks for what seems to be a promising application!

Thanks for creating such a useful app Joe.

I had everything up and running great until I started messing around with the favorite channels. The first time I changed the favorites and synced everything worked fine. Now it seems like your application is working properly, but SmartThings is not updating with the new channels. Any ideas?

Also, what edits would I need to make to the volume switch to change the increase/decrease increment from 2 button presses to 4?

sorry, i have no checked my mail in a few days. you should also look at the log in smart things to see if it has any messages. if a device is used by another smart app it may not be able to change it and þe log may have more info. https://graph.api.smartthings.com/ide/logs

for the 2 vs 4 button presses, there are a couple lines of code in j64.harmony.xmpp/hub.cs module where you can send the extra volume commands. it is the SetVolume method, just copy the line that sends the press command.

Joe, in my logs I see the command issued (e.g., turn off sound) but nothing happens. SmartThings seems to see the button push from the ST App, but that command is not sent to Harmony (guess there). When I use the j64 web app though the same command works within the web. Is there something else I am supposed to set up from ST to Harmony? I put in the credentials for ST and Harmony in the app. Still missing something

I got this message after running the j64start command. I have an older Win7 pro machine (32 bit).

"Running dnu restore for Xmpp"
This version of C:\Users\Rey\.dnx\runtimes\dnx-coreclr-win-x64.1.0.0-rc1-update2
\bin\dnx.exe is not compatible with the version of Windows you're running. Check
 your computer's system information to see whether you need a x86 (32-bit) or x6
4 (64-bit) version of the program, and then contact the software publisher.

I’m not code savvy enough to figure this out.

Would you be able to adjust the code that I can copy and past into this doc?

I do have the doc and I did find the code, but I’m just not sure how to adjust the code.

Thanks!

This is the code I have.

   public void SetVolume(int level, int previousLevel, string volumeDevice)
    {
        string cmd;
        if (level == 0)
            cmd = "volumedown";
        else if (level == 100)
            cmd = "volumeup";
        else if (level > previousLevel)
            cmd = "volumeup";
        else if (level < previousLevel)
            cmd = "volumedown";
        else if (level < 50)
            cmd = "volumedown";
        else
            cmd = "volumeup";

        SendCommand(volumeDevice, cmd, "press");
        System.Threading.Thread.Sleep(100);
        SendCommand(volumeDevice, cmd, "press");
    }
}

After a little bit of Googling, I found that for 32bit machines, the command should be

upgrade -r clr

I have a new issue though, after I start j64start command, I’m stuck "Running dnu restore for Xmpp" with a blinking cursor.

Use the below:

    public void SetVolume(int level, int previousLevel, string volumeDevice)
    {
        string cmd;
        if (level == 0)
            cmd = "volumedown";
        else if (level == 100)
            cmd = "volumeup";
        else if (level > previousLevel)
            cmd = "volumeup";
        else if (level < previousLevel)
            cmd = "volumedown";
        else if (level < 50)
            cmd = "volumedown";
        else
            cmd = "volumeup";

        SendCommand(volumeDevice, cmd, "press");
        System.Threading.Thread.Sleep(100);
        SendCommand(volumeDevice, cmd, "press");
    System.Threading.Thread.Sleep(100);
        SendCommand(volumeDevice, cmd, "press");
        System.Threading.Thread.Sleep(100);
    SendCommand(volumeDevice, cmd, "press");
    }
}

If you wanted to increase it to 6, you would add two more send commands with the sleep in between them.

Thanks Joe! All of a sudden SmartThings synced. We all know it’s like that sometimes…

Got the volume increment changed. Thanks for letting me know where to find the code.

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.