Author |
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: November 29 2015 at 14:16 | IP Logged
|
|
|
Jaaay,
1. With the virtual smarthome bridge, you would be
limited to the commands that are preprogrammed into
the bridge. That would be one of the cons. The
advantage to this method would be not having to say
"ask keyword to" or "tell keyword to" type constructs.
With your own Alexa skill, you would be able to define
or use virtually any vocabulary.
2. Yes, you have more control over the commands and
vocabulary but must use the keyphrase (which probably
isnt so bad). Havent looked into IFTTT yet or what
capabilities are available there yet.
Jeff,
Appreciate it. I may take you up on that offer if I
start to run into some snags. So far I setup the skill
and have been playing with it but havent revisited it
to see what else I can do to improve it. Hopefully
I'll get a little time to play with this some more as
it seems to have alot of interest.
Steve,
Definitely sounds like I need to look into the IFTTT
aspect of Alexa. The main thing I don't like with the
way Im currently doing it is to have to create a
Lambda account and go through the issues of setting it
up to talk to PowerHome. If I can bypass this and just
have IFTTT ultimately send the recognized phrase to
PowerHome then this would greatly simplify things. I
originally wanted to just have the skill talk directly
to the PowerHome machine but this requires SSL to be
enabled on PowerHome and all the issues with getting a
certificate and the like. Plus, it would appear that
not everyone is able to use SSL on their PowerHome
machine as the incoming traffic may be blocked by
their ISP. Still, something else I may need to look
into to bypass the Lambda account.
Dave.
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: December 08 2015 at 14:39 | IP Logged
|
|
|
Relevent read to this Echo thread.
http://www.charmedquark.com/vb_forum/showthread.php?t=12271
Inserting links not working for me :(
Edited by smarty - December 08 2015 at 14:42
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: January 20 2016 at 13:16 | IP Logged
|
|
|
I have been re-reading this post and looking more at how to get *any* PH functionality from the Echo.
Until/if Dave releases something better... and not being a programmer myself; the IFTTT Maker Channel seems most promising to me.
The Maker channel can send a web request to PH's webserver (assuming it faces the outside world). Mine does face the outside world via a noip.me DNS account.
My question for anyone would be:
Since the PH web browser must be accessible from the outside world, how would the login authentication be handled so that only authenticated web requests would cause the PH browser to execute commands?
If I get past this obstacle, it appears to me that putting formula or macro statements into the web request seems doable (once authenticated).
While this may not be the optimum way forward, for us none programmer types, it seems it may be all there is.
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 22 2016 at 16:13 | IP Logged
|
|
|
Steve,
Ive briefly looked at the IFTTT (IF This Then That)
site and it appeared like it might be a good solution
but I didnt spend enough time to see how involved it
would be.
In any event, just about any Echo integration will
involve using the webserver (what Im currently working
on with an Alexa skill will also require this). The
virtual bridge option thats currently available
wouldnt require external webserver access but still
uses it internally which would still require
authentication passing unless you've whitelisted the
internal IP.
Depending upon the authentication method you've chosen
for your PH webserver will determine how you pass that
information. If you've chosen "Basic", this is just a
base64 representation of your userid:password and is
passed as part of the http header. Keep in mind that
this is not secure unless you're also using SSL as
anyone that is able to monitor your HTTP traffic can
capture this info and base64 decode it for your userid
and password. Most HTTP program calls or functions
will provide some mechanism to pass the basic
authentication as part of the call. Most URL functions
that Ive seen (including the ones Ive built into
PowerHome) allow you to pass the credentials as part
of the URL such as this:
http://userid:password@your_PH_IP_or_dynamic_dns/ph-
cgi/more_parameters
If you're using the "Basic" authentication method, you
should be able to do this but its not secure unless
you're using SSL.
If you're using the "Cookie" authentication (more
secure), then the authentication info is passed as a
cookie. The actual userid/password info is never
accessible via this method (the cookie contains a one
way hash of a salt generated by PowerHome) but the
cookie could be intercepted and stolen. SSL of course
makes this method secure as well. If you're using this
method, then you mush somehow have the remote system
include the authentication information as a cookie
when the HTTP call is made. The easiest way to get a
valid cookie would be to "borrow" one from an existing
authorized user by reviewing the eventlog for a past
webserver request. You'll see something in the log
that says:
Cookie: phauth=ABCDEFABCDEF....a bunch of random hex
digits.
If you take this entire string starting with "phauth="
and all the following hex digits and pass it as a
cookie with your request, then the command should be
authenticated.
Once you're able to make your requests and pass
authentication, then you need to decide how you're
going to control PowerHome. One of the most basic is
to just use the internal CGI function EVAL. This will
allow you to pass any PowerHome formula as part of the
URL and have it evaluated which can call a macro, turn
on a device, etc. It looks like this:
http://yourPHmachineIP/ph-cgi/eval?
formula=ph_insteon("TEST",ion,255)
or
http://yourPHmachineIP/ph-cgi/eval?
formula=ph_macro("TEST")
Keep in mind, you'll probably want to "escape" the
formula section (you can read about escaping URL's
through Google). Another option is to call a PSP page
and have that page perform additional processing, etc.
but that would be beyond the scope of this post.
Hope this helps,
Dave.
|
Back to Top |
|
|
mike0999 Groupie
Joined: June 14 2009 Location: United States
Online Status: Offline Posts: 56
|
Posted: March 04 2016 at 00:52 | IP Logged
|
|
|
New Amazon Echo Dot - Even more possibilities.
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: March 04 2016 at 03:41 | IP Logged
|
|
|
Dave,
I sure appreciate your note two entries above, but for the life of me, I can't seem to make the IFTTT Maker channel produce the needed PH "authentication strings" (cookie or name/password...cookie approach would be preferred).
With the advent of even more Echo devices (esp. the dot), I see so many new ways I want the Echo to interact with my PH system.
......
If ANYONE can put a tutorial (for none computer scientists) on how to authenticate PH so that web cgi commands can be passed from the Echo to PH's webserver via the IFTT Maker channel, I (and likely many others) would be HUGELY grateful.
Edited by smarty - March 04 2016 at 03:42
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: March 04 2016 at 14:10 | IP Logged
|
|
|
Steve,
I created an account on IFTTT and played around a little. Initial research does not look like there is a way to pass a cookie but I'll keep playing with it. I was able to use
the Maker channel as an Action to successfully call into PowerHome with basic authentication.
As a test, I just created a simple recipe with Maker as the trigger and Maker as the action. For the trigger action I create an event with ID of DWH001 and used the following
URL to trigger my recipe (I changed the key below so as to protect my trigger):
https://maker.ifttt.com/trigger/DWH001/with/key/cKJDKEJkdkej 8k4d82kkrKDEkw
For the Maker action, I used the following:
URL: http://testuser:testpass@123.456.789.123:5555/ph-cgi/eval?ph _macro("TEST1")
Of course, the userid, password, IP, and port were changed to match my actual server.
Method: GET
Content Type: Text/Plain
Body:
Body was left blank. When I triggered the "trigger" URL, I got the following in the PowerHome log:
From: 54.90.169.227
GET /ph-cgi/eval?ph_macro(%22TEST1%22) HTTP/1.1
Content-type: text/plain
host: 123.456.789.123:5555
authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
x-newrelic-id: XBMGV34QGwQZXllRDsQ=
x-newrelic-transaction: QxXYZ7EAC5AFVFsABYUEFkYdUFIOFQZOElNZVz2LYEqEUQsDBFhWUmkUG0MH UytLBAcGTxVs
Connection: close
The main thing I needed to verify is the line: authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=. This is webserver userid and password that PowerHome requires for the basic
authentication and it is proper so the Maker channel does properly support passing basic authentication credentials on the command line.
I'll keep playing and see if there is a way to get cookie authentication working but basic authentication is working pretty well.
Hope this helps,
Dave.
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: March 04 2016 at 23:20 | IP Logged
|
|
|
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: March 09 2016 at 04:42 | IP Logged
|
|
|
Found an error below....
URL: http://testuser:testpass@123.456.789.1 23:5555/ph-cgi/eval?ph_macro("TEST1")
Should be:
URL: http://testuser:testpass@123.456.789.1 23:5555/ph-cgi/eval?formula=ph_macro("TEST1")
dhoward wrote:
Steve,
I created an account on IFTTT and played around a little. Initial research does not look like there is a way to pass a cookie but I'll keep playing with it. I was able to use
the Maker channel as an Action to successfully call into PowerHome with basic authentication.
As a test, I just created a simple recipe with Maker as the trigger and Maker as the action. For the trigger action I create an event with ID of DWH001 and used the following
URL to trigger my recipe (I changed the key below so as to protect my trigger):
https://maker.ifttt.com/trigger/DWH001/with/key/cKJDKEJkdkej 8k4d82kkrKDEkw
URL: http://testuser:testpass@123.456.789.123:5555/ph-cgi/eval?ph _macro("TEST1")
For the Maker action, I used the following:
Of course, the userid, password, IP, and port were changed to match my actual server.
Method: GET
Content Type: Text/Plain
Body:
Body was left blank. When I triggered the "trigger" URL, I got the following in the PowerHome log:
From: 54.90.169.227
GET /ph-cgi/eval?ph_macro(%22TEST1%22) HTTP/1.1
Content-type: text/plain
host: 123.456.789.123:5555
authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
x-newrelic-id: XBMGV34QGwQZXllRDsQ=
x-newrelic-transaction: QxXYZ7EAC5AFVFsABYUEFkYdUFIOFQZOElNZVz2LYEqEUQsDBFhWUmkUG0MH UytLBAcGTxVs
Connection: close
The main thing I needed to verify is the line: authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=. This is webserver userid and password that PowerHome requires for the basic
authentication and it is proper so the Maker channel does properly support passing basic authentication credentials on the command line.
I'll keep playing and see if there is a way to get cookie authentication working but basic authentication is working pretty well.
Hope this helps,
Dave.
|
|
|
Edited by smarty - March 09 2016 at 04:42
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
jonkjon Groupie
Joined: June 21 2010
Online Status: Offline Posts: 77
|
Posted: April 08 2016 at 13:03 | IP Logged
|
|
|
Jay
I notice that your on/off url's are going to port 8080.
Is 8080, in your case, the PH server or is that the HAB
port?
i.e. Are the on/off url's supposed to be sent to the HAB
or PH?
Thanks for your guide and info on this.
--Jon
|
Back to Top |
|
|
Jaaay Newbie
Joined: July 01 2012
Online Status: Offline Posts: 24
|
Posted: April 09 2016 at 15:03 | IP Logged
|
|
|
Jonkon.. That is my PH port 8080.. From what I
remember I was running both on the same server so I
needed to start the HA bridge on a different port.
I used the following to start the HA bridge server
with a different port: (all one line command)
java -jar amazon-echo-bridge-0.1.3.jar --
upnp.config.address=192.168.1.50 --server.port=8081
I also remembered starting to have issues at 20
devices.. Not sure if the HA bridge has been fixed for
that issue. I also remember having to clear the
devices before reloading them if there was a change.
|
Back to Top |
|
|
jonkjon Groupie
Joined: June 21 2010
Online Status: Offline Posts: 77
|
Posted: April 09 2016 at 16:08 | IP Logged
|
|
|
Thanks Jaaay;
I got it setup using the builtin configurator. I am using the 0.2.1 jar. The configurator makes this a breeze to set up. I currently have 14 devices in there. I haven't received my Echo yet so we'll have to see.
I would also like to get my Limitless LED bulbs working through PH. I have a small Windows application that controls them but if I recall there was an issue with UDP commands through PH. I know there are some bindings available through the HA bridge but I'd rather find a command from PH to do it. I'll have to go back and see where I was running into problems.
Again, thanks for all of your help....
--Jon
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: April 10 2016 at 12:09 | IP Logged
|
|
|
jonkjon wrote:
Thanks Jaaay;
...I would also like to get my Limitless LED bulbs working through PH. I have a small Windows application that controls them but if I recall there was an issue with UDP commands through PH. I know there are some bindings available through the HA bridge but I'd rather find a command from PH to do it....
--Jon |
|
|
I too am waiting for native PH support for the UDP commands....what is the windows program your presently using?
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
jonkjon Groupie
Joined: June 21 2010
Online Status: Offline Posts: 77
|
Posted: April 10 2016 at 18:49 | IP Logged
|
|
|
It's a simple Windows form application I wrote to work with the Limitless LED API. It really was just to figure out the commands etc.
I wound up just using Domoticz on a linux machine for now passing json commands to the HA Bridge. I don't have my Echo yet to test it all out but it is configured and ready to go when it gets here this week.
--Jon
|
Back to Top |
|
|
DennisWeller Newbie
Joined: April 12 2016 Location: United States
Online Status: Offline Posts: 2
|
Posted: April 12 2016 at 14:41 | IP Logged
|
|
|
I know this is about the Amazon Echo, but has anyone on here had any
experience at all with Samsung's 'Smart things'?
|
Back to Top |
|
|
jonkjon Groupie
Joined: June 21 2010
Online Status: Offline Posts: 77
|
Posted: April 13 2016 at 18:24 | IP Logged
|
|
|
Just a follow up on the Echo and HA Bridge with PH. I got everything setup and interaction with PH is perfect. The new configurator in the bridge is also really nice.
I did run into the device limit where the echo stopped recognizing there were devices. The limit for me was 28 devices, add one more and it will tell you it can't find any devices. The workaround for that is to run multiple instances of the bridge on different ports.
I also had to get a little creative with some of the names for devices as the one's I originally setup conflicted with built in commands. I would suggest avoiding names that contain the word "Music".
Again, thanks for the original info in setting this all up!
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: May 10 2016 at 07:48 | IP Logged
|
|
|
An update on this general topic....
While the IFTTT Maker channel is an option for PH voice control, your webserver password is "kinda" exposed (as mentioned above).
So, I started looking into the GitHub Armzilla HA-bridge Hue emulator (also mentioned above). However, that project has went dormant, and a new "fork" has become the "dominate" Hue emulator bridge. This new and very refined project can be found here
It appears to me that this approach is safer (no passwords exposed to the outside). It allows for On/Off/Dimming of devices, as well as any custom PH macro /formula calls through PH's webserver (done locally).
I now say turn on/off kitchen lights, and the echo says "OK". No more trigger words...
Very happy with the possibilities of MUCH PH integration....but I am just starting to scratch the surface of HA voice control and interaction.
Edited by smarty - May 10 2016 at 07:55
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
jonkjon Groupie
Joined: June 21 2010
Online Status: Offline Posts: 77
|
Posted: May 11 2016 at 10:43 | IP Logged
|
|
|
smarty, looking over the link you posted for the newer fork I was wondering if that has the configurator.
--Jon
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: May 11 2016 at 14:40 | IP Logged
|
|
|
jonkjon wrote:
smarty, looking over the link you posted for the newer fork I was wondering if that has the configurator.
--Jon |
|
|
Yes it does. It is even more advanced. The configurator page would be found at:
//ip_address_of_emulator_host:8080
Note that this is not the same location as the Armzilla configurator.
Also, initially I had an issues opening this page when using IE-11. Use Chrome or Safari and it will load and display properly.
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
jonkjon Groupie
Joined: June 21 2010
Online Status: Offline Posts: 77
|
Posted: May 11 2016 at 17:48 | IP Logged
|
|
|
Thanks for the information on this. I'll probably keep my setup for now as it is working and fairly easy to maintain.
It looks like Amazon keeps adding to their builtin keyword list as my "Netflix" command no longer works. I just get a "thump" sound.....
On a side note, are you using the Milights or Hue? I had to go through another HA package to get the commands to work for the Milights. Does this offer a way to just add one bulb as a device and you can issue voice commands like "Alexa, set overhead lights to blue"? I had to create devices and use python scripts to get that functionality. I don't have to use any keywords or anything just; "Alexa, turn on blue lights."
Thanks again...
--Jon
Edited by jonkjon - May 11 2016 at 17:58
|
Back to Top |
|
|