Skip to content

Commit

Permalink
Grammar fixes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
haimkastner authored Oct 31, 2019
1 parent f808a1d commit 98c0d76
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions backend/src/modules/ifttt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ But, some of the devices not supported any API to control it in an offline netwo
It can allow control of any device that his manufacturer support Ifttt services.

> Note, this is not an Ifttt integration for the whole project,
To allow turn on/off any device by any Ifttt trigger and to trigger by minion on/off event. see [Ifttt integration](../../../../README.md#ifttt-integration).
To allow turn on/off any device by any IFTTT trigger and to trigger by minion on/off event. see [IFTTT integration](../../../../README.md#ifttt-integration).

## Implementation
Currently, the implementation of the Ifttt interface is using Ifttt [WebHooks](https://ifttt.com/maker_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.
Currently, the implementation of the IFTTT interface is using IFTTT [WebHooks](https://ifttt.com/maker_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.

## Step by step instructions

### Create Ifttt account and minion.
### Create IFTTT account and minion.
1) Create an [IFTTT](https://ifttt.com/) account or login if already own one.
1) Connect [WebHooks](https://ifttt.com/maker_webhooks) to Ifttt account.
1) Watch and copy the webhooks API key.
1) Connect [WebHooks](https://ifttt.com/maker_webhooks) to IFTTT account.
1) Watch and copy the Webhooks API key.
- Go to https://ifttt.com/maker_webhooks and press on `documentation`
![Screenshot](../../../../docs/screenshots/ifttt/go-to-webhooks-documentation.PNG)
- Watch and copy the webhooks API key.
![Screenshot](../../../../docs/screenshots/ifttt/watch-webhooks-api-key.PNG)
1) Create a new minion in casa-net with brand `ifttt` model `switch` or `toggle` and paste the webhooks API key as device id.
1) Create a new minion in casa-net with brand `ifttt` model `switch` or `toggle` and paste the Webhooks API key as device id.
1) Copy the new minion inner-id from device meta.
- Open the new minion menu and select `device meta`, then copy inner-id.
![Screenshot](../../../../docs/screenshots/ifttt/copy-inner-id.PNG)

### Trigger turn on/off.
1) Go to [ifttt applets page](https://ifttt.com/my_applets) and press `new applet`.
1) Go to [IFTTT applets page](https://ifttt.com/my_applets) and press `new applet`.
1) Press on the `+this` button.
1) Choose webhooks service.
1) Choose Webhooks service.
- ![Screenshot](../../../../docs/screenshots/ifttt/choose-webhooks-service.PNG)
1) Choose the sebhooks trigger.
- ![Screenshot](../../../../docs/screenshots/ifttt/choose-webhooks-trigger.PNG)
Expand All @@ -44,7 +44,7 @@ but this project made to be totally in the user's hands and control. so using we
then press `create trigger`.
> Example for possible trigger name: `abc123-on` for a 'switch', `123abs-on-cold-med-21` for 'airConditioning', for the full options of the properties of minions status see in swagger the struct of the 'MinionStatus'.
- ![Screenshot](../../../../docs/screenshots/ifttt/put-interface-trigger-name.PNG)
1) Press on `+that` button and select the Ifttt service and the action that turn the device on.
1) Press on `+that` button and select the IFTTT service and the action that turn the device on.
1) Create the same trigger for `off` operation.

For now, it's possible to turn on/off the device via casa-net and use the device as `toggle` minion.
Expand All @@ -53,15 +53,15 @@ To receive feedback from the device to know when the device turned on/off and us
Make sure casa-net accessible via public internet or via remote-server.

### Listen to device turned on/off.
1) Create a trigger to be invoked when the device turned on/off using the manufature Ifttt service.
1) Create a trigger to be invoked when the device turned on/off using the manufacture IFTTT service.
1) Select WebHooks as an action service.
- ![Screenshot](../../../../docs/screenshots/ifttt/select-action-service.PNG)
1) Select make request action
- ![Screenshot](../../../../docs/screenshots/ifttt/choose-action.PNG)
1) Set the HTTP request as following struct:
- URL: `http://[casa-net server or remote server host/ip]/API/minions/[inner-id]/ifttt`.
- Method: `PUT`.
- Content-TypeL `application/json`.
- Content-Type `application/json`.
- Body:
```
{
Expand All @@ -70,7 +70,7 @@ Make sure casa-net accessible via public internet or via remote-server.
"newStatus": "on"
}
```
localMac field is required only if using remote-server. to get the local mac-address `GET` `/API/remote/machine-mac`.
The `localMac` field is required only if using remote-server. to get the local mac-address `GET` `/API/remote/machine-mac`.
- ![Screenshot](../../../../docs/screenshots/ifttt/interface-request.PNG)
That's it ;).

0 comments on commit 98c0d76

Please sign in to comment.