Jump to content

Amazon Echo and ISY


madmartian

Recommended Posts

Posted
A brief status update:

 

I have three RPi's running the same SD card all with the bridge emulator installed. The only thing different is the host names which I change using raspi-config. All cards start as the Raspbian OS from the NOOBS image at RaspberryPi.org. They then get the emulator and tightvncserver installed. I modify the rc.local file which is run at every boot just before the gui is started to start the emulator and tightvncviewer in the background. The RPi's all run wired with no mouse or keyboard (headless). The same SD card is used in every machine and is a 16Gig image file.

 

I do all my work from my office on a nice development system with very fast drives (15,000 RPM), a high speed 7 core processor and 16gig of RAM. I use WINSCP (Google it) to move files between by RPi's and windows and tightvnc cliient to directly deal with the RPi's. The RPi's are mounted on a wall in my electronics room which has all the HA equipment for the house. This includes three rack mounted servers, and a 21 TB NAS expandable to 44 TB. The electronics room has its own UPS and the house has a standby generator so I get very high up-times measured in years as long as I don't take systems down. The NAS was actually up for 2+ years before I took it down to upgrade the OS. When I say UP I mean no stops for any reason what so ever.

 

Eventually one of the RPi's will get stunnel, the Skills server and the External server.  These three items are currently running as "auto start at boot" on a PC that runs 24/7. 

 

The Skills server will be the most flexible.  The External server is used with the bridge to handle things other than the ISY994 such as my Autelis pool controller and my PC controlled Theater. Anything using the bridge is currently limited to "turn on" and "turn off". Dimming has a bug that I believe is an Echo bug, and not a bridge issue. It seems any spoken brightness level e.g. "Alexa turn on the kitchen lights at XX percent" has Alexa telling the bridge that the desired brightness is either 51 or full on. The emulator has a full configuration system built in as a web server at 8080. I am running 0.4.2 of the emulator.

 

