Jump to content

Amazon Echo and ISY


madmartian

Recommended Posts

Posted

I just got the echo and following directions here and elsewhere I was able to get the hue bridge up and running on a Windows 8.1 machine.  I can add devices to the bridge using I'm Only Resting HTTP client.  However, echo won't find the devices.  Bases on various suggestions I've turned off the firewall on the windows machine, turned network discovery off, poked around my router, but to no avail.  Anyone get the echo to discover devices from a Windows 8.1 machine?

 

Any help appreciated.

 

Thanks.

Noel

Posted

Wanted to report back that switching from the .1.1 jar to the .1.3 jar solved the issue and Echo can now find the devices.  But as KCK above, I am getting the 401 errors and the echo cannot find the device to turn on/off.  I will report back when I figure it out.

 

Noel

Posted

Wanted to report back that switching from the .1.1 jar to the .1.3 jar solved the issue and Echo can now find the devices.  But as KCK above, I am getting the 401 errors and the echo cannot find the device to turn on/off.  I will report back when I figure it out.

 

Noel

Check your URLs to the ISY.  401 means unauthorized so you're probably not passing in the credentials.  The URL should look something like http://kgividen:myPassword@192.168.111.4/rest/nodes/25%203B%20F2%201/cmd/DFON/100

 

You have to have the "kgividen:myPassword@" piece in the URL so it can do basic auth to the ISY.  If you don't have that then the HUE emulator cannot connect to the ISY.

 

If you post your HUE console log here I also might be able to help.

Posted

After being waylaid by other silly projects that should be limited to people with more skills than I possess, I was finally able to get my Echo to talk to my ISY without the use of the Hue "hack" or IFTTT.

 

Using my Amazon Echo developer access, I created an app that runs on Amazon's AWS Lambda servers.  I call my app SARAH in honor of the Self Actuated Residential Automated Habitat system from the old Eureka TV show.  This Javascript-based app talks to my ISY device via a custom proxy that I created and run on my local NAS drive.  I had to open a port and use a free cloud/DNS service so the Echo app could reliably contact my NAS drive.  It's a bit of a patch job -- certainly not a final solution for the masses.  In fact, it is as much or more of a "hack" than the HUE solution, I'm sure, so please don't ask me for my ugly code.  I'm sure you don't want it. :wink:

 

However, I am very happy with it!

 

@Michel, if you can still use volunteers, I will gladly help you to test out your new ISYPortal with my SARAH app.

 

Thanks,

-Randy

Posted

Hi Randy,

 

This is great news and yes, please!

 

The only question is: does Lambda allow for username/password for ISY?

 

With kind regards,

Michel

 

As you might know, the AWS Lambda server supports JavaScript functions through Node.js.  I am using Nodes.js' HTTP module to talk to my proxy server.  While I am not using my ISY username/password in my AWS Lambda code (I only do that at the proxy->ISY level inside my LAN), the HTTP module claims to support basic 'user:password' authentication to compute an Authorization header.  It also claims to support HTTPS.  I've yet to have to use either, but I am willing to try.

 

I'll send you an email at support@universal-devices.com so we might set up some tests.

 

Cheers,

-Randy

Posted

Randy/Michel, you should be able to connect via the http module with the username and password but that will have to be hard coded in the lambda function unless we can pass it on from the echo some how.

 

Randy, have you seen any way in the ISY developer kit where a user can configure or store a username and password? I don't see that in the API anywhere. You can display cards in the echo app but I don't see yet how we can make this work where a user can enter a username and password or key that would be passed to the lamda function.

 

If we can figure that out or figure out a unique Id to be passed from the Echo we should be able to do this. I will be doing some basic testing with the ISY portal and my lambda function this week.

Posted

@kgividen

 

Yes, I agree there will eventually have to be a settings option added to the web-based Echo app that allows the user to enter this information in the same way you currently enter your Pandora or iHeartRadio account info.  In other words, a way for us (developers) to add simple UI screens to their current web-based Echo app as part of our app's "installation" process.  This is obviously something Amazon would have to allow/support in order to for anyone to publish this type of app for public use.  Otherwise, you have to customize the app for each user!

 

There might be some creative solution to this, but none I can think of at the moment.  Until then, I am trusting that Amazon will figure all this out by the time they have a process and app store in place for people to actually share/sell their Echo apps with the world.

 

-Randy

Posted

Hopefully soon, a method will be made available for the Echo to send direct to the ISY.

 

+1

 

You'd still need to share your ISY's username:password with the Echo app, but at least we wouldn't have to expose our ISYs to the world via the cloud.

Posted

Echo talks directly to the pseudo hue bridge, so I see no reason it cannot be done for ISY as well.... eventually.

Posted

Right. The difference is the HUE has a special settings place in the Echo App. There is no custom place to set the user and password for additional apps. We will have to work with the Amazon Echo team to figure that out or leverage the Hue interface in the meantime.

Posted

@randth and @Michel,

 

I just found a getUser and get UserId method in the Java version of the echo appkit.  I'll have to see how that might apply to Lambda nodejs functions but we might be able to use this to let the user "register" their ISY device.  


We could make a service they hit saying "register your device with ISY" and it would go add one of those unique IDs to a database so the portal knows it's them.  Then return back some sort of code they can then go with a browser and register that device with the portal.
 
Or something along those lines.  We can cross that bridge when we get there but that does possible give us some options.
Posted

@kgividen

 

