Get CPR certified in 30 minutes at CPR Test Center.
Echo & Alexa Forums

Run a URL - without using IFTTT

0 Members and 1 Guest are viewing this topic.

hamd01

Run a URL - without using IFTTT
« on: October 02, 2016, 08:10:00 pm »
I have read a few threads which touch on this topics, but all seem quite complex...i.e involve creating an AWS account and Lambada function.

I have everything setup locally....but actually getting Echo to load a URL is where I am stuck.

So for example, I want to say 'Alexa switch on the tv', and it would load this url, which would do the rest; All I would like to see do have Alexa load a url...which might be for example http://myip.com/switchonthetv.php

Now the big thing here.....is I CANNOT use IFTTT.  there is no support for ifttt in the uk...otherwise i would use ifttt+ the maker channel to do this.

Anyone any ideas?

Cheers guys.


UKEchoUser

Re: Run a URL - without using IFTTT
« Reply #1 on: October 04, 2016, 04:28:03 am »
I dont know if you are able to write python code or not but....within a couple of hours of getting my Echo last week I had this running:

https://github.com/makermusings/fauxmo

Works well, I had to add some code to turn on/off things but its solid. I have two lights automated. As it is code it could do anything... It will do what you want.

cherowley

Re: Run a URL - without using IFTTT
« Reply #2 on: October 11, 2016, 09:57:48 am »
Take a look at this:

http://bwssystems.com/

Their HA Bridge software emulates a Hue to the echo and in the software you setup all the tasks you want via a nice GUI :)

jer78

Re: Run a URL - without using IFTTT
« Reply #3 on: October 11, 2016, 03:00:54 pm »
Check out Home Assistant. It can do what you're asking and a heck of a lot more...

https://home-assistant.io/


Maff

Re: Run a URL - without using IFTTT
« Reply #4 on: October 17, 2016, 10:59:14 am »
I have read a few threads which touch on this topics, but all seem quite complex...i.e involve creating an AWS account and Lambada function.

I have everything setup locally....but actually getting Echo to load a URL is where I am stuck.

So for example, I want to say 'Alexa switch on the tv', and it would load this url, which would do the rest; All I would like to see do have Alexa load a url...which might be for example http://myip.com/switchonthetv.php

Now the big thing here.....is I CANNOT use IFTTT.  there is no support for ifttt in the uk...otherwise i would use ifttt+ the maker channel to do this.

Anyone any ideas?

Cheers guys.

Use IFTTT, just use a virtual smart things device switch to turn it on and off. (How to do this is covered in other threads here). (try searching for button tile/smart things virtual switch on here or google).

AndyWilson

Re: Run a URL - without using IFTTT
« Reply #5 on: October 17, 2016, 03:30:32 pm »
Now the big thing here.....is I CANNOT use IFTTT.  there is no support for ifttt in the uk...otherwise i would use ifttt+ the maker channel to do this.

Anyone any ideas?

Cheers guys.

Use IFTTT, just use a virtual smart things device switch to turn it on and off. (How to do this is covered in other threads here). (try searching for button tile/smart things virtual switch on here or google).

Erm - the OP does point out they can't use IFTTT!

I bought a raspberry pi and modified the previously mentioned Fauxmo program to run a URL - out together with a Wiwo S20 control program it lets me turn on/off cheap S20 switches but the same program can run any URL

Maff

Re: Run a URL - without using IFTTT
« Reply #6 on: October 21, 2016, 04:04:24 pm »
Erm... You misunderstood. You CAN use IFTTT in the UK, you just have to use an intermediary service called smart things which does also work now to trigger it. You set up a virtual device in smart things and Alexa will happily switch this on or off, and you set IFTTT to use your smart things device switch=ON to trigger your desired ON command on IFTTT and same for the OFF. Works perfectly for me. As I said, just look up how to do it as it is covered in other threads on this site.

DParker

Re: Run a URL - without using IFTTT
« Reply #7 on: October 21, 2016, 05:58:58 pm »
You CAN use IFTTT in the UK, you just have to use an intermediary service called smart things...

Not to mention a SmartThings hub.

Merlin051

Re: Run a URL - without using IFTTT
« Reply #8 on: October 21, 2016, 07:37:25 pm »
I'm using Ha-bridge from bws system.

https://github.com/bwssytems/ha-bridge

I've got it configured as a java process on my windows media server.(kodi)