The Skills server currently accepts very limited intents and utterances, as I have been busy getting everything else stabilized. I just need to sit down and develop all the utterances I want the Echo to handle and than write whatever special code I need. In its current state it shows activity messages indicating what was sent from Alexa as an intent which breaks the utterance that was recognized into slots providing a name value pair such as {"room":"'kitchen", "light:"Ceiling"} Essentially the Echo has parsed the phrase that was heard, making life easier for the coder (me).  

 

My current Echo configuration is a total of 72 devices. 67 are on the ISY994, 3 are for my pool (SPA, Waterfall, Pool lights), 1 for starting my Home Theater, and one is for testing dimming. I have about 7 groups on the Echo with names such as "Kitchen Area" which I basically use as "turn Off" functions. Responsiveness is quite fast under 2 seconds from when I say something till the action completes and Alexa says "Okay". There are currently 2 Echos in the house. 
Posted

 

A brief status update:
 
I have three RPi's running the same SD card all with the bridge emulator installed. The only thing different is the host names which I change using raspi-config. All cards start as the Raspbian OS from the NOOBS image at RaspberryPi.org. They then get the emulator and tightvncserver installed. I modify the rc.local file which is run at every boot just before the gui is started to start the emulator and tightvncviewer in the background. The RPi's all run wired with no mouse or keyboard (headless). The same SD card is used in every machine and is a 16Gig image file.
 
I do all my work from my office on a nice development system with very fast drives (15,000 RPM), a high speed 7 core processor and 16gig of RAM. I use WINSCP (Google it) to move files between by RPi's and windows and tightvnc cliient to directly deal with the RPi's. The RPi's are mounted on a wall in my electronics room which has all the HA equipment for the house. This includes three rack mounted servers, and a 21 TB NAS expandable to 44 TB. The electronics room has its own UPS and the house has a standby generator so I get very high up-times measured in years as long as I don't take systems down. The NAS was actually up for 2+ years before I took it down to upgrade the OS. When I say UP I mean no stops for any reason what so ever.
 
Eventually one of the RPi's will get stunnel, the Skills server and the External server.  These three items are currently running as "auto start at boot" on a PC that runs 24/7. 
 
The Skills server will be the most flexible.  The External server is used with the bridge to handle things other than the ISY994 such as my Autelis pool controller and my PC controlled Theater. Anything using the bridge is currently limited to "turn on" and "turn off". Dimming has a bug that I believe is an Echo bug, and not a bridge issue. It seems any spoken brightness level e.g. "Alexa turn on the kitchen lights at XX percent" has Alexa telling the bridge that the desired brightness is either 51 or full on. The emulator has a full configuration system built in as a web server at 8080. I am running 0.4.2 of the emulator.
 
The Skills server currently accepts very limited intents and utterances, as I have been busy getting everything else stabilized. I just need to sit down and develop all the utterances I want the Echo to handle and than write whatever special code I need. In its current state it shows activity messages indicating what was sent from Alexa as an intent which breaks the utterance that was recognized into slots providing a name value pair such as {"room":"'kitchen", "light:"Ceiling"} Essentially the Echo has parsed the phrase that was heard, making life easier for the coder (me).  
 
My current Echo configuration is a total of 72 devices. 67 are on the ISY994, 3 are for my pool (SPA, Waterfall, Pool lights), 1 for starting my Home Theater, and one is for testing dimming. I have about 7 groups on the Echo with names such as "Kitchen Area" which I basically use as "turn Off" functions. Responsiveness is quite fast under 2 seconds from when I say something till the action completes and Alexa says "Okay". There are currently 2 Echos in the house. 

 

 

Can I ask why the RPi's?  When you have three servers running?  Just curious.  Couldn't you get 28x3 more devices by installing the emulator on the servers as well as the RPi's?

Posted

Can I ask why the RPi's?  When you have three servers running?  Just curious.  Couldn't you get 28x3 more devices by installing the emulator on the servers as well as the RPi's?

 Or for that matter, what about running lightweight Linux VMs on an existing device?  I planned to look into Tiny Core Linux, or similar, to create a minimal image that I could duplicate and spin up as needed.

Posted

I am attempting to develop my RPi skills. Eventually I would like to phase out the Win 7 soon to be win 10 servers My real goal is to have all the emulators running on a single RPi if that ends up as possible. I have to look at the addressing variances.  AFAIK the Echo should find each emulator using the uPnP search, and retrieve both the IP and the Port from the Notify reply to the search. The question is will the echo use the port address it receives.  Right now I am moving my stunnel to an RPi.  The emulator I am using max's out at 40 devices AFAIK.  I have 37 on one of them. 

Posted

I am attempting to develop my RPi skills. Eventually I would like to phase out the Win 7 soon to be win 10 servers My real goal is to have all the emulators running on a single RPi if that ends up as possible. I have to look at the addressing variances. AFAIK the Echo should find each emulator using the uPnP search, and retrieve both the IP and the Port from the Notify reply to the search. The question is will the echo use the port address it receives. Right now I am moving my stunnel to an RPi. The emulator I am using max's out at 40 devices AFAIK. I have 37 on one of them.

Same here. I would like it all running on a single RPi since they use very little power. I am playing with the upnp for the fauxmo to try and get the echo to see more that 15 devices, my initial attempt didn't work so I am studying up on upnp... I prefer fauxmo since it's lighter weight than the hue java program, can be called within my ISYHelper and I'm better at python.
Posted

The new version of the emulator by bwssystems is a much more concise version of the emulator.  That is why it can support 40 devices. I know the echo does a proper uPnP search and that emulator responds properly providing the location as IP:Port. If the Echo obeys the rules getting three emulators running on the RPi should simple.  Right now I am trying to get stunnel up and running on the RPi.  If I can do that I suspect I will be able to get the stunnel proxy and multiple emulators on the same RPi.  Traffic flow should be low so response should not degrade. Hopefully I will have it resolved by the end of this weekend.

Posted (edited)

I just got stunnel running on my RPi. Appears to be working fine, forwarding my intents/utterances to my skill endpiont running on a PC. I have one question that perhaps a Unix guru can help me with.  If I do a  ps -ef | grep stunnel in terminal I get 6 replies marked as stunnel as follows:

 

root  2207   1 0 16:36 ?   00:00:00 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf 

root  2208   1 0 16:36 ?   00:00:00 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf 

root  2209   1 0 16:36 ?   00:00:00 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf 

root  2210   1 0 16:36 ?   00:00:00 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf 

root  2211   1 0 16:36 ?   00:00:00 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf 

root  2216   1 0 16:36 ?   00:00:00 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf 

 

I expected to see just one entry.  This seems to imply to me that there are 6 stunnel process running. Can anyone tell me why or where I should look if it is a problem.

 
 
From what I have researched stunnel just uses threads for efficiency.  On Linux based OS's threads get Process ID's so they appears as processes, but they really are just threads of the same process AFAIK 
Edited by barrygordon
Posted

When you install 2d Echo to the  same network, how does the config tool (on iOS) know which Echo to set up? 

 

If I want to add the same set of devices to the 2d Echo, should I just run discovery on it and it will find the same bridge as the 1st one uses?

 

Thanks.

Posted

The two Echos will know about the same bridges after you do a discovery so they will act identically.  In fact if they both hear what you said the command will be sent twice, once from each Echo.

Posted

A few days ago someone turned me on to WINSCP (Google and download it)  I am finding it invaluable in dealing with the RPi's I am running.

 

WINSCP allows you to define a session with a Unix device. When you set up the session it will ask for the IP of the device and a userid and password for the device. It will then open a window with two panes. The lift pane will have a windows directory, and the right pane a directory from the Unix (RPi) machine.  You are now in the windows world and for the most part do not have to worry about Unix commands. In the beginning I suggest you sign on as Pi with a password of Raspberry assuming you are running a standard build and have not changed the userid and password.

 

If you are comfortable, then redo the session signing on as user root with password root. You can now edit any thing on the target machine using the standard windows text editor, "notepad" or any other you might have set up as the default.  BE CAREFUL you can now edit/destroy files you should not touch. You are running as root!

Posted

I see many here use RPi to run bridge. Just wanted to add that I have been usin Sinology station with great success. I have 2 of them, one as a file storage and another to control cameras. They are On 24/7 and it works very well. The only trick was to install java manually because the new version is not in the standart repository yet.

 

I am still using amazon-echo-bridge-0.2.1 version. It is 21 days old but I cannot find any new build on GitHub. Is this still the latest?

Posted

Hi.  I have been away for 6mo doing work, want to refresh my HA.  I have ISY, Vera, Smarthings, Echo, DSCLink (running on Pi along with interface to my heating system).

 

This thread at 21 pages is a little hard to parse!  Might someone give me some simple steps/pointers of what I need to download/do in what order to get the Echo controlling my devices?

I am happy to go research and learn, but a little confused what to do in what order!?  (I am hoping barrygordon can supply <grin>)

Posted

Hi.  I have been away for 6mo doing work, want to refresh my HA.  I have ISY, Vera, Smarthings, Echo, DSCLink (running on Pi along with interface to my heating system).

 

This thread at 21 pages is a little hard to parse!  Might someone give me some simple steps/pointers of what I need to download/do in what order to get the Echo controlling my devices?

I am happy to go research and learn, but a little confused what to do in what order!?  (I am hoping barrygordon can supply <grin>)

 

Yes, it would have been nice to have a sub-forum for the Echo instead of this huge thread.   I assume you are asking how to have the Echo control your scenes thru the ISY.  If so, the first post details the methods, although there are new versions of the Hue Emulator and WeMo Emulator now, and there is a separate program to generate a config file for the Hue Emulator.   A few people are working on different ways to set this up, my work has been to integrate the WeMo emulator into my python program running my my RPi  https://github.com/jimboca/ISYHelper which allows you to use the Spoken note configured directly in the ISY, or run IFTTT Maker actions. The only issue is you are limited to 16 devices registered to each RPi.

Posted

A few days ago someone turned me on to WINSCP (Google and download it)  I am finding it invaluable in dealing with the RPi's I am running.

 

WINSCP allows you to define a session with a Unix device. When you set up the session it will ask for the IP of the device and a userid and password for the device. It will then open a window with two panes. The lift pane will have a windows directory, and the right pane a directory from the Unix (RPi) machine.  You are now in the windows world and for the most part do not have to worry about Unix commands. In the beginning I suggest you sign on as Pi with a password of Raspberry assuming you are running a standard build and have not changed the userid and password.

 

If you are comfortable, then redo the session signing on as user root with password root. You can now edit any thing on the target machine using the standard windows text editor, "notepad" or any other you might have set up as the default.  BE CAREFUL you can now edit/destroy files you should not touch. You are running as root!

 

Why not just start samba on your RPi? :-)  Pretty simple, then you can just add network location on your windows machine.  http://raspberrywebserver.com/serveradmin/share-your-raspberry-pis-files-and-folders-across-a-network.html

Posted

Samba is another way of doing it.  With Winscp you don't have to do anything no installs on the Unix box and it just runs. I have Samba on every PC in the house and on the NAS which is a Unix based system.  I was going to put it on the RPi's but this was trivial and has a really nice user interface. 

Posted (edited)

Yes, it would have been nice to have a sub-forum for the Echo instead of this huge thread. I assume you are asking how to have the Echo control your scenes thru the ISY. If so, the first post details the methods, although there are new versions of the Hue Emulator and WeMo Emulator now, and there is a separate program to generate a config file for the Hue Emulator. A few people are working on different ways to set this up, my work has been to integrate the WeMo emulator into my python program running my my RPi https://github.com/jimboca/ISYHelper which allows you to use the Spoken note configured directly in the ISY, or run IFTTT Maker actions. The only issue is you are limited to 16 devices registered to each RPi.

Thanks,

 

1) are there any reason to select hue emulator vs hue bridge app vs wemo emulator?

