HomeGenie Forum

Automation Program Plugins and Wizard Scripting => APP Contributions => Topic started by: [email protected] on October 12, 2016, 09:09:03 PM

Title: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on October 12, 2016, 09:09:03 PM
As discussed in other threads here is a copy of the interface driver I am working on.. its far from perfect at the moment and requires that you disable the UPNP service..

there is a hgx to add which adds a guid field and then a zip to install both are located here:

https://github.com/davidwallis3101/HomegenieEchoBridge (https://github.com/davidwallis3101/HomegenieEchoBridge)

I've tried the console app on windows and you will need permissions to the port or to be running as admin (perms can be done via netsh iirc)  as for the PI it needs to be on a newer pi for the later frameworks. I have no plans to make it work on the older ones, spend some money!!

David
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on November 03, 2016, 07:19:27 PM
Hi!

It's only works with "Testing" switches now?
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on November 03, 2016, 08:54:18 PM
Not quite sure what you mean, in terms of discovering modules, it only does switches and lights at the moment, but we could just add a param to modules to say "expose to alexa" or something?

Depends what people want it to do..
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on November 03, 2016, 11:59:06 PM
Not quite sure what you mean, in terms of discovering modules, it only does switches and lights at the moment, but we could just add a param to modules to say "expose to alexa" or something?

Depends what people want it to do..

I get my Echo Dot Gen2 today. I can configure HA-Bridge, it's works. But I'd like to use Your program. How can I configure it? I turned off UPNP. I installed MIG and 1000-AmazonEcho.hgx program.
What is the next step? I see the IP setting in the MIG setting. What is this IP address? Is it echo's IP?
Thanks for your help.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on November 04, 2016, 03:45:04 PM
To be honest I dont think that Ip does anything currently..

Import HGX file... (until I work out how to do this in the interface)
Disable upnp..
reboot (would say restart, but lets keep it simple)
Start service, monitor the logs, you should then be able to tell alexa to "discover" you should then see it find devices..

Bear in mind I'm using a rpi 3, I havent tested on anything other than a PC using the console test app, on that you need to run with admin permissions and I would suggest disabling the firewall as you will need UDP/1900 and TCP/8080 inbound.. but test by disabling so you can rule that out and ensure all is good.


the code currently only looks for switches and lights so you will need at least one switch or light for it to discover..

Any changes required let me know or submit a Pull req..

Cheers

Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on November 04, 2016, 09:31:48 PM
To be honest I dont think that Ip does anything currently..

Import HGX file... (until I work out how to do this in the interface)
Disable upnp..
reboot (would say restart, but lets keep it simple)
Start service, monitor the logs, you should then be able to tell alexa to "discover" you should then see it find devices..

Bear in mind I'm using a rpi 3, I havent tested on anything other than a PC using the console test app, on that you need to run with admin permissions and I would suggest disabling the firewall as you will need UDP/1900 and TCP/8080 inbound.. but test by disabling so you can rule that out and ensure all is good.


the code currently only looks for switches and lights so you will need at least one switch or light for it to discover..

Any changes required let me know or submit a Pull req..

Cheers


Unfortunately, it looks like that not working on Ubuntu 16.04 linux :(
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on November 08, 2016, 01:40:13 PM
Your pic doesn't tell me anything..

As I said that ip address box does nothing.. iirc it should be populated with the text "not used currently" when you install..

If not I may need to do a new build..  or push a commit that hasnt gone.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on November 08, 2016, 01:58:06 PM
I think, this modul not active. You can see (red circle) on the picture, Z-Wave active, but amazon echo interface not.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on November 09, 2016, 11:12:45 AM
I would ignore what the icon says as I dont know if I need to code it to do that, and have a look at what the homegenie log says when you enable the interface :)

Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on November 09, 2016, 06:50:17 PM
I would ignore what the icon says as I dont know if I need to code it to do that, and have a look at what the homegenie log says when you enable the interface :)
This is the log.
Code: [Select]
"2016-11-09 18:42:49.5878 Info WebServiceGateway 10.1.1.98 HTTP GET 200 /api/MIGService.Interfaces/HomeAutomation.EchoBridge/IsEnabled.Set/1// [OPEN]"
2016-11-09 18:42:49.5992 Debug Enabling Interface HomeAutomation.EchoBridge
2016-11-09 18:42:49.5992 Info Connecting to Homegenie API [192.168.0.161] to discover valid devices