I'm using it to run some python scripts for my Orvibo S20 plugs and to remotely turn my Xbox one on.(havnt worked how to turn it off yet)

Maff

Re: Run a URL - without using IFTTT
« Reply #9 on: October 22, 2016, 07:24:36 am »
You CAN use IFTTT in the UK, you just have to use an intermediary service called smart things...

Not to mention a SmartThings hub.

No, you don't need a smart thing hub, or any hardware to set up a smart things account, and set up some smart things virtual switches. They work perfectly well with Alexa given alexa connects to a cloud account to pick up the devices, rather than a home network connection as in the case of wemo devices. The virtual switches will happily trigger any IFTTT recipes of your choosing ☺️ I am surprised people are finding this so difficult to believe!

Maff

Re: Run a URL - without using IFTTT
« Reply #10 on: October 22, 2016, 07:45:55 am »
You can read about virtual switches here; https://community.smartthings.com/t/faq-creating-a-virtual-device/11282
Although I will say, on these instructions where it says type=simulated switch I find it better if you choose "on/off button tile". When I first did it I got stuck, as I didn't choose a 'location' =just pick any random thing (like your name), and it will work. Once you have your free smart things account (don't need a hub!) and have set up your virtual device, get the alexa skill for smart things, log in, and authorise alexa to interact with your device.

Then, on your IFTTT setup, also authorise it to use your smartthings device on the smart things channel, and then simply create your recipes so that device=on triggers your IFTTT ON command, and similar for the OFF position.

Once it is all set up, you can turn any IFTTT device on or off with a command on Alexa, in the UK, right now. 

DParker

Re: Run a URL - without using IFTTT
« Reply #11 on: October 22, 2016, 02:00:48 pm »
What do you specify for your Hub Name when creating a v-switch with no hub?

Maff

Re: Run a URL - without using IFTTT
« Reply #12 on: October 22, 2016, 04:14:54 pm »
Nothing. If memory serves, the website wanted some hub info when I first tried to sign up. I got round it by getting the Android app & setting up a username & password on there. After choosing those, there was a 'next' button, and the next page wanted hub info. However, then I just exited the app. The username & password were subsequently active on the website, without needing hub info. When you create a virtual device on the website, which is how I always do it, you pick a device name, device network ID (pick a random number) type=on/off button tile (which is compatible with Alexas on off commands) and the thing which stumped me initially.. Pick a location (I just gave it my name-after your first device you can subsequently pick whatever you called the location from a drop down list). Then the smart things website will accept that as a device. Alexa will subsequently pick up that device as if you have a hub, (as its a cloud connection it reads the devices from), and you authorise Alexa to use the device like normal. Do similar on IFTTT, and then you can use the on or off status of the device as IFTTT triggers. Job done! Honestly I've got loads of these. Even though my Alexa is set to the US system and therefore has IFTTT, I prefer this setup as it's more intuitive to say "turn on the TV" than "trigger TV".

ChrisLambourne

Re: Run a URL - without using IFTTT
« Reply #13 on: October 28, 2016, 12:06:10 pm »
If all you want to do is command Alexa to fire a URL, see below for Lambda code.

Code: [Select]
exports.handler = function( event, context ) {

var http = require('https');
var url = "myipaddress:1234/trigger?lightson.php";

http.get( url, function( response ) {
var data = '';
response.on( 'data', function( x ) { data += x; } );
response.on( 'end', function() {
output("OK", context, data);
} );
} );
};

function output( text, context, result ) {
var response = {
outputSpeech: {
type: "PlainText",
text: "Ok"
},
card: {
type: "Simple",
title: result
},
shouldEndSession: true
};
context.succeed( { response: response } );
}

Further info on how to create your own Alexa Skill is below:

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/alexa-skill-tutorial

StevenR

Re: Run a URL - without using IFTTT
« Reply #14 on: December 12, 2016, 05:38:09 am »
If you have a Raspberry Pi, take a look at the following which describes how you can emulate the protocol used by WeMo plugs in Python:

http://www.instructables.com/id/Hacking-the-Amazon-Echo/

I used this to create a virtual WeMo plug which allows me to wake my Mac up by saying "Alexa, turn on my computer" (it sends a WOL "magic packet).

Edit: Just realised that this has already been mentioned, didn't notice the mention of Fauxmo.
« Last Edit: December 12, 2016, 05:40:05 am by StevenR »