This tutorial explains how crelay can be controlled via the IFTTT cloud service, using crelay's HTTP API. Since crelay does currently not implement any authorization method, it is a security hazard to expose the crelay API to the public Internet. Please read the disclaimer below.
- Setup your crelay, and make sure it's working correctly.
Once again, this can be a major security hazard, if you do not secure your connection properly. Please do not use this method unless you know what you are doing.
-
Forward the crelay port (By default it's 8000, though i recommend changing it, if you have shared your IP with anyone.) through your router. (This guide can be helpful)
-
Find your public IP, eventually by using WhatIsMyIPAddress, and looking under IPv4.
-
Go to IFTTT, and create an account.
-
Create a new applet, by going under "My Applets", and then pressing the "New Applet" button.
-
Press the "+this", and choose a service, which in this case, will be Google Assistant.
-
Then choose a trigger, (I chose the one called "Say a simple phrase".) and set it up to your likings.
-
When you have set up your trigger, press the "+that", and choose the service called "Webhooks", then the action called "Make a web request".
-
Under "URL" you have to put in "https://YourPublicIP:YourcrelayPort/gpio?pin=RelayNumber&status=Status", with YourPublicIP being the IP you got from WhatIsMyIPAddress, and YourcrelayPort being the port you use for crelay, and RelayNumber being the relay that you wan't to turn on, and Status being "1" for "On" and "0" for "Off".
-
The method should be "GET", and the Content Type should be "text/plain", and the Body should be left empty.
-
Now press "Create action"
-
Now press "Finish" (And disable notifications)
-
Now repeat the steps from 5 to 12, only with the "1" in "&status=1" being a "0"
By forwarding the crelay API port from the public Internet you agree with the following terms:
You alone are responsible for securing your connection, at least by changing the default port.
Neither the author of crelay ondrej1024 nor the author of this tutorial Luna are responsible for any security hazards which may occur with opening your crelay port to the public Internet.
Opening the port for your crelay can be a major security hazard if you don't know how to protect your things correctly.