The HomeGenie API IP address wrong. My HG IP address 10.1.1.202.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on November 15, 2016, 11:09:42 AM
Ok, let me take a look, what OS are you running?
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on November 15, 2016, 11:11:02 AM
Also are you running the test app there or the actual HG interface?

The zip file can be installed as an interface and it should use the machines local address for connecting, if you are using the test app then that was hardcoded with one of my test box ip addresses.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on November 15, 2016, 12:16:12 PM
Also are you running the test app there or the actual HG interface?

The zip file can be installed as an interface and it should use the machines local address for connecting, if you are using the test app then that was hardcoded with one of my test box ip addresses.

Hi!

My OS is Ubuntu 16.04.1 LTS X64 virtual machine under Hyper-V. HG version: 1.1 beta r525

I was install MIG-EchoBridge.zip under HG interfaces, and install 1000-AmazonEcho.hgx too.

Amazon echo program works fine. I see the Echo feature under my switch ( and test switches too) Feature/option section.

Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on November 16, 2016, 12:31:20 PM
It hasn't added a guid though.. when it finds switches, it should append that with a guid.

Let me double check what build is up on github tonight :)
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: jay on December 01, 2016, 10:41:35 PM
Can i get help with this please?

I followed the below steps:
1. Configure / Programs / Ungrouped / Import
2. Imported the homegenie.hgx file.
3. disabled upnp restarted
4. Amazon Echo shows up under switches, the icon for echo is purple
5. my Echo does not discover the devices from HG.. I do have a hue hub thats configured in Echo ( not sure if this is creating a conflict).

please help.

Thanks,
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on December 06, 2016, 12:28:54 AM
tried a new build.. see if this makes any difference:

https://github.com/davidwallis3101/HomegenieEchoBridge/tree/master/MIG-Interface/Output (https://github.com/davidwallis3101/HomegenieEchoBridge/tree/master/MIG-Interface/Output)
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on December 06, 2016, 08:56:37 AM
tried a new build.. see if this makes any difference:

https://github.com/davidwallis3101/HomegenieEchoBridge/tree/master/MIG-Interface/Output (https://github.com/davidwallis3101/HomegenieEchoBridge/tree/master/MIG-Interface/Output)

Hi!

I installed this build. unfortunately, it does not work.
1. Install MIG interface
2. Activate Echo program
3. Set the switch echo name (attached pic)
4. Try discover devices with echo. find nothing...
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on December 06, 2016, 05:20:08 PM
You shouldnt be putting anything in module GUID.. remove that..

Then disable the interface and restart and post the log from starting the interface.

Please also confirm:

Platform
OS
.NET Version
Network topology - Amazon + HG on same subnet?

Confirm FWL disabled for testing (IPTables or Windows)
Disabled HG UPNP Service?

Cheers

David
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: KaZe on December 06, 2016, 07:52:51 PM
You shouldnt be putting anything in module GUID.. remove that..

Then disable the interface and restart and post the log from starting the interface.

Please also confirm:

Platform
OS
.NET Version
Network topology - Amazon + HG on same subnet?

Confirm FWL disabled for testing (IPTables or Windows)
Disabled HG UPNP Service?

Cheers

David

Code: [Select]
"2016-12-06 19:32:23.6648 Info WebServiceGateway 10.1.1.98 HTTP GET 200 /api/MIGService.Interfaces/HomeAutomation.EchoBridge/IsEnabled.Set/1// [OPEN]"
2016-12-06 19:32:23.6730 Debug Enabling Interface HomeAutomation.EchoBridge
2016-12-06 19:32:23.6730 Info Connecting to Homegenie API [192.168.0.161] to discover valid devices

HG Server:
Ubuntu 16.04.1 x64 linux (no GUI)

Network:
Amazon and HG on the same subnet
No firewall

HG UPNP disabled.

Can I uninstall MIG packages? Or if I install a new one Echo interface, it overwrite the old package or not?!
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on December 07, 2016, 01:07:22 PM
You cant uninstall, and I have also had issues with it not installing the new version of the package, hence why I sumbitted a PR for displaying the module assembly version  when loading..

Best bet is disable the interface module, restart hg or the box, then import again..

