Jump to content

Amazon Echo and ISY


madmartian

Recommended Posts

Posted

@rizast

 

Are you sure that you have correctly set the uPnP config address on the invocation line for the jar?  Per my experience if this doesn't get set correctly then the Echo won't find the bridge and hence won't find any devices.

Posted

kck,

 

I do not see the Spoken field on the Notes dialog.  I know I used to.

 

I am running firmware 4.3.26 and UI 4.2.30.  What UI are you running?

Posted

I'm running 4.3.26 UI as well.  I think in general UDI suggests you always run the same versions of the firmware and UI or you can see mismatches like you are seeing.

 

Kevin

Posted

rizast,

 

What does your network look like with regard to IP address for the Emulator and the Echo.  I suspect a network issue.  Are all firewalls off and are uPNP searches enabled ?

 

It would help if you told us what configuration of the Hue emulator you are running and what you are using as the configuration (mapper) program, If you are running my Configuration system, then send me the log file of the last time you ran it.

 

With regard to the emaulator, turn on the debug option and send that log.  You will need to do a fresh start after turning the debug option on. 

Posted

kck,

 

Got it.  Needed to update the console.  Expect a new version of AWS_Config that handles the Spoken Field of the Notes Item this weekend.  I will post here when it available.

Posted

Where does one get that UI? When I upgraded I just manually upgraded from the 4.3.26 Firmware.  Point me to the matching UI and I should be good.

 

http://forum.universal-devices.com/topic/17075-release-4326-is-now-official/?p=151462

 

Clear Java Cache first then download and install either the application or applet (scroll post to 4. IMPORTANT )

 

 

 

Jon...

Posted (edited)

First I would like to echo what has been said multiple times on this thread, great work on everyone working through the issues that come up with trying to integrate all the disparate pieces.

 

I wanted to contribute my part on what I don't think has been covered in the 46 pages of this thread.  And I have read the pages multiple times.  I have had my ISY integrated with Elk for several years.  Works well.  On my Elk I have 3 thermostats and I am able to control them easily through the ISY.  So today I wanted to get the Echo to control my thermostats.  After a few attempts, looking at packet debugs, etc. I got it working.

 

  • Add a device using Barry's configuration tool.
  • Changed the Friendly name to something easy to use, Main Thermostat, Upstairs Thermostat, etc.
  • DeviceType needs to be Dimmer
  • The On URL looks like this:  rest/elk/tstat/1/cmd/6?value\u003d${intensity.math(X/255*100)}
  • The 1 is for my first thermostat, the 6 is for Heat and the \u003d is hex for an equals sign and then I needed to convert the requested temperature back to something the ISY/Elk understands.  For Cool setpoint, change the 6 to a 5.
  • As others have indicated, to use the Echo for thermostat control, say "Alexa, Set Main Thermostat to 68"

 

I also use my ISY to control my Sonos.  I have setup Network Resources within the ISY for each Sonos zone and what I want the zone to do (ie. play, pause, mute, unmute, etc.)  To get this working with the Echo, I did the following:

 

  • Create a program on the ISY, I did not put anything in the If section, For the Then section, I entered the Network Resource for the specific zone I want to play, and finally in the Else section, I put the Resource for Pause.  I did a separate program for each zone I wanted to play/pause and the same for mute/unmute.
  • Now in Barry's tool, the programs I created above show up, I added the program and made the On URL be the Then section and the Off be the Else section.  I used a Friendly name like Sonos Deck, Sonos Family Room, etc.
  • To use Echo, I say "Turn Sonos Family Room On" and it starts playing whatever is in the queue.  "Turn Sonos Family Room Off", pauses whatever is playing. To play next track, "Turn Sonos Family Room Next On"
  • You could easily drop Sonos from the friendly names.  I still need to figure out the naming convention I want to use.

The last step I did was to have a program in the ISY that shuts off all devices (lights) on each floor, turns off the Sonos, and set the temperature for sleeping.  "Alexa, Turn Bedtime On" and everything shuts down and adjusts the thermostats.

 

I can't wait to see what others come up with and what Izzy will add to the solution.

Edited by mohansen
Posted