I just got back home and had a chance to try the configurator again after the issue I was having last week.  It turns out that, at least on Windows, the --disable-web-security switch isn't effective unless all instances of Chrome are closed when it is invoked.  Once I closed even the background Chrome from the notification area then things worked.  Figured I'd let you know in case others encounter this.

Posted

@randyth

 

I know you weren't thrilled about sharing your lambda function but would you be interested in sharing your Echo Intents and Speech patterns?  I'd be interested in collaborating even on that level if you are.  

 

Plus I could share the code I'll be working on this week to get your input if you're interested.  Michel has my email address but you could just email using my name here with a @gmail.com on it.  ;)

Posted

By the way - it is pretty easy to add program invocations as a result of a name/on or name/off request to Echo.  I used the manual part of the configuration to add execution of some programs (via runThen and runElse) and the result is really convenient access to some things that can't be handled by scenes.  If you can pick good names then the Echo invocation string even sounds reasonable.  E.g., I have a program that preps the master bath by turning on floor heat, towel heat, hot water recirc, lights, etc. (very high WAF!) and now we can just say "Alexa turn on bathroom" to get things going.

Posted

Hi,

 

With amazon echo hue emulator - I was only able to add 28 devices. Beyond that Alexa could not find the device. Are you experiencing the same situation?

 

Thanks.

Posted (edited)

I wrote a quick and dirty 'mapper' that uses the 1.3 JAR.  It reads off the emulator devices, and enumerated ISY programs, scenes and nodes.  You double click an item to add/remove it.  Seems to work pretty well.  Alexa is doing great work with the light management now.  The issue I ran into with 'not responding' was for an outletlinc.  I couldn't get the REST API to work for either a node, or scene end point.  I created a program with a simple then and else clause that changes the state and now Alexa controls that too.  I haven't hit the 28 node limit, but with my mapper could test the Echo limits by adding the same device a bunch of times with different names.  I ran into a similar problem controlling z-wave door lock state, but wrapped that in a program and voila, Alexa is locking the front door!

 

I have some polish to put on the mapper (it has very little error handling and some proto-UI stuff) but would be willing to share.  I am thinking about adding an automatic update to the Echo as well (forget ++ rediscover) but haven't decided yet if worth the effort...

 

C.

post-5743-0-62692900-1435073358_thumb.png

Edited by g1of4
Posted

I wrote a quick and dirty 'mapper' that uses the 1.3 JAR.  It reads off the emulator devices, and enumerated ISY programs, scenes and nodes.  You double click an item to add/remove it.  Seems to work pretty well.  Alexa is doing great work with the light management now.  The issue I ran into with 'not responding' was for an outletlinc.  I couldn't get the REST API to work for either a node, or scene end point.  I created a program with a simple then and else clause that changes the state and now Alexa controls that too.  I haven't hit the 28 node limit, but with my mapper could test the Echo limits by adding the same device a bunch of times with different names.  I ran into a similar problem controlling z-wave door lock state, but wrapped that in a program and voila, Alexa is locking the front door!

 

I have some polish to put on the mapper (it has very little error handling and some proto-UI stuff) but would be willing to share.  I am thinking about adding an automatic update to the Echo as well (forget ++ rediscover) but haven't decided yet if worth the effort...

 

C.

Hi,

 

This is cool. If you are willing to share, would be glad to take a look at it. 

 

Also, when you said "I created a program with a simple then and else clause that changes the state and now Alexa controls that too."   - you still needed to say "Alexa, turn xxxx lights ON or OFF" depending on the state? Or by simply saying "Alexa, kitchen lights", as an example and it will turn on or off kitchen lights accordingly, depending on its current state. 

 

I know that hue emulator is a switch - thus we need to supply onUrl or offUrl.  

 

Commands will be much easier if we dont need to say "on" or "off" and it is intelligent enough to execute commands accordingly.

 

Thanks.

Posted (edited)

I don't know that a third-party Echo app is going to be better than the HUE emulator, in that third-party apps have to be addressed by spoken name before speaking any related commands, e.g.:

 

Alexa, launch Home Controller and turn on kitchen lights,

Alexa, ask Home Controller to set basement thermostat to 55 degrees, or

Alexa, tell Home Controller to turn off all lights

 

That said, the programming looks pretty easy. I should have something in a week or two. As far as configuration for the masses, until Amazon adds configuration of app parameters to the Alexa SDK, I think you will need a third-party website to configure. I am using Amazon's DynamoDB to persist user settings (address and user ID/password for my ISY, scene names to URI mappings, etc.). It would be fairly straight forward to create a website to allow users to add a user ID, put in the configuration parameters, run a script to download scene and/or device names from the UDI, etc. and store all of that in DynamoDB.

 

Also, what this effort (and others, I suppose) could use is a place in the ISY data model to add a "spoken name" attribute for scenes and devices. I guess I could be put these in the notes field (are the notes accessible through REST?) for now until there is a better place to put them. Custom attributes, Michel?

Edited by kingwr
Posted (edited)

@kingwr

 

I think you hit the nail on head regarding all the user-interface issues that have to be resolved, how they could be resolved given the current Alexa API, and the fact that (until UDI is given the same device-level access Phillips was with their HUE products) any homegrown solution we unwashed developers come up with today will always appear a bit clunky due to the need for the three extra words "...tell <appname> to..." 

 

That said, I'm having fun experimenting with solutions while I wait for a more comprehensive API from Amazon.

 

-Randy

Edited by randyth

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.1k
    • Total Posts
      371.5k
×
×
  • Create New...