The problem there in the log is the .161 hardcoded from my test box.. oops..
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on December 07, 2016, 01:08:05 PM
Which the new version should fix..
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 03, 2017, 02:39:08 AM
Was wondering if your program will work x10. Just got an Amazon Echo Dot and was hoping to integrate it with HG.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on January 12, 2017, 01:39:55 PM
It doesnt care - if HG can control it then it will work... It isn't doing anything with a physical hue other than pretending to be one so that the amazon devices can find it and use its fake api to control homegenie..
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 23, 2017, 04:59:22 PM
I've downloaded the MIG interface and installed it. I've disabled the UnPnP but I cannot download the 1000-AmazonEcho.hgx file. I've even tried to copy/paste the code into the HG C compiler but as soon as I compile the program is full of runtime errors.

Am I missing the method of downloading and installing the hgx file.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 24, 2017, 12:00:43 AM
Ok. I managed to figure out how to download the hgx file so that problem is sorted.

I've done the following

Downloaded the MIG file and installed it. Installed fine and is available under Settings Amazon Echo.
Disabled UnPnp
Restarted the Service
Installed the hgx file in Programs/Ungrouped

Tried to discover devices via Alexa but Alexa reports that no devices were found.

Have I left out any of the installation instructions. I'm running HG rc 525 on a RPI3 and installing via Putty and accessing HG on a remote PC.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: Jens on January 24, 2017, 09:14:12 PM
I can just tell that I had exactly the same problems running v512 on rpi2 mono 4.2.3 and had no clue how to solve it, so I tried ha_bridge

Cheers
Jens
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 25, 2017, 08:15:03 PM
How did you go about installing and configuring the HA Bridge to work with Homegenie Jens. A step by step guide outlined here would go a long way to assisting new owners of the Echo/Echo Dot.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: Jens on January 25, 2017, 08:57:43 PM
just quickly the steps performed, I can post a more detailed description probably at the weekend

assuming you are in /home/pi/

sudo apt-get update
mkdir habridge
cd habridge/
sudo wget https://github.com/bwssytems/ha-bridge/releases/download/v3.5.1/ha-bridge-3.5.1.jar (https://github.com/bwssytems/ha-bridge/releases/download/v3.5.1/ha-bridge-3.5.1.jar)
mkdir data
nano habridge.service

Enter these lines

[Unit]
Description=HA Bridge
Wants=network.target
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge-3.5.1.jar

[Install]
WantedBy=multi-user.target

and exit the editor

 
sudo apt-get install oracle-java8-jdk
sudo update-alternatives --config java
sudo systemctl enable /home/pi/habridge/habridge.service
sudo systemctl start habridge

ha bridge is running on a different pi than HG, which servers other supplementary services in my network

access ha_bridge http://ipadressofthepirhabridgeisrunningon (http://ipadressofthepirhabridgeisrunningon)

>Manual add
>enter a name like livingroom
>enter within On Url e.g. http://IPAdressFromHomeGenie/api/HomeAutomation.X10/A12/Control.On (http://IPAdressFromHomeGenie/api/HomeAutomation.X10/A12/Control.On)
>enter within Off Url e.g. http://IPAdressFromHomeGenie/api/HomeAutomation.X10/A12/Control.Off (http://IPAdressFromHomeGenie/api/HomeAutomation.X10/A12/Control.Off)

Run Discover devices on Echo
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 25, 2017, 09:12:14 PM
Thanks Jens

I'll give that a shot and report back.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 25, 2017, 09:45:57 PM
Jens, all seemed well until I got to the section on Java. This is the following output