2) do I need the emulator if I have real hue? I was confused by the mapper apps instructions....

3) does anyone have insight into the statements some have made about UDI doing Echo support?

4) I haven't figured out what or where stunnel fits in?

5) same for skills server...?

Edited by Scyto
Posted

Thanks,

 

1) are there any reason to select hue emulator vs hue bridge app vs wemo emulator?

2) do I need the emulator if I have real hue? I was confused by the mapper apps instructions....

3) does anyone have insight into the statements some have made about UDI doing Echo support?

4) I haven't figured out where stunnel fits in?

1) the wemo was simplier to setup, and already inside ISYHelper :wink: is written in python which is easier for me to modify, and seems much faster than calling the Java Hue emulator, at least for me, but is limited to 16 devices, which seems to be an Echo limit. I'm trying to get the python Hue emulator working with the Echo, since I have it working with my harmony hub already.

2) yes, the emulator fakes out the Echo into thinking it's talking to a Hue hub, but it's talking to the ISY.

3) There is a post somewhere, I think in this thread from Michel, and I'm pretty sure he said it will use the new portal, but not positive.

 

 

Sent from my Nexus 7 using Tapatalk

Posted

I just installed 2d Eco in vacation house. Upon setting it up with my Amazon account I found that I can control all my devices in the primary home 100 miles away without even running bridge software at vacation house. Does it mean that my ISY access info including passwd can be stored at Amazon clouds?