The major change to enable that ELK capability was the inclusion of ${intensity.math(f(x)}. That was included by BWS Systems a month or so ago at the request of I believe BlueMan2. What's nice about small independent developers is that they are generally very responsive. There are some Amazon issues with the discovery of device which IMHO have always been there.  At the current time I run 4 instances of the emulator and all my devices are found by the Echo with 2-3 tries. Since I do not add devices too often it is a non-issue for me. I almost never change the settings on my Z-Wave thermostats so I have never implemented voice control for them.

Posted

I have just posted a new version (5.0.40) of the configuration program for the HA Bridge on my web site (www.the-gordons.net).

 

The major change is the ability to process the 'Spoken' entry of an ISY devices 'Notes' dialog. A change to the ini file is required for this feature to be made operable so backwards compatibility is assured. If the ini file is not changed the program works as before, If the ini file is changed but no device has a 'Spoken' entry then the program works as before for that device.  If the ini file is changed and a device has a non-blank spoken field in the ISY; then the entry specifies which name, Spoken or Device,  will be displayed ehrn that device is selected as the device to be edited in the device editor pane.  A button is provided to switch between the two names in this case.  As always the friendly name can be manually changed to what ever is desired.

Posted

Barry,

 

Thanks for the quick reply. sorry im getting back to you a day late. I have UPnP turned on and the windows firewall is off. I have three access points all with multicast turned on.  My DHCP machine is my domain controller (Windows2012).  The echo is online and working. I also have a sonicwall firewall. I ran a network scan from the same wifi the echo is on from my iPhone using an app called net analyzer. it was able to find all devices on my network. I haven't used your configurator. Im using Mapper 00012.  it finds my isy and all devices no problem,

 

Here is the command line I run for the JAR.

 

java -jar -Djava.net.preferIPv4Stack=true c:\echo\amazon-echo-bridge-0.1.3.jar --upnp.config.address=192.168.1.31

 

 

I've also tried using. 0.2.1 - same results

 

 

 

 

 

Posted

I am not at all familiar with the software you are running.  Most people are running the emulator from BWS Systems (bwssystems.com). the current version is 1.2.1.  The configuration program for the emulator is at my site www.the-gordons.net and can be downloaded from there.

 

Most people run their emulator on a Raspberry Pi, but all that is needed is a machine running Java 8

 

I can not help you with what you are using.

Posted

I was using the info from the first page of this thread. I will read up on what is involved in getting this setup using your software and the emulator from BWS.

Posted

rizast I'm using the same stuff. Mine stopped probably the same time yours did, not sure what changed or if I changed something. I just ended up updating the emulator from bws systems. Then used the same mapper except had to add all my devices back in one by one. Then it worked fine again.

Posted (edited)

Need a bit of help trying to setup the BWS emulator on my new RPi2 (I'm a noob at RPi but do try to learn by searching and reading)

 

I have been trying to closely follow barrygordon's and jackal's excellent posts on getting things configured, but I am not getting the emulators to successfully start.

 

I have copied the latest ha-bridge.1.2.1.jar into home/pi/echobridge

 

When I enter the suggested run command (modified with my ISY and RPi IP addresses)

 

nohup java -jar -Dvera.address=192.168.1.45 -Dupnp.config.address=192.168.1.75 -Dserver.port=8081 -Dupnp.response.port=50001 -Dupnp.device.db=/home/pi/echobridge/data/device81.db /home/pi/echobridge/ha-bridge-1.2.1.jar > /home/pi/echobridge/logs/log81.txt 2>&1 &

 

I get no response when I try going to 192.168.1.75:8081

 

However, if I enter only

 

nohup java -jar -Dvera.address=192.168.1.45 -Dupnp.config.address=192.168.1.75 -Dserver.port=8081 -Dupnp.response.port=50001 /home/pi/echobridge/ha-bridge-1.2.1.jar

 

I get the following in terminal:

 

nohup: iognoring input and appending output to 'nohup.out'

 

But I CAN successfully access the ha-bridge when I goto 192.168.1.75:8081

 

On my RPi, I initially only created the home/pi/echobridge folder and put the jar file in it.

 

I thought perhaps the command references to the data/device81.db and the logs/log81.txt needed to exist as well so I tried creating them as empty files. But that had no effect.

 

Obviously I don't have something configured or typed correctly in the suggested full command, but I haven't been able to figure it out.

 

Any help is greatly appreciated.

Edited by rossarmstrong
Posted

 

I thought perhaps the command references to the data/device81.db and the logs/log81.txt needed to exist as well so I tried creating them as empty files. But that had no effect.

 

I think you are on the right track .. I just had a very similar issue, which was due to the logs directory not existing.  Are you doing this at the command line or in rc.local?

Posted

I initially used the command line in order to ensure the jar ran correctly.  When I had success with the shortened command, I went ahead and modified my rc.local, just as barrygordon described to run 4 emulators. But when I rebooted, no emulators started.

 

So I also think my issue is with the device and log files/directories. I can't find info describing the syntax of -dupnp to try and figure it out. 

Posted

Are the bridges not starting or just not responding to uPnP?  If you aren't sure do a "ps aux | fgrep jar" and see what is actually running. You should see an entry for each bridge process (plus one for the ps command itself).  If you don't then your problem is that the bridges either aren't starting or failing.  If you see the processes then they are running but not responding correctly to the Upnp traffic. 

Posted

Also - if the bridges seemed to work when started manually but then fail when in the rc.local you might want to make sure that they are not running into a problem related to starting before the network is up.  I had a version of this problem I described up thread where I was using the programmatic way of getting the local IP address to set in the command line and this was executing before the boot time DHCP exchange had completed getting an address for the RPi.  There may be other similar issues with the bridge trying to start too soon and blowing up even if you are using a hard coded local IP address.  You might try just delaying the startup for the bridges. What I did to solve my issue was to put the actual bridge start commands in a separate script that starts with a sleep 20 and then run that script from the rc.local (ending with an & so that the rc.local doesn't have to wait - not sure if that might delay other start up things).  Just some other things to look at if it seems that stuff starts manually but not automatically.

Posted (edited)

Ross, regarding your issues:

 

The logs and data sub directories must exist since they are in the path to the file you name to hold the data base 
(/home/pi/echobridge/data/device81.db) and the path for any messages or log info (/home/pi/echobridge/logs/log81.txt ) output by the Bridge.  Both of these directories may initially be empty, but they must exist. If either of these sub directories are missing the HA Bridge program will abort.  Note that I use database names and log path names that end in a number.  This is because I run 4 emulators so the data base files are data81.db, data82.db, data83.db, and data84,db.  Similarly for the log files.

 

To see what is running i type 'sudo ps -ef | grep java' (without the quotes) into a terminal window. This should have a line for each instance running and one for Java itself. The line will basically be what was used to start the instance of the HA Bridge.

 

The database file (e.g. data81.db) is a text file containing a JSON formatted string as an array of objects.  JSON format is very popular and well documented at JSON.org.  It is only read when the bridge is started.  it looks something like '[<deviceentry>, <deviceentry> . . . ]'

 

The log entry will contain some startup information and any debugging messages if debugging is turned on. It will typically look like:

[main] INFO com.bwssystems.HABridge.HABridge - HA Bridge (v1.2.1) starting setup....

[main] INFO com.bwssystems.harmony.HarmonyServer - setup initiated  (development mode)....
[main] INFO com.bwssystems.HABridge.devicemanagmeent.DeviceResource - HABridge device management service started.... 
[main] INFO com.bwssystems.HABridge.hue.HueMulator - Hue emulator service started....
[main] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Hue description service started....
2015-12-05 17:26:00.346:INFO::Thread-0: Logging initialized @22711ms
[Thread-0] INFO spark.webserver.JettySparkServer - == Spark has ignited ...
[Thread-0] INFO spark.webserver.JettySparkServer - >> Listening on 0.0.0.0:8081
2015-12-05 17:26:00.996:INFO:oejs.Server:Thread-0: jetty-9.3.z-SNAPSHOT
2015-12-05 17:26:01.269:INFO:oejs.ServerConnector:Thread-0: Started ServerConnector@5781ac{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
2015-12-05 17:26:01.272:INFO:oejs.Server:Thread-0: Started @23656ms
[main] INFO com.bwssystems.HABridge.upnp.UpnpListener - UPNP Discovery Listener starting....
[main] INFO com.bwssystems.HABridge.upnp.UpnpListener - UPNP Discovery Listener running and ready....
 
I find that using WINSCP makes my life very simple. I open a WINSCP session on my PC and log into the RPi as userid=root with a password=root. I can now examine and edit any thing on the RPi with no hassle. WINSCP will remember any session you define.
 
I never physically deal with the RPi as it runs headless. I use tightVNC on the RPi which allows me to use VNC on any PC or on my iPads to act as keyboard/mouse for an RPi. I generally just use the VNC capability to reboot the RPi
 
Hope that helps.  Please document what finally resolves your issue so others may benefit.
Edited by barrygordon
Posted

kck,  Have you tried the new version of the configuration system which handles the spoken field in the notes item of an ISY device.  Let me know what you think.

Posted (edited)

 Thanks for the replies - but still not working. I do use TightVNC and WinSCP to remotely manage my headless RPi.

 

The directories home/pi/echobridge/data   and  home/pi/echobridge/logs  do exist.  

 

I had previously created an empty file of device81.db and log81.txt  in case they needed to exist in order for the startup command to work properly. But the emulators fail to start whether those files exist or not.

 

I did a fresh reboot (still using my edited rc.local) and ran the sudo ps -ef | grep java and got the following results:  pi        1537  1526  0 13:57 pts/0    00:00:00 grep --color=auto java

 

So it appears none of the emulators actually started from the rc.local script.

 

Is using this command:

nohup java -jar -Dvera.address=192.168.1.45 -Dupnp.config.address=192.168.1.75 -Dserver.port=8081 -Dupnp.response.port=50001 -Dupnp.device.db=/home/pi/echobridge/data/device81.db /home/pi/echobridge/ha-bridge-1.2.1.jar > /home/pi/echobridge/logs/log81.txt 2>&1 &

supposed to create the device81.db and log81.txt files if they don't yet exist or update/replace them if they do?

 

If so, that is my problem as they are never created when I enter that whole command and the HA-bridge never starts. 

 

If not, is there any guidance or copies that I need to install? (I would think not since the early posts never mentioned the need to do so).

 

It still appears to me that the section of the command -Dupnp.device.db=/home/pi/echobridge/data/device81.db      and      > /home/pi/echobridge/logs/log81.txt 2>&1 & are causing my issue.

 

Again, the stripped down command  nohup java -jar -Dvera.address=192.168.1.45 -Dupnp.config.address=192.168.1.75 -Dserver.port=8081 -Dupnp.response.port=50001 /home/pi/echobridge/ha-bridge-1.2.1.jar   does at least result in the emulator starting.

 

I'm at a loss why the full command listed in the how-to posts is not working for me.

 

Thanks again for your assistance.

Edited by rossarmstrong
Posted (edited)

ross,

 

". . . I did a fresh reboot (still using my edited rc.local) and ran the sudo ps -ef | grep java and got the following results:  pi        1537  1526  0 13:57 pts/0    00:00:00 grep --color=auto java

 

Indicates that Java has started, but none of the emulators.

 

Using WINSCP make a copy of your rc.local file as a windows text file and email it to me at barry@the-gordons.net.  There has got to be some thing wrong with it that we are not seeing.  

 

I am assuming that you are running Java 8. to check your java version type 'java -version' (without the quotes) into a terminal window. I get:

java version "1.8.0"
Java SE Runtime Environment (build 1.8.0-b132)
Java HotSpot Client VM (build 25.0-b70, mixed mode)

 

I have seen the same thing if I do the ps -ef | grep Java too soon after the reboot.  The emulators need time to start, however I do not think that is your problem.  It's got to be the rc.local file.
Barry
Edited by barrygordon
Posted

If you run at the cmd line with the > logs part included, and the logs file isn't created .... that is a pretty good indication that there is a problem with creating that file.

 

Try taking everying out after the ">", except for the last "&".  That will do the same thing, just without creating the log file.

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...