[email protected] ~/habridge $ sudo apt-get install oracle-java8-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
oracle-java8-jdk is already the newest version.
The following packages were automatically installed and are no longer required:
  libglade2.0-cil libglib2.0-cil libgtk2.0-cil libmono-2.0-1 libmono-2.0-dev
  libmono-accessibility2.0-cil libmono-c5-1.1-cil libmono-cairo2.0-cil
  libmono-cairo4.0-cil libmono-cecil-private-cil libmono-cil-dev
  libmono-codecontracts4.0-cil libmono-compilerservices-symbolwriter4.0-cil
  libmono-corlib2.0-cil libmono-corlib4.0-cil libmono-cscompmgd0.0-cil
  libmono-cscompmgd8.0-cil libmono-custommarshalers4.0-cil
  libmono-data-tds2.0-cil libmono-db2-1.0-cil libmono-debugger-soft4.0a-cil
  libmono-entityframework-sqlserver6.0-cil libmono-entityframework6.0-cil
  libmono-http4.0-cil libmono-i18n-west2.0-cil libmono-ldap2.0-cil
  libmono-management2.0-cil libmono-management4.0-cil
  libmono-messaging-rabbitmq2.0-cil libmono-messaging-rabbitmq4.0-cil
  libmono-messaging2.0-cil libmono-microsoft-build2.0-cil
  libmono-microsoft-build4.0-cil libmono-microsoft-visualc10.0-cil
  libmono-microsoft-web-infrastructure1.0-cil libmono-microsoft8.0-cil
  libmono-npgsql2.0-cil libmono-npgsql4.0-cil libmono-opensystem-c4.0-cil
  libmono-oracle2.0-cil libmono-oracle4.0-cil libmono-parallel4.0-cil
  libmono-peapi2.0a-cil libmono-peapi4.0a-cil libmono-posix2.0-cil
  libmono-profiler libmono-rabbitmq2.0-cil libmono-rabbitmq4.0-cil
  libmono-relaxng2.0-cil libmono-relaxng4.0-cil libmono-security2.0-cil
  libmono-sharpzip2.6-cil libmono-sharpzip2.84-cil libmono-sharpzip4.84-cil
  libmono-simd2.0-cil libmono-simd4.0-cil libmono-smdiagnostics0.0-cil
  libmono-sqlite2.0-cil libmono-system-componentmodel-composition4.0-cil
  libmono-system-data-datasetextensions4.0-cil
  libmono-system-data-entity4.0-cil libmono-system-data-linq4.0-cil
  libmono-system-data-services-client4.0-cil
  libmono-system-data-services2.0-cil libmono-system-data-services4.0-cil
  libmono-system-data2.0-cil libmono-system-deployment4.0-cil
  libmono-system-drawing-design4.0-cil libmono-system-dynamic4.0-cil
  libmono-system-io-compression-filesystem4.0-cil
  libmono-system-io-compression4.0-cil libmono-system-json-microsoft4.0-cil
  libmono-system-json2.0-cil libmono-system-json4.0-cil
  libmono-system-ldap-protocols4.0-cil libmono-system-ldap2.0-cil
  libmono-system-management4.0-cil libmono-system-messaging2.0-cil
  libmono-system-net-http-formatting4.0-cil
  libmono-system-net-http-webrequest4.0-cil libmono-system-net-http4.0-cil
  libmono-system-net2.0-cil libmono-system-net4.0-cil
  libmono-system-numerics-vectors4.0-cil libmono-system-reactive-core2.2-cil
  libmono-system-reactive-debugger2.2-cil
  libmono-system-reactive-experimental2.2-cil
  libmono-system-reactive-interfaces2.2-cil
  libmono-system-reactive-linq2.2-cil
  libmono-system-reactive-observable-aliases0.0-cil
  libmono-system-reactive-platformservices2.2-cil
  libmono-system-reactive-providers2.2-cil
  libmono-system-reactive-runtime-remoting2.2-cil
  libmono-system-reactive-windows-forms2.2-cil
  libmono-system-reactive-windows-threading2.2-cil
  libmono-system-reflection-context4.0-cil
  libmono-system-runtime-caching4.0-cil
  libmono-system-runtime-durableinstancing4.0-cil
  libmono-system-runtime-interopservices-runtimeinformation4.0-cil
  libmono-system-runtime4.0-cil libmono-system-servicemodel-discovery4.0-cil
  libmono-system-servicemodel-routing4.0-cil
  libmono-system-servicemodel-web4.0-cil
  libmono-system-threading-tasks-dataflow4.0-cil
  libmono-system-web-abstractions4.0-cil libmono-system-web-dynamicdata4.0-cil
  libmono-system-web-extensions-design4.0-cil
  libmono-system-web-extensions4.0-cil libmono-system-web-http-selfhost4.0-cil
  libmono-system-web-http-webhost4.0-cil libmono-system-web-http4.0-cil
  libmono-system-web-mobile4.0-cil libmono-system-web-mvc3.0-cil
  libmono-system-web-razor2.0-cil libmono-system-web-regularexpressions4.0-cil
  libmono-system-web-routing4.0-cil
  libmono-system-web-webpages-deployment2.0-cil
  libmono-system-web-webpages-razor2.0-cil libmono-system-web-webpages2.0-cil
  libmono-system-windows-forms-datavisualization4.0a-cil
  libmono-system-windows4.0-cil libmono-system-workflow-activities4.0-cil
  libmono-system-workflow-componentmodel4.0-cil
  libmono-system-workflow-runtime4.0-cil
  libmono-system-xml-serialization4.0-cil libmono-system2.0-cil
  libmono-tasklets4.0-cil libmono-web4.0-cil libmono-webbrowser2.0-cil
  libmono-webmatrix-data4.0-cil libmono-windowsbase3.0-cil
  libmono-xbuild-tasks2.0-cil libmonoboehm-2.0-1 libmonoboehm-2.0-dev
  libmonosgen-2.0-1 libmonosgen-2.0-dev libnunit-cil-dev
  libnunit-console-runner2.6.3-cil libnunit-core-interfaces2.6.3-cil
  libnunit-core2.6.3-cil libnunit-framework2.6.3-cil libnunit-mocks2.6.3-cil
  libnunit-util2.6.3-cil libnunit2.6-cil libwebkit1.1-cil mono-2.0-gac
  mono-2.0-service mono-4.0-service mono-csharp-shell mono-jay mono-utils
  monodoc-base monodoc-browser monodoc-manual
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
[email protected] ~/habridge $ sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java
Nothing to configure.
[email protected] ~/habridge $ sudo systemctl enable /home/pi/habridge/habridge.service
sudo: systemctl: command not found
[email protected] ~/habridge $ sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java
Nothing to configure.
[email protected] ~/habridge $