Posted

Yes, it would have been nice to have a sub-forum for the Echo instead of this huge thread.  ...

 

 

It's not too late for that...  This thread is way confusing, and this device (Echo) seems to warrant something better organized.

 

If I knew how to get a sub-forum created, I'd do so -- perhaps some of the more senior members here know how and can do it.

Posted (edited)

Scyto asked:

1) are there any reason to select hue emulator vs hue bridge app vs wemo emulator?
2) do I need the emulator if I have real hue? I was confused by the mapper apps instructions....
3) does anyone have insight into the statements some have made about UDI doing Echo support?
4) I haven't figured out what or where stunnel fits in?
5) same for skills server...? 

 

To make things easier, I will refer to the original emulator as the "Emulator" and the new version as the "Bridge"

 

1) I know nothing about the "Wemo" unit. The "Bridge" allows for about 40 or so devices before it max's out. The mapper app is not needed as the "Bridge" has a built in web server and using a browser and the web pages provided in the "Bridge" complete control over defining your devices is available with a nice graphical interface.

 

2) If you have a real HUE then it will only control the Philips devices AFAIK. It definitely will not control the UDI ISY994 family (the "ISY"), nor will it control any other HA controllers like the Autelis line of pool/SPA controllers. The same statement is probably true of the Wemo or the Wink. Using the "Bridge" I can control the ISY by sending it any REST command I want and the same for other devices that accept some control over IP, UDP, RS232, or IR; if you are willing to write some code. I am currently controlling 72 devices using multiple "Bridge" units. 67 are on an "ISY" the rest or on an Autelis controller and a PC system. The Echo system, no matter what it is controlling, only allows the use of certain phrases ("Utterances" in Amazon Speak). They must begin with the wake up word and the uses a simple command syntax (when talking to a bridge/emulator) such as "Turn on", "Turn Off", "Dim". Using the Echo Remote, small hand held IR remote like device, you can skip the wake up word as you press a button the remote to wake up Alexa and just say the desired phrase such as "Turn on the kitchen lights". The remote uses Bluetooth and is paired with a single Echo.

 

