Scottmichaelj Posted November 13, 2015 Posted November 13, 2015 Amazon added IFTTT so now you can say custom commands to Alexa to run recipes IFTTT. For example the "maker channel" is avail now. Check the skills section on the Alexa app.
MWareman Posted November 13, 2015 Posted November 13, 2015 Woot! Just need ISY Portal integrating and.... Joy! Sent from my Nexus 9 using Tapatalk
MWareman Posted November 13, 2015 Posted November 13, 2015 Cool... This is 'Alexa, trigger xxxx'. Nice. With the Maker channel on IFTTT almost anything becomes possible. When (if) token auth to Portal comes it will, allow 'Alexa, trigger xxx' to call the ISY Portal with a REST call to execute programs..... Via the Maker channel. Sweet! Sent from my Nexus 9 using Tapatalk
Scottmichaelj Posted November 13, 2015 Author Posted November 13, 2015 Yeah this is great news indeed! Too bad IFTTT.com website is having issues right now so I can't go play! I noticed it via the app because I was adding the second Echo I purchased on sale this week, today.
MWareman Posted November 13, 2015 Posted November 13, 2015 Yep... Maybe too many Alexa users linking up... Oh, forgot to add. In my Alexa app (Android), IFTTT does not show up. Are you seeing this on IOS or Android?
Scottmichaelj Posted November 13, 2015 Author Posted November 13, 2015 Now we need to figure out, if you have the networking module how to get the maker channel to send a notification to the ISY to run a program.
MWareman Posted November 13, 2015 Posted November 13, 2015 I happen to know of, but not sure I can talk much about, an upcoming feature for the ISY Portal to make interaction from the Maker channel much easier... and more secure that storing your ISY credential in the URL on IFTTT And, you don't need the networking module for inbound REST calls from the Maker channel (or anywhere else).
Scottmichaelj Posted November 13, 2015 Author Posted November 13, 2015 IFTTT.com is backup. Well I hope Michel or someone spills the beans soon so we all don't waste out time adding a ton of programs if what you say is true.
MWareman Posted November 14, 2015 Posted November 14, 2015 I've linked my Echo to IFTTT and created a 'If Alexa Trigger Cabinet Lights' to call a Maker channel url. This URL is to my .PHP script that I use as a proxy to ISY. Anyway - the URL simply calls a program, which is 'If light is off then turn scene on, else turn scene off'. On saying 'Alexa, Trigger cabinet lights' it takes about 4-5 seconds - and they toggle... Seems the delay is with Alexa sending the request though... watching the log on my Apache server the php=>ISY is happening very quickly, as always. A good day... Edit: Subsequent runs complete very quickly.... after recognizing the command Alexa says 'Sending it' and before she finishes the lights have toggled state... Nice!
Scottmichaelj Posted November 14, 2015 Author Posted November 14, 2015 I've linked my Echo to IFTTT and created a 'If Alexa Trigger Cabinet Lights' to call a Maker channel url. This URL is to my .PHP script that I use as a proxy to ISY. Anyway - the URL simply calls a program, which is 'If light is off then turn scene on, else turn scene off'. On saying 'Alexa, Trigger cabinet lights' it takes about 4-5 seconds - and they toggle... Seems the delay is with Alexa sending the request though... watching the log on my Apache server the php=>ISY is happening very quickly, as always. A good day... Edit: Subsequent runs complete very quickly.... after recognizing the command Alexa says 'Sending it' and before she finishes the lights have toggled state... Nice! What is the url scheme for running programs? I need both RUN and THEN. Thanks. EDIT: I thought it would be something like: http: //external-ip.com/ username:password@ISY-IP /rest/programs/program-number/run
MWareman Posted November 14, 2015 Posted November 14, 2015 The general format is: https://$ISYuser:$ISYpassword@$ISYurl/rest/programs/$ISY_Node/$run_option Where $run_option is one of: runIf, runThen, runElse. I have programs that toggle lights - so I use runIf to run the toggle. The programs themselves are 'disabled'. I have a .php script where my Maker URL is more like: https://api.domain.com/ifttt/$APIKEY/rest/programs/$ISY_Node/$run_option If the $APIKEY is correct and /rest/programs/ follows - the URL get's sent to ISY with authentication (minus the /ifttt/$APIKEY). No need to store the password on IFTTT... The SSL certificate needs to be trusted by IFTTT. This means you need a paid certificate - not a self-signed one.
MWareman Posted November 14, 2015 Posted November 14, 2015 Here is the .php script I'm using on my internal Apache host (with a paid SSL certificate)... (not real IPs or credentials of course!) This 'translates' unauthenticated requests (from the Maker channel) into authenticated API requests to ISY... but limiting the actions that can be taken, and protection by having a complex randomly named directory... <?php $ISYuser = "admin"; $ISYpassword = "password"; $ISYurl = "192.168.1.2"; $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'); $request = ""; if(isset($_GET['request'])){ $request = $_GET['request']; if (substr(strtolower($request),0,14) === "rest/programs/") { $url = "http://$ISYuser:$ISYpassword@$ISYurl/$request"; $content = file_get_contents($url); echo $content; echo "<br>"; } else { header($protocol . ' 401 Unauthorized'); $GLOBALS['http_response_code'] = 401; exit; } } else { header($protocol . ' 401 Unauthorized'); $GLOBALS['http_response_code'] = 401; exit; } ?> There is a .htaccess that goes with it: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)$ index.php?request=$1 [QSA,NC,L] The whole thing is in a subdirectory on my Apache host - with a long, strong random name.... The actions are restricted to only programs - so the worst that can happen if the private URL is compromised is programs triggered. No loss of credentials, no disarming my house alarm etc...
MWareman Posted November 14, 2015 Posted November 14, 2015 Odd, the code doesn't show well in Tapatalk. Shows fine on the web interface.... Sent from my Nexus 9 using Tapatalk
Scottmichaelj Posted November 14, 2015 Author Posted November 14, 2015 The general format is: https://$ISYuser:$ISYpassword@$ISYurl/rest/programs/$ISY_Node/$run_option Where $run_option is one of: runIf, runThen, runElse. I have programs that toggle lights - so I use runIf to run the toggle. The programs themselves are 'disabled'. I have a .php script where my Maker URL is more like: https://api.domain.com/ifttt/$APIKEY/rest/programs/$ISY_Node/$run_option If the $APIKEY is correct and /rest/programs/ follows - the URL get's sent to ISY with authentication (minus the /ifttt/$APIKEY). No need to store the password on IFTTT... The SSL certificate needs to be trusted by IFTTT. This means you need a paid certificate - not a self-signed one. Yeah I am getting stopped because I dont have a SSL certificate. I been meaning to get one but haven't looked into it. Any suggestions?
MWareman Posted November 14, 2015 Posted November 14, 2015 I got my certificate thru this site: http://www.garrisonhost.com/ssl-certificates/alphassl.html I use a wildcard - this is the cheapest wildcard site I've found. I use the wildcard on my proxy - so I can host multiple sites under different names on one certificate. If you're just looking for a cert for ISY - their regular cert should work fine.
MWareman Posted November 14, 2015 Posted November 14, 2015 Odd - all I'm getting for my 'Alexa, trigger cabinet lights' is 'Sorry, something went wrong' - and the IFTTT trigger is not sent. In my Alexa history, it shows the command being recognized correctly. I went to the Alexa channel on IFTTT and it shows no history this morning. There appear to be growing pains - Alexa is not currently playing nice.
Scottmichaelj Posted November 14, 2015 Author Posted November 14, 2015 Odd - all I'm getting for my 'Alexa, trigger cabinet lights' is 'Sorry, something went wrong' - and the IFTTT trigger is not sent. In my Alexa history, it shows the command being recognized correctly. I went to the Alexa channel on IFTTT and it shows no history this morning. There appear to be growing pains - Alexa is not currently playing nice. Sorry can't test, I am still looking into SSL certs, how they work and how to install on my ISY. I might just wait on this and see if SSL will be required if I use the portal.
apnar Posted November 14, 2015 Posted November 14, 2015 On the cert question, check out: https://letsencrypt.org/ Won't be live for another couple weeks but will be offering completely free real trusted certificates.
MWareman Posted November 14, 2015 Posted November 14, 2015 On the cert question, check out: https://letsencrypt.org/ Won't be live for another couple weeks but will be offering completely free real trusted certificates. I've been watching this project with interest for a while now. Hopefully, UDI will integrate the client for this service right in the ISY. So getting a real, valid certificate is as few clicks as possible for ISY users.
Scottmichaelj Posted November 15, 2015 Author Posted November 15, 2015 Thanks guys for the info. I will wait and see what happens but that means no IFTTT fun for me since it looks like I need a cert for it to work with the Maker channel.
ahwman Posted November 20, 2015 Posted November 20, 2015 I got my certificate thru this site: http://www.garrisonhost.com/ssl-certificates/alphassl.html I use a wildcard - this is the cheapest wildcard site I've found. I use the wildcard on my proxy - so I can host multiple sites under different names on one certificate. If you're just looking for a cert for ISY - their regular cert should work fine. I just purchased a standard certificate from this company and was wondering what I should use for web server type when generating the certificate since it will be hosted on the ISY? Thanks, Chuck
apnar Posted November 20, 2015 Posted November 20, 2015 Until letsencrypt is up and running, you can get free certs from startssl ( Need to jump through a few hoops, but they are valid and completely free for non-commercial use.
MWareman Posted November 20, 2015 Posted November 20, 2015 I just purchased a standard certificate from this company and was wondering what I should use for web server type when generating the certificate since it will be hosted on the ISY? Thanks, Chuck I cannot remember what I selected, but I used OpenSSL on a Ubuntu host to generate the private key then the csr - and then when I retrieved the signed public key I married it with the private key. Using OpenSSL I can then convert it to whatever format I need for various applications.
ahwman Posted November 21, 2015 Posted November 21, 2015 I cannot remember what I selected, but I used OpenSSL on a Ubuntu host to generate the private key then the csr - and then when I retrieved the signed public key I married it with the private key. Using OpenSSL I can then convert it to whatever format I need for various applications.Few questions: I was able to generate the new key and pasted it into my ISY using the receive cert button and I can now log into my ISY via HTTPS remotely without any errors or security warnings and I see the lock in the browser windows so I assume I'm good there? However when the Maker app on IFTTT tries to run the script I see this error in the logs. Any ideas what may be going on? Action skipped1 minute ago Unable to make web request: Error: unable to verify the first certificate
MWareman Posted November 21, 2015 Posted November 21, 2015 Please follow this thread on installing the needed intermediate. Like I mentioned before, I use a Ubuntu server for my SSL, and proxy to the ISY for this purpose. Michael. http://forum.universal-devices.com/index.php?/topic/17333-How-do-you-install-an-intermediate-certificate-on-ISY?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.