Any ideas what may have gone wrong
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: Jens on January 25, 2017, 10:37:23 PM
Your log shows
>oracle-java8-jdk is already the newest version.

Could it be that you are not running the latest OS (Jessie)?

Try cat /etc/os-release

which should give you something like

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

then starting ha_bridge is the problem by systemctl, which is not valid for wheezy if I am not mistaken.

Checking Java on my pi with
java -version

i am getting
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

Maybe you can start the process with

nohup java -jar -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge-3.5.1.jar

Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 25, 2017, 10:51:21 PM
I'm still using Raspbian Wheezy and it's as updated as possible. It's running Mono 4.2. I've tried Homegenie on Raspbian Jessie and have had a number of issues that forced me back to Wheezy.

I did ask on a previous post if anyone was using Homegenie rc525 on Raspbian Jessie successfully bit didn't receive any responses. Are you running on Jessie successfully Jens.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: Jens on January 26, 2017, 06:59:25 AM
Maybe I was not precise enough, I am running ha_bridge on a second box, please see my earlier posts. That box runs Jessie, ha_bridge and other services. Homegenie runs on a different box under wheezy and mono 4.2.3.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 26, 2017, 12:44:05 PM
Understood Jens. You have two different Pi's running two different versions of Raspbian. Not ideal for my situation but I can certainly give this option a try.

I thought David's app would have been the solution for me but I just can't get it working. Such a shame as it looked like the ideal solution for me.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on January 26, 2017, 03:53:49 PM
don't write my app off :) it works really well for me, just a shame it had limited testing..

I have a week of work next week to look after a new puppy - so the things I wanted to get done probably wont - so I can try and get some time in front of the pc to debug this and get you all something that works correctly in more env's than just mine..

It would help if someone was using a pi to test on, or you can tell me what scenarios you are using..

such as mono version if applicable.
Hardware (PI / pc etc)
HG Version
Home subnet IE 192.168.0.0/24 or hg IP address and subnet mask will do.. IE 192.168.0.1 255.255.255.0

and I will get it working for you as mine works really well and reliably - shame I only have two lamps to control currently :D
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 26, 2017, 05:23:28 PM
Hi David

Thanks for the response.

My setup is as follows

Raspberry Pi3 with Pi Camera module
Raspbian Wheezy running Homegenie rc525 with Mono 4.2
X10 Light and Switch modules
Amazon Echo Dot (latest model)

My HG server is running on 192.168.0.10 and I can control it from the server or remotely from another PC in my home network via Putty

