[OBSOLETE] j64Harmony - Amazon Echo + Harmony Hub Integration

Yeah, you definitely need to keep it running on some hardware that is always on. It can run on linux, mac osx and windows. I don’t think there is a working build of dotnet core on raspberry pi yet.

Thanks for the confirmation.I am not sure if I would go for an added expense for a Raspberry-pi,SD card,Card case,power adaptor.

I was wondering if I could add a garage automation to the Raspberry pi if I am going to spend money might on it.Ofcourse i would now too add a tilt sensor to the list.

Any suggestions?

Thanks

I’m running in to the blank screen issue after entering my Harmony credentials but it doesn’t seem like it is the same issue as earlier in the thread.

I am on a Mac if that helps…

Hosting environment: Production
Now listening on: http://0.0.0.0:2065
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 POST http://localhost:2065/FirstTimeConfig/Edit application/x-www-form-urlencoded 303
info: Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker[1]
Executing action method j64.Harmony.WebApi.Controllers.FirstTimeConfigController.Edit with arguments (j64.Harmony.WebApi.ViewModels.Configure.FirstTimeConfigViewModel) - ModelState is Valid’
info: Microsoft.AspNet.Mvc.ViewFeatures.ViewResultExecutor[1]
Executing ViewResult, running view at path /Views/FirstTimeConfig/Edit.cshtml.
info: Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler[2]
Executed action j64.Harmony.WebApi.Controllers.FirstTimeConfigController.Edit in 0.753ms
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
Request finished in 0.7964ms 200 text/html; charset=utf-8
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 GET http://localhost:2065/css/site.min.css?v=9d8eVN4aYTm84PNEd_aFbbk6fS_6TzBOGZl4YNFva8w
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 GET http://localhost:2065/js/site.min.js?v=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
info: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[6]
The file /css/site.min.css was not modified
info: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[6]
The file /js/site.min.js was not modified
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
Request finished in 0.0062ms 304 text/css
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
Request finished in 0.005ms 304 application/javascript
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 POST http://localhost:2065/FirstTimeConfig/Edit application/x-www-form-urlencoded 310
info: Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker[1]
Executing action method j64.Harmony.WebApi.Controllers.FirstTimeConfigController.Edit with arguments (j64.Harmony.WebApi.ViewModels.Configure.FirstTimeConfigViewModel) - ModelState is Valid’
fail: Microsoft.AspNet.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: One or more errors occurred.
System.AggregateException: One or more errors occurred. —> System.Net.Internals.InternalSocketException: Unknown error: 11001
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
— End of inner exception stack trace —
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout)
at j64.Harmony.Xmpp.Hub.EnsureConnection()
at j64.Harmony.Xmpp.Hub.OpenConnection(String address, Int32 port)
at j64.Harmony.Xmpp.Hub.StartNewConnection(String userName, String password, String address, Int32 port)
at j64.Harmony.WebApi.Controllers.FirstTimeConfigController.Edit(FirstTimeConfigViewModel ftcViewModel)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNet.Mvc.Controllers.ControllerActionExecutor.ExecuteAsync(MethodInfo actionMethodInfo, Object instance, Object orderedActionArguments)
at Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker.d__6.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.d__53.MoveNext()
— End of stack trace from previous location where exception was thrown —
at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.d__44.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler.d__6.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Routing.Template.TemplateRoute.d__27.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.AspNet.Routing.RouteCollection.d__9.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Builder.RouterMiddleware.d__4.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.<Invoke>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.d__18.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.<Invoke>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.d__18.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.<Invoke>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.d__18.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.<Invoke>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNet.Authentication.AuthenticationMiddleware1.d__18.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.IISPlatformHandler.IISPlatformHandlerMiddleware.d__8.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Diagnostics.ExceptionHandlerMiddleware.d__6.MoveNext()
—> (Inner Exception #0) System.Net.Internals.InternalSocketException: Unknown error: 11001
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)<—

info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
Request finished in 0.0945ms 404

Thanks for taking the time to set this up, @joe64. This is exactly what I was looking for! I set this up yesterday and have most of it working. I have a few questions outlined below and was wondering if I could get some help.

  • List item How often does the SmartThings app get refreshed?
  • List item I added a channel (1758) and when I click on the app on my phone, it tries to duplicate the numbers. It will first go to 1177 and then 558. Any idea why this is happening?

Regarding the refresh, I created some new channels and deleted a few of the defaults but they are not showing up on my SmartThings app. I have closed the app multiple times and re-opened but it has not refreshed.

Thanks in advance - any help is greatly appreciated!

I guess I am not installing .Net correctly. As far as I could tell, I went through all the steps on the link to install .Net.

Looks like OS X doesn’t have dnu when I try to run j64Start. Any ideas?

This is saying that it cannot connect to the envisalink controller. Make sure that the address you are using for the harmony hub is correct. I’ve ran on a mac also and have never seen that 11001 error but know that it does work on mac osx.

@qplus7 - after the initial install the smart things app is updated with new device/channels/etc when you hit the refresh button located on the configure->device names page. As far as duplicating the numbers it could have to do with two things, first there is a “channel key press wait” option on that device names page. That controls the amount of time it waits in between sending IR commands. Also, you should check the placement of your hub to make sure it works well witih the regular remote and is not skipping any IR commands that way.

