The IFTTT is great service and integrating it in an IoT service can be wonderful.
Now, all the ideas can integrate into a real house,
For example, turn on Air-Conditioner when the weather in the area is above x degrees. Turn on the boiler when you enter the neighborhood. And any other great using.
Note, this is not an IFTTT module to used as device communication API, for this see IFTTT module
Currently, the implementation of IFTTT integration is using IFTTT WebHooks. because implementing an IFTTT service requires registering a constant host to received IFTTT API calls, but this project made to be totally in the user's hands and control. so using Webhooks is the best option for it.
- Create an IFTTT account or login if already own one.
- Connect WebHooks to Ifttt account.
- Watch and copy the webhooks API key.
- Go to https://ifttt.com/maker_webhooks and press on
documentation
- Watch and copy the Webhooks API key.
- Go to https://ifttt.com/maker_webhooks and press on
- Login to casa-net as admin and go to settings (the small icon in toolbar) and in
IFTTT integration
section press onconfigure
and paste the IFTTT api key.
- Go to IFTTT applets page and press
new applet
. - Press on the
+this
button. - Choose Webhooks service.
- Choose the Webhooks trigger.
- Get the
inner-id
of a minion. - In event name put
when
, theinner-id
of minion and the on/off operation, all divided by-
, Look likewhen-xxxxxx-on
, And presscreate trigger
.Example here is for
on
operation, theoff
operation is just the same, but instead of 'on' put 'off'. - Press on the
+that
button and select the Ifttt service and the action that turns the device on. For example sending phone notification, email alert, or any idea from the wide IFTTT ecosystem. - Note that the 'Webhooks' trigger gives 3 variables to use, with the following values:
value1
: contains the minion display name.value2
: contains the minion type.value3
: contains the current detailed minion status.
- Create the same trigger for
off
operation of a minion.
- Create a trigger to be invoked by any IFTTT trigger service.
- Select WebHooks as an action service.
- Select make request action
- Set the HTTP request as following struct:
- URL:
http://[casa-net server or remote server host/ip]/API/ifttt/trigger/minions/[inner-id]
. - Method:
POST
. - Content-Type:
application/json
. - Body:
the
{ "localMac":"f4********83", "apiKey": "hjg***Webhooks API key***kjh", "setStatus": "on" }
localMac
field is required only if using remote-server. to get the local-mac-address login as admin, and in side-bar of settings click onget the local MAC address
button.
- URL:
It is used when the trigger gives only one text variable to pass to action. for example, SMS service allows passing the text message value to put it in Webhooks request.
- Create a trigger to be invoked by any IFTTT trigger service.
- Select Webhooks as an action service.
- Select make request action
- Set the HTTP request as following struct:
-
URL:
http://[casa-net server or remote server host/ip]/API/ifttt/trigger/minions/raw
. -
Method:
POST
. -
Content-Type:
application/json
. -
Body:
{ "localMac":"f4********83", "apiKey": "hjg***Webhooks API key***kjh", "minionId : "ac**ef", "setStatus": "on" }
the
localMac
field is required only if using remote-server. to get the local-mac-address login as admin, and in side-bar of settings click onget the local MAC address
button. -
In the example here putting in the body the ingredient
text
of SMS trigger:
-
- Create a trigger to be invoked by any IFTTT trigger service.
- Select Webhooks as an action service.
- Select make request action
- Set the HTTP request as following struct:
- URL:
http://[casa-net server or remote server host/ip]/API/ifttt/trigger/operations/[operationId]
. - Method:
POST
. - Content-Type:
application/json
. - Body:
the
{ "localMac":"f4********83", "apiKey": "hjg***Webhooks API key***kjh" }
localMac
field is required only if using remote-server. to get the local-mac-address login as admin, and in side-bar of settings click onget the local MAC address
button.
- URL:
That's it ;).