Is there anything else you would need to know to get mine up and running. What is the spec on the system you are running.Maybe you have additional software installed on your system that I do not have that is preventing my app from working
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: Jens on January 26, 2017, 07:58:56 PM
Hi David,

here is mine

>such as mono version if applicable.
4.2.3
>Hardware (PI / pc etc)
PI2
>HG Version
1.1/512
>Home subnet IE 192.168.0.0/24 or hg IP address and subnet mask will do.. IE 192.168.0.1 255.255.255.0
192.168.2.0/24

Thanks
Jens
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on January 29, 2017, 05:00:59 PM


I am also wondering about those java steps.  The instructions on BWS Systems homepage dont include those steps...   but-  following their directions,  I cant get it to work either...so what do I know   :)
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 29, 2017, 09:46:19 PM
I'm sure David's app works on his system but I think we need a little more background info to get it working on ours.

In the meantime, here's a link for Windows users that I did eventually manage to get working for Alexa and x10. The author has done a great job with it too. Maybe it will be of interest to you David.

http://tuicemen.com/forum/index.php?topic=1020.0 (http://tuicemen.com/forum/index.php?topic=1020.0)
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on January 31, 2017, 04:38:47 AM
Well I got HA_BRIDGE up and running on my pi... the same one that is running HG.

I cant believe it... it actually works.   "Alexa, turn all lights on"   

Pretty cool I must say.

I do have a number of questions about configuring ha_bridge --   is anyone using the latest version?  Version 4?

Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 31, 2017, 02:28:11 PM
Kevinv could you elaborate a little on how you actually got the app working. Maybe a step by step guide and the spec on hardware and software you are using.

I'm looking forward to hearing how you achieved this.

I followed David's instructions as best I could but couldn't manage to get Alexa to do her job.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on January 31, 2017, 03:14:53 PM
It was a lot of stumbling around for sure....

I can write more later but I basically followed the install directions on the ha_bridge site.   I am using an older raspberry pi with the latest OS on it...

https://github.com/bwssytems/ha-bridge/blob/master/README.md (https://github.com/bwssytems/ha-bridge/blob/master/README.md)

I followed the steps in the above URL starting from this label:
System Control Setup on a pi (preferred)


Once it was installed and running I could connect by pointing my browser to the pi url


The main problem I had was that the HA_BRIDGE was not running after I had installed it.

Here is where I got a few clues on how to check and see if ha bridge was running or not...
http://xbmcnut.blogspot.com/2016/10/installing-ha-bridge-on-your-raspberry.html (http://xbmcnut.blogspot.com/2016/10/installing-ha-bridge-on-your-raspberry.html)

Sorry I dont have the exact steps... it was a lot of poking and hoping as usual!
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on January 31, 2017, 03:15:53 PM
Also-  The pi is running ha_Bridge and HG both.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 31, 2017, 04:14:00 PM
Ok Kevinv. I thought you got David's app running in HG but you managed to do it outside HG on the same Pi.

Have you changed the port on the HA bridge. HG Is currently using port 80 so I assume HA bridge is configured for a different port.

If you get time could you let us have a little more info on how you achieved this.

It's great that you have both running on the same Pi.

I'm using the HA bridge on a Windows app so I'm getting a little more insight on how the HA bridge works.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: mchias13 on January 31, 2017, 04:59:35 PM
I have both HG and HA bridge running on the same pi.  HA bridge uses it's default port 80 and i changed HG to a different port number.  Running on a PI2B.

Think I followed that same 2nd procedure Kevin posted when I set mine up a few months ago.

Forgot should add i'm running on wheezy with 525 in case those matter.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 31, 2017, 08:23:42 PM
Yes Mchias13. Every little helps.

I'll have a try at that link and report back.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on January 31, 2017, 09:19:36 PM
Kevinv, I note you say you're running the latest OS. I assume that's Jessie as you are employing SystemD to run your service which is not really recommended for Wheezy that I'm running.

Starting to see the shortfalls of HG running under Wheezy now.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on February 01, 2017, 05:01:06 AM
Yes I am running Jessie with an older Pi.

And I have ha_bridge set to port 80 (the default) with HG set to 8080.

I should have taken better notes to share... I apologize.    ::)

Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on February 01, 2017, 12:45:43 PM
It's the nature of the beast Kevinv. You try many options and suddenly your problem is solved. You then realise you're not sure what solution solved the original problem or was it a combination of solutions.

