Following the announcement of IFTTT app to support Makers with their projects through an dedicated channel, allowing them to feed event data into the great world of interaction with tons of things ... Smartphone and it's new best friend the low cost ESP8266 sensor node! (If you want to run its ESP8266 just on solar power check our solar project too)
For all the DIYers, tinkerers, and creative coders out there — we’re thrilled to introduce you to the Maker Channel. (Source: IFTTT blog)
http://blog.ifttt.com/post/121786069098/introducing-the-maker-channel
We started to explore the new channel:
Step 1
connect through your IF app (aka IFTTT) to the new Maker channel, you will receive an unique key "YOURKEY" followed by a URL to fire the "test" event, like this:
http://maker.ifttt.com/trigger/test/with/key/YOURKEY
(replace always the YOURKEY with the key the channel assigned to you)
http://maker.ifttt.com/trigger/test/with/key/YOURKEY?value1=...
(you can add up to three values per event)
Step 2
Build your recipe, use "test" when being asked for a name of your Maker channel event:
On the ESP8266 nodeMCU console you can run this to kick off the event:
> conn=net.createConnection(net.TCP, 0)
> conn:on("receive", function(conn, payload) print(payload) end)
> conn:connect(80,'maker.ifttt.com')
> conn:send("GET /trigger/test/with/key/YOURKEY HTTP/1.1\r\n")
> conn:send("Host: maker.ifttt.com\r\n")
> conn:send("Accept: */*\r\n")
> conn:send("User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.)\r\n")
> conn:send("\r\n")
> HTTP/1.1 200 OK
Server: Cowboy
Connection: keep-alive
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 44
Etag: W/"2c-4f52ca3d"
Date: Fri, 19 Jun 2015 15:48:33 GMT
Via: 1.1 vegur
Congratulations! You've fired the test event
Done!
Now you can use the URL for triggering the event in all your platforms ESP8266, Raspberry Pi, Arduino, ... attaching a sample code for the nodeMCU on ESP8266.
Btw there is also the option to send data (3 values) like add &value1=100 ...
UPDATE: The lua script has been updated and is now working, an issue was the domain name translation - now we can use the domain name.
Btw. on the Raspberry Pi simply run:
curl -X POST https://maker.ifttt.com/trigger/test/with/key/YOURKEY
Comments