3) I believe that UDI has begun to develop some sort of interface to the Echo but are in the very early stages. As usual, in the early phases of development developers do not like to issue ETA's and make promises.

 

4) If you want to get away from the simple phrases and say things such as "Set my bedroom Air conditioner to cool at 872 degrees". Then you need either to use a skill developed by some developer or write your own skill. A skill consists of Utterances, sentences you want the echo to recognize; Intents, the way you wish the Utterance to be interpreted; and an end point. The things the Echo can do such as tell you the weather, give you news, play music are all skills. Endpoints are the code that do the work once the spoken phrase has been recognized and parsed by the Echo. The results of the parsing is sent to the end point.  The end point can be in the 'Amazon Cloud" or on your own LAN as a private end point.  If the endpoint is in the cloud expect to pay some money for using it unless you wrote it, and then you might have to pay Amazon for use of their cloud. If the endpoint is on your LAN the cost is practically $0) but you have to write it. All LAN based endpoints must use SSL (HTTPS) with Certificates. This means you have to deal with encryption and decryption using public/private keys which is non trivial.

 

5) The stunnel is a small software app that runs on a PC or an RPi, or a Linux system (any machine that runs Java). It provides an SSL wrapper to any other app  that accepts HTTP but not HTTPS. Basically you tell your router to send all incoming SSL traffic to the stunnel app, and tell the stunnel app where to send the clear-text (HTTP) to. This works both ways decrypting incoming messages and encrypting those it sends out. It does not appear to interfere with a standard web server (Apache, Chrome, etc) as Yahoo which uses HTTPS is still working on my systems. stunnel handles all of the certificate verification and provides the tools needed to build your own certificate, either self signed or signed by a Certificate Authority such as Verisign.

 

I hope the above clarifies the state for Scyto and others.  I plan to be able to supply a Micro SD card image with the standard Raspbian as the OS, tightvncserver and the ha-Bridge all installed. I will not charge for it and will send it via sendspace (similar to DropBox). It will probably be 16 G unless I can find an app to shrink a 16 Gig image to 8 Gig or 4 Gig. It will require minimal effort, 1) burn the image to a micro SD using Win32DiskImager, 2) put the card in the RPI, 3) start the RPI, 4) change the host name if you want. 5) Enter into the start command the address for the ISY on your network. I am going to discuss with the author having the "Bridge" do a search for the ISY to eliminate the need to make that change.  It will handle DHCP so no need to adjust the RPi IP address. If it is running the Echo will find it.

 