What would help greatly is if users outlined what their setup was, both hardware and software. The beauty of HG is that it works on a number of different platforms.

Hopefully we can find a working solution for the Echo within HG and David can finally get his app working for everyone. Fingers crossed.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on February 01, 2017, 03:02:13 PM
Hi Pete,  what is your situation with ha-bridge    where is it failing now?
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on February 01, 2017, 11:10:02 PM
Im using Wheezy and the install instructions from those links are more suited to Jessie. Systemd service management  would need to be installed as far as I can see and I'm not sure if Gene has tested HG with Systemd on Wheezy.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on February 02, 2017, 03:37:37 AM
Ah,  I see.   I am a newbie with the Pi but everything went pretty smoothly surprisingly.  I used NOOBS to install the OS and then HG and finally ha_bridge....
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on February 02, 2017, 02:46:01 PM
Kevinv are you using the full desktop version of Jessie. I'm assuming you are as you installing from NOOBS. I'd disable the desktop GUI in your case as the new desktop GUI is quite processor intensive. A number of users here are using Jessie Lite because of this.

I'm curious to know if you have email notification setup and working under Jessie and if you have the Raspberry Pi camera module attached to your Pi server.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: kevinvinv on February 02, 2017, 03:17:12 PM
I installed the entire version b/c it was my first experience with the pi and I wanted to see how usable it was as a web surfer...  but then I "turned off" the gui using the config utility and went headless.

Is that good enough or do I need to install the lite version entirely?

No email and no camera module...  I see that upgrading will be more effort for you than I considered.

I am forcing myself to go easy on this project these days b/c I have got a lot of gray hairs from getting as far as I have and my wife is kind of sick of it all!   :)



Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on February 04, 2017, 01:31:23 AM
Jens I imaged a new card with Jessie and followed your previous links. I have the bridge working now. HG is running on Port 80 and Ha_Bridge on Port 8080 both on the same Pi.

I manually added two x10 modules using the http url examples you provided, using the ip address of the Pi and in my case B1 and B4. Tested the bridge and it reported back the devices I added. Asked Alexa to discover the devices which she did. I then asked Alexa to turn them on and she reported they were powered off. I ran the On command on the Bridge and it reported a problem with the addresses I provided.

Any ideas what may be the problem here.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: Jens on February 04, 2017, 07:27:16 AM
Can you just check whether your settings look similar as the screenshot attached?

Bests
Jens
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on February 04, 2017, 01:22:51 PM
Yes Jens they are identical as per my settings. The error message I receive from the bridge is "error on calling url to change device state". I checked the url and it matches my HG url.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: Jens on February 04, 2017, 02:14:09 PM
I haven't had that kind of problem, did a quick search on the net about the failure cause and the solutions I found was a misspelled URL in the ON/OFF fields of ha_bridge or exchange the IP address within that URL by <localhost:port>.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on February 04, 2017, 02:47:02 PM
I'm thinking about a possible security issue. To access a server like HG from a server like HA_Bridge would you need to supply credentials like username,password within the Webservice call url. Maybe something similar to accessing a webcam feed.

Clearly one server is issuing an instruction to another server to carry out an instruction so I'm thinking you would need some form of security access protocol in place. I understand in my case that both servers are on the same system but HG is using Port 80 and HA_Bridge is using 8080.

This is just a thought.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: petediscrete on February 04, 2017, 04:36:19 PM
Jens, my logic and lines of thinking were on the right track.

I played around in a web browser using the url you suggested. As I thought, I need to provide credentials to execute the GET request. For anyone else having similar difficulties the url is as follows:

http://username:[email protected]/api/HomeAutomation.X10/B1/Control.On (http://username:[email protected]/api/HomeAutomation.X10/B1/Control.On)

I knew I'd need to provide some form of credentials to HG to get it to perform an external command from another server.

Thanks for you help Jens and others.

Maybe David might have an update on his app.
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: claton on April 01, 2017, 04:53:33 PM
Could someone point me to step by step instructions to install Davids bridge into HG, I'd like to try it.

Thanks,
Clay
Title: Re: Amazon Echo / Alexa Bridge Interface
Post by: [email protected] on April 17, 2017, 01:34:19 AM
I can write some, it appears it hasn't worked for some so need to do some testing, just struggling for time