One of easiest way to utilise the Web Hook Block is use the service IFTTT (if this then that). This service connects your favourite apps and devices through the internet. In this case we can connect our Web Hook Block and our Kitsi Creator with a plethora or apps and devices available on their service. In particular, we will use the Google Assistant service to configure a voice command to trigger an event in our logic. In this case we will use Google Assistant to turn on the TV using the IR Block.
Before using the IFTTT site you will need to create an account. Once you have created an account and logged in follow the steps below to create your project.
- First things first, insert a Web Hook Block, and click on the Block Properties. Create a new event called Turn on TV and copy the Event URL. See article Using Webhooks for more detail.
- Open up the IFTTT website, and select Create from your avatar in the top right.
- Create your IFTTT will open up. Click on the 'This' link.
- Next, search for Google Assistant, and then click on the Google Assistant icon. NOTE: Make sure your Google account is connected to IFTTT.
- Now, you'll have a few options to select from. They range in complexity depending on the voice command complexity. For this exercise select the simple phrase.
- Next you will configure Google Assistant for voice commands which will activate your web hook. For instance we will configure Google Assistant to active our web hook on the phrase 'Please turn on the TV', in which Google Assistant will respond with 'TV will turn on shortly'.
You can also create slight variations of the voice command in which Google Assistant will be activated as well. After you have configured Google Assistant, click Create trigger.
- Click on Next.
- Search for Web hook. Click on web hook icon.
- Click on Make a web request.
- Now, paste your Event URL you copied before into the URL section. Then click create action.
- Congratulations! You've connected Google Assistant with your Web Hook.
Now you can start creating the logic for turning on the TV within the Logic Maker. Firstly, record the turn on key from your TV remote using the IR Block properties. See our article on the IR Block for reference.
- Connect your Web Hook Block with your IR Block in the Workspace. Then go into the Web Hook Logic Maker.
- Insert an ACTION and INPUT Gate. Within the ACTION Gate, select the IR Signal you recorded for turning on the TV. In the INPUT Gate, select the web hook for turning on the TV.
- Now your ready to start testing out your web hook using your Google Assistant on your phone. Using the Google Assistant, say the words 'Please turn on the TV'.