I run on a mac also. Make sure that you have followed instructions for installing on the get.asp.net site. They just released a new version (RC2) of dotnet a few days ago which has changed quite a few things. I have not updated to use that version yet so make sure you are installing the RC1 version if you want it to run now. It iwll probably be a week or two before I get the RC2 version working.

This is strange.

I’ve been using j64 for awhile on my Win10 64bit system, then I moved to a new place. Hooked up my PC and ran j64start and I eventually get this error.

dnx.exe has stopped working

Any ideas?

Thanks much.

Joe, I can’t get my j64Server IP into SmartThings IDE. Only the AppId, Password and User populate.

I’m obviously missing something but I have triple checked my IP that the j64 app is running on. All the other IPs and settings are taking without issue. Is there anything else that could be causing my devices not to show up in STs?

I had a similar problem the other day on my mac. It would crash when i did a refresh from the mobile app. However when i armed/disarmed/refreshed from a web browser it worked without issue. Anyways, I eventually figured out that I had installed the RC2 version of dotnet and it was causing some issues. So i took that off and restarted and it worked. Not sure if that would be related to your issue but you might look to see if some other patch or component was installed that might be interfering. I plan to update the code to work with RC2 soon so will send out a new release with those updates in a week or two.

If the j64 app is having issues determining your IP address you can manually put the IP under the hubs & gateways page. Be sure to click “save all” to save that information into your config. Then go to the configure->device names page and click on the “refresh smart things” button and it will send that info to your local hub. (You can watch live logging in the ST ide to see that information coming across).

Also be sure that you can access your j64 web site from another machine/phone on the same network as your ST hub. If you have a firewall turned on in your machine it may be blocking access when the smart app tries to connect with the j64 app. So connecting from a different machine will help to confirm that it is set properly.

This app seems really awesome and I am so close to having it work. I have the web server installed and working correctly and it set up the smartapp for me but I can’t get it to work from the Android smartthings app. I see the “sound” thing but it won’t let me toggle mute from the app. I can slide the slider from 0% to 100% but that does not do anything. When I go to the main web page on a computer at port 2065 and click on the icon for toggling sound on the page where it says “say this to do this” it will actually toggle the mute on and off. I also see the j64start cmd window scrolling some status when I do this. The web server and harmony are talking to each other but I can’t seem to get the sound “thing” in the smart app to talk to the web server. I deleted the sound “thing” and then went to the web server to reauthorize to smartthings to add it back which it did but it still does not work. Any ideas?

I forgot to mention that in the debug console of smartthings the “toggle mute” does execute but the sound is not muted.

This is in the smartthings log
38c9b017-4997-4f94-8668-6f684d8f51e3 12:32:07 PM: debug Toggle Mute

However the cmd window showing the j64start output does not do anything when the mute button from the smartthings app is toggled. However, it does show output and work when I do it from the web interface. It is like the smartthings app is not talking to the web interface when the sound mute button is toggled. Did I miss a step?

OK I figured it out. I read through every single post in here very carefully and the response to staticfade had the answer. It turns out that the j64 Server Gateway Information kept auto detecting a 169.x.x.x address which was wrong. I have my Windows 10 server manually set to 192.168.1.10 in Windows but it could not autodetect that. Once I changed the IP address and resync’d with smartthings on the Device Names page (http://localhost:2065/DeviceNames/Edit) everything worked.

Now I am going to play around with this and have lots of fun. Sorry for the thrash. I was killing myself trying to figure this out and luckily I could find the answer buried in the thread.

Good job figuring all of that out. Sometimes it has problems detecting the IP address of the machine so that is why I set it up so you could manually type that in. Have fun!

1 Like

Thanks a lot. It has been a lot of fun tonight. I have been playing with it with Alexa and it works as well as Alexa can recognize me in a noisey environment. It works flawlessly with smartthings. I do have a question though.

Is there a way to map other IR buttons on the harmony from any of the devices? I have a lutron light IR light controller that can do “All On” “All Off” “Bright” “Dim” and “Favorite” I can’t figure out how to map the “All On” button of the Lutron device to your app and ultimately to an Alexa command. Is that possible to do?

Other buttons would require a coding change. It would be fairly simple to add that in but was a little more than i was trying to accomplish.

If you are a programmer and want to give it a spin look at the ToggleMute command. It just sends a command to the hub to press a specific button. If you drill into that routine you will see a collection of device names that it discovers from the hub when it is first starting up. Your IR device would be down in there somewhere.

        [HttpGet("ToggleMute")]
        public IActionResult ToggleMute()
        {
            myHub.SendCommand(j64Config.VolumeDevice, "mute", "press");
            return new ObjectResult("mute toggled");
        }
2 Likes

I have a projector that I’d like to send a power toggle to using this, I didn’t want it included in the harmony activities so that it doesn’t power on and off my projector. Something to play with tonight!

Thanks for the tip. It has been awhile since I programmed anything but I will look into this. Out of curiosity which IDE do you use and is this ToggleMute code in the groovy code on the smartthings IDE or is it in your server app?