IFTTT integration with Domoticz

From Domoticz
Jump to: navigation, search

Medium.png

IFTTT has a channel called Maker which can be used to send and receive HTTP requests to/from Domoticz. The Maker Channel allows you to connect IFTTT to your personal DIY projects. With Maker, you can connect a Recipe to any device or service that can make or receive a web request (aka webhooks).

Send a web request to IFTTT

This Trigger fires every time the Maker Channel receives a web request to notify it of an event. See "How to Trigger Events" on the Maker Channel page.

 Trigger fields: Event Name
 Ingredients: Event Name (The name of the event that was triggered), Value1 (Extra data sent with the event), Value2, Value3, OccurredAt (Date and time event occurred)

Please note that for using user/password you should set your authentication to "Basic-Auth".

To trigger an Event make a POST or GET web request to:

https://maker.ifttt.com/trigger/{event}/with/key/xxxxxxxxxxxxxxx

Which can be easily done from a bash script

 curl -X POST -H "Content-Type: application/json" -d '{"value1":"blabla1","value2":"blabla2","value3":"blabla3"}' https://maker.ifttt.com/trigger/{event}/with/key/xxxxxxxxxxxxxxx

Receive a web request from IFTTT

This Action will make a web request from IFTTT to a publicly accessible URL (your Domoticz server).

Action fields: URL, Method, Content Type, Body

This could be used in conjunction with Domoticz, when using user/password, for example as:

 THIS part : If SMS is received (for example)
 THAT part : Add "Maker" and configure it that way :
 - URL :  http://<user>:<password>@<domoticz public IP or URL>:8080/json.htm?type=command&param=udevice&idx=<id>&nvalue=0&svalue={{ContactName}}
 - Method : GET
 - Content-Type : text/plain
 - Body : Nothing