Jump to content

Amazon Echo and ISY


madmartian

Recommended Posts

I decided not to wait for the UDI Connected Home part and picked up a Pi last week.

 

First of all a huge thank you to everyone that has contributed to this thread, especially Barry for the configurator.

Started on the config yesterday, finally got it working around 2:30 this morning. 

I'm having entirely too much fun with this.

 

I have an outlet with a string of bubble lights for Christmas.

Called the device "Bubble Lights" of course.

Alexa has a little trouble with pronouncing bubble.

As she says I can't find the  boobley lights.

 

Ok you win  "Christmas lights" then.

Link to comment

Mohansen,

 

Can you please describe your Sonos/ISY set-up in more detail? I'm working on getting Echo/ISY going with the Alexa skill (sitting for too many minutes saying "Yes" every 10 seconds or so when devices are taking too long to refresh; I have ~ 150 devices found), and would like to integrate my ten Sonos zones as well. Do you think that's possible with your method?

 

I've splurged on Echos to place strategically around the house, but now have to figure out how to best name everything so Alexa will understand. If I fully understood what barrygordon was doing (yup, read all the pages, I think barrygordon is a godsend to us), I would implement the RPi2 I bought just for the HA Bridge approach, but I'm not a programmer and realized I too heavily need my hand held while setting up the appropriate file tree structure, and so on. I thought of just trying to run off my main PC, which is always on, or...now that I think of it...maybe off my Synology NAS?.... Or, wait for Amazon/Michel to finally reach "agreement" on the connected home.

 

Dean

 

Dean,

 

The first step is getting your ISY working with Sonos.  Others have documented this and it is available on the ISY Wiki

 

Once you have the ISY able to control one of your zones, you just need to add a network resource for each zone and each function per zone.  I have 7 zones and 42 different network resources.  I use Play, Pause, Mute, Unmute, Previous, and Next.  I have not added the volume up and volume down yet but that would be 2 additional resources per zone.

 

I then added 3 different programs per zone.  One program controls Play and Pause, the second controls Mute & Unmute and the third does Previous & Next.  The reason I used it this way is because each pair have common functions.  In each program I put one function in the Then clause and the other in the Else clause.

Sonos Deck Play - [ID 0004][Parent 0011]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Resource 'Sonos Deck Play'
 
Else
        Resource 'Sonos Deck Pause'
 

Once you have all these programs created, you then use Barry's configuration tool.  This will find all the devices/scenes/programs in the ISY.

 

For each program you want, create the friendly name, assign it to the emulator, etc.  Once you have all the programs mapped, update the Echo and you should be working.  You will notice that telling Alexa to turn on the device will actually run the Then part of the program.  Turning off will run the Else part.

 

Since the functions are similar, it is not that hard to remember.  I may change some of the friendly names and everyone will use what works for them.

 

Alexa, Turn On Sonos Deck,  this will execute the Play Network Resource on the Deck zone.  Notice I left Play out of the friendly name since this is the primary command.

Alexa, Turn Off Sonos Deck,  this will execute the Pause Network Resource on the Deck zone.

Alexa, Turn On Sonos Deck Mute,  this will execute the Mute Network Resource on the Deck zone.

Alexa, Turn Off Sonos Deck Mute,  this will execute the Unmute Network Resource on the Deck zone.

Alexa, Turn On Sonos Deck Next,  this will execute the Next Network Resource on the Deck zone.

Alexa, Turn Off Sonos Deck Next,  this will execute the Previous Network Resource on the Deck zone.

 

I left Sonos in the friendly name as it acts kind of like a skill.

 

There is a lot of Network Resources and Program but mostly it is copy and paste so not that complicated.

 

Morris

 
Link to comment

As you can see the HUE Emulator can handle at least three words in a friendly name. The process that the Amazon cloud uses to handle multiple word names seems quite robust.

 

I did notice one strange thing.  Most of my three word names relate to fans which are controlled by an Insteon Fanlinc. I have programs set up for each fan using the word Fan, followed by the room name, followed by any of the speed values (Off, Low, Medium, High, Faster, Slower). The program for faster/slower pulls the current speed and then moves to the next appropriate speed. I have no problem telling Alexa to deal with the fans.

 

The issue is that when I look at the Alexa app connected home devices, the fans are all dimmed and marked off line.  However they all work when I request Alexa to set them to a specific speed, go faster or slower or turn off. Does anyone know the reason for them being marked off line.  I do not command Alexa to adjust the fans very often in fact rarely if at all, but when I do they work just fine.

Link to comment

Are the files Sonos.zip and Sonos-NR.zip still intact?

 

