Working Principle of the Voice Control Version 2
In this page, we will go into detail about how the voice control works. Figure 7 shows a brief overview of the working principle of the voice control. Disclaimer: This page is not meant as a tutorial, and the order of the explanation does not follow the order of creation.
Part 1: Using a smartphone’s built-in speech recognition
For Apple users, the “Shortcuts” application introduced in iOS 12 allows for the addition of custom commands that can be activated through Apple’s voice assistant, Siri. IFTTT’s Webhooks were used as triggers. In simple terms, by setting up Webhooks, if a URL is pinged, it acts as a trigger for the Applet in IFTTT, which runs whatever logic is in the Applet. This means that in Shortcuts, we need to create a shortcut that automatically accesses the correct URL whenever we say “Hey Siri, <Shortcut name>”. An example is shown in Figure 5a-5c below.
Part 2: Creating a feed in Adafruit.io
A feed called “Raspberry Pi” was created in Adafruit.io, and this feed serves as the channel for IFTTT to communicate with Adafruit.io. This feed is also read by the Raspberry Pi, which allows us to run a function when a certain message is received.
Part 3: Connecting IFTTT Applet with Webhooks and Adafruit.io
The name of the IFTTT Applet that was created is turn_off, which corresponds to the name of the Applet connected in Part 1. When the URL is pinged, this applet will run.
Part 4: The python script on Raspberry Pi
The explanation and the code can be found here.