I prefer the "Bridge" over the "emulator" for the reasons stated in (2) and that it is being very actively supported by the author (bwssystems.com). I am discussing with him an ability to start multiple "Bridges" on a single RPi for an unlimited number of devices. He is actively pursuing the use of a Harmony system with the "Bridge", there currently being a discovery issue (discovery is via uPnP). The Dim command is not working correctly but we both believe it to be an Amazon problem and they have been notified. 

 

I am now off to get my Sunday breakfast and read the NY Times. Be back later since I have some code to write.

Edited by barrygordon
Posted

I'm Sorry, but isn't this 21 page thread a sub-forum.  I grant you it is not explicitly recognized as such, but you go to the "How are you using the ISY" which is a forum or is it a subforum?; and you click on the top item which is held there and here you are.

Posted

I'm Sorry, but isn't this 21 page thread a sub-forum.  I grant you it is not explicitly recognized as such, but you go to the "How are you using the ISY" which is a forum or is it a subforum?; and you click on the top item which is held there and here you are.

 

I fully support the idea of making Echo a sub-form all to itself.  I think this will be one of the hottest development areas for ISY in quite some time.  I think this is even more important than the ELK integration that was done several years ago.  Having this buried in this forum will result in too many cross-posts in the other forums I think.  

Posted

Hi blueman2,

 

I do agree but I prefer waiting for our solution to come out first so as to not confuse the official solution (cloud based).

 

With kind regards,

Michel

 

Fully agree.  And since I did not see a thumbs up icon in our library.....

 

...../ )

.....' /

---' (_____

......... ((__)

..... _ ((___)

....... -'((__)

--.___((_)

Posted (edited)

barrygordon - thanks, perfect answers, I am very intrigued by stunnel, will go research, I have a full public cert I use for HTTPS access to my synology, being able to https protect other traffic is definitely useful.

 

I guess what we want is some sort of ISY solutions for skils / ability to add  ISY community skills.

 

Right off to get various bits and start poking.  Something else my trust rpi can do.  BTW I just install xrdp with 'sudo apt-get xrdp' - this installs everything needed to RDP into the machine, my preferred client is currently bitvise (free) but I am going to give winscp as you recommended it!

 

--edit--

is it possible to run the ha-bridge with the java -cp flag to run it headless (this is what I do with my dscServer.jar file....)

 

--edit2--

hmm before I go headless I guess I need to get it working.  I assume that Dvera.address is the IP address of either a vera OR the ISY.  If so how do I provide password / username?

I actually have all my ISY devices (but not scenes) running in Vera already (and the vera is the primary z-wave controller until my ISY 5.0 has multi devices enabled) - any recommendations on approach?  I am going to try straight to the ISY first...

 

--edit3--

ah I think I jumped into fast, the bws ha-bridge doesn't seem to enumerate anything from the ISY - right?  I now assume when you said 'write code' you meant for me to handcraft the on/off URLs in manual add?  right?

 

--edit4--

ok, I worked out I can use the ISY to Hue Mapper to add devices to the bws ha-bridge version of the emulator by adding the devices in the mapper and clicking combination of update echo and save.  I then have to click GO in the has bridge that then adds them to the configuration page.

 

--edit5--

ah the  -Dupnp.config.address= parameter seems to be critical, without this the code defaults to 127.0.1.1 - which is odd as that is not a valid localhost address of 127.0.0.1 or 0.0.0.0 which is what most other java apps on pi bind too (i.e. they just automatically bind to the first and only app address).  the text file would indicate it should default to the first ip address, it doesn't so I guess it is a bug!

 

Right now the alex works!

Edited by Scyto

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.


×
×
  • Create New...