I only get "empty file" and illegal format" errors when attempting to decompress or view them with Win 10.

 

I was able to download the zip files and extract the individual files without any problems.  I am using Windows 7.  On Windows, you should be able to see the individual files in the zip and actually extract and look at the file in Notepad.

 

I didn't try the import but it should work.  It did awhile ago.

Link to comment

The issue is that one I look at the Alexa app connected home devices, the fans are all dimmed and marked off line.  However they all work when I request Alexa to set them to a specific speed, go faster or slower or turn off. Does anyone know the reason for them being marked off line.  I do not command Alexa to adjust the fans very often in fact rarely if at all.

 

I have the same issue with some of the devices going offline.  It seemed to be associated to one emulator (I am running 3 different ones).  Today I only show one device offline.  For me, it does not seem to be a specific device type.  First it was everything on one bridge, today it is one light.

Link to comment

I noticed today that almost all my devices showed offline.  I think 1 or 2 showed online and were not grayed out.

 

Then I got to thinking it may be a timeout that if they are not being used, Alexa shows offline.

 

So I used Alexa to turn on a device, went back to the Alexa webpage and under the Connected Device page, this device now shows online.

Link to comment

So today I added a couple devices to the bridges (running 3 different bridges) and went to Alexa, forget all devices which is what I have done countless times and now the Echo will not discover any devices on any of the bridges.

 

I have tried multiple times, reboot the pi, tried multiple times, rebooted the Echo, tried multiple times.

 

Running 1.2.2 of the bridge.

 

Anyone else having issues?

Link to comment

I have not done a forget and re-discover recently, and based upon what you have said I probably won't.  When I did it the last time I had to tell the echo to discover devices (without forgetting) several times (4) before they were all recognized. I do not believe the Echo software has changed but it might have. Why don't you drop a line to Brad at BWS systems (support@bwssystems.com) and ask him to give it a try. I am running with HA Bridge 1.2,2 also.

 

R U sure nothing has changed on your network with regard to uPnP and the discovery of such devices? Router? Some New app using port 1900? 

Link to comment

Final update for the night.

 

Was able to get things working.  I could not run the rc.local on boot.  I run the same script after bootup and it seems to be more stable.

 

I am running the habridge in debug mode which seemed to help but it doesn't make sense.  I will try tomorrow without debug mode.

 

Running 1.2.3 of habridge and it seems to be working now.  Will see what happens in the morning.

Link to comment

Since all that the rc.local script does with regard to HA Bridge is start the app maybe the RPi has not yet completed its booting although rc.local execution should be the last thing in the boot process.  I sort of remember someone recommending a delay in rc.local prior to starting the bridge's.  It is somewhere in this thread. Do a thread search for the word sleep and you will see them.

Link to comment

Hello everyone,

 

Amazon has changed the Connected Home certification process (not the Skill) and most probably have changed how you communicate with Echo. As of right now, they require us to send devices to NAC to do certification! And, it will cost $$$. A little disappointing but I guess it was inevitable. On the skill side, we are almost there!

 

With kind regards,

Michel

Michel,

 

With this new information, can I assume you will still be moving forward with Connected Home Certification? This was the major reason for me moving forward with multiple Echo's as well as purchasing the ISY portal...

 

With warm regards,

Chuck

Link to comment

I had too much fun and bought a harmony hub.
 
So here's the updated complete setup documentation with the updated harmony hub inclusion:

 

Credits: updated shell script with modifications from apnar 
 

Here's my entire setup
 
The Amazon Echo project
 
Tools for this project
=================
1.  Raspberry Pi
2.  PC
3.  Amazon Echo
4.  Harmony Hub (optional)
 
Replace:  192.168.1.XX with the address of your ISY
Replace:  192.168.1.YY with the address of your Raspberry Pi
Replace:  192.168.1.ZZ with the address of your Harmony Hub
 
1. Setting up Raspberry Pi
 a.  Download NOOBS
 b.  SSH into Pi using user 'pi' and password 'raspberry'
 c. (Optional) Install TightVNC 
      Reference: http://www.penguintutor.com/linux/tightvnc
 d. (Optional) Set a static IP address for Pi
      sudo nano /etc/dhcpcd.conf
      add the following:

interface eth0
static ip_address=192.168.1.YY/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
interface wlan0
static ip_address=192.168.1.YY/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
      Reference: https://www.raspberrypi.org/forums/viewtopic.php?p=798866#p798866
 
2.  Run HA Bridge
 a.   In RPi, wget latest jar from https://github.com/bwssytems/ha-bridge/releases
 b.   (optional but recommended) Make a symbolic link to the downloaded jar so that all the scripting are simplified when there is an update: 
       
cd /home/pi/echobridge
ln -fs ha-bridge-1.2.3.jar ha-bridge.jar
 c.   Run 
nohup java -jar -Dvera.address=192.168.1.XX -Dupnp.config.address=192.168.1.YY -Dserver.port=8081 -Dupnp.response.port=50001 -Dupnp.device.db=/home/pi/echobridge/data/device81.db /home/pi/echobridge/ha-bridge.jar > /home/pi/echobridge/logs/log81.txt 2>&1 &
 c.   Goto 192.168.1.YY:8081 to ensure emulator is running
 d.   Modify /etc/rc.local file in Pi to start emulator(s)
sudo nano /etc/rc.local
        Add the following:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi


#The following is for multiple emulators on the same machine
echo "Starting the Echo Bridge Emulators"


Amazon_Echo_IP=192.168.1.XX
echo "Amazon Echo address is: $Amazon_Echo_IP"


ISY_IP=192.168.1.YY
NUMBER_OF_BRIDGES=1
BASE_PATH=/home/pi/echobridge
#Linked File
JAR_FILE=${BASE_PATH}/ha-bridge.jar


STARTING_PORT=8081
STARTING_UPNP_PORT=50001
HARMONY_PORT=8090
HARMONY_IP=192.168.1.ZZ
HARMONY_USER=XXX
HARMONY_PWD=XXX


DATA_PATH=${BASE_PATH}/data
LOG_PATH=${BASE_PATH}/logs


# Make directoris if they don't exist
[ ! -d ${DATA_PATH} ] && mkdir -p ${DATA_PATH}
[ ! -d ${LOG_PATH} ] && mkdir -p ${LOG_PATH}


echo "Starting the Echo Bridge Emulators"
for i in $(seq 1 ${NUMBER_OF_BRIDGES})
do
 nohup java -jar -Dvera.address=${ISY_IP} -Dupnp.config.address=${_IP} -Dserver.port=${STARTING_PORT} \
   -Dupnp.response.port=${STARTING_UPNP_PORT} -Dupnp.device.db=${DATA_PATH}/device_${STARTING_PORT}.db \
   ${JAR_FILE} > ${LOG_PATH}/log_${STARTING_PORT}.txt 2>&1 &
 STARTING_PORT=$((STARTING_PORT + 1))
 STARTING_UPNP_PORT=$((STARTING_UPNP_PORT + 1))
done


#Running Harmony emulator separately
#Remove the # if you have Harmony Hub
#echo "Starting Harmony emulator at $HARMONY_PORT"
#nohup java -jar  -Dupnp.config.address=${_IP} -Dharmony.address=${HARMONY_IP} -Dharmony.user=${HARMONY_USER} -Dharmony.pwd=${HARMON_PWD} -Dserver.port=${HARMONY_PORT} -Dupnp.response.port=${STARTING_UPNP_PORT} -Dupnp.device.db=${DATA_PATH}/device_${HARMONY_PORT}.db  ${JAR_FILE} >${LOG_PATH}/log_${HARMONY_PORT}.txt 2>&1 &


echo "the rc.local script has completed."
exit 0
 


3.  Run AWS configurator
 a.   Download exe from http://www.the-gordons.net/homepage/DLF_AWS_Config.html
 b.   Install 
 c.   Open notepad in adminstrator mode and edit c:\programs files(x86)\AWS_Config\AWS_config.ini accordingly
 d.   Open AWS Configurator and add the devices and scenes to the emulator(s)
 
 (Harmony Hub note:   Do Not enable the Harmony Hub section in the config.ini!  That section is no longer needed from ha-bridge 1.2.1 onwards)
 
4.   (Optional if you have Harmony Hub)
  a.  Goto 192.168.1.ZZ:8090
  b.  Add all the harmony activities and devices
  
5.  Configure Echo
 a.   Goto: echo.amazon.com/#settings/connected-home  to login and configure Echo
 b.   Say "Alexa, discover my devices" to add devices to it.  You may have to do a few times.

 

Link to comment

Jackal,

 

To load the configurator you need to go to www.the-gordons.net and follow the links on the bottom of the main page.

 

You stated:

 

(Harmony Hub note:   Do Not enable the Harmony Hub section in the config.ini!  That section is no longer needed from ha-bridge 1.2.1 onwards)

 

The Harmony HUB section of the AWS_Config.ini is needed if you want to use the configurator to enter the harmony data. If you are using the HA Bridge to do that then you are correct.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...