Configuring IFTTT to register medicine taken

IFTTT (If This Then That or If this happens then that happens) is a platform that allows to get services together into Applets and connections. These are specific things that can happen when connect services.

As a complement to the Smart Mirror functionality, we will use IFTTT as a connector between the smartphone (a push button) and a Google Sheet spreadsheet (to register medicine taken).

image-14

Let’s start creating the Applet by clicking the Create button:

Applet creation consists of defining what needs to happen first and, if it happens, what needs to happen then. So first, we need to select and configure what we expect to occur by clicking on the If This black button:

image-15

We search and then click on the Button widget service:

image-16

This trigger will fire every time you press the button (to configure later) on the smartphone screen.

Now we have to add a query (the first instruction to process when pressing the button):

image-17

The query (click Add query) to select is Google Calendar, where we choose List Events for a Date, a query that will return a list of events in the calendar for a specific day:

image-18

The event let us select the calendar (in this case, Smart Mirror, created previously and used into the coding to show the calendar in the mirror). Add the ingredient (or variable) OccuredAt to the Date field and click Create query:

image-19

Now we are ready to create the second part of our Applet by clicking on the Then That black button:

image-21

Look for the Google Sheets service and choose Add row to spreadsheet:

image-22

The configuration requires the spreadsheet name (call it Taken) and the row format:

  • OcurredAt: Date and time the user presses the button on the smartphone screen.

  • Title: Title for the calendar.

  • Description: Description of the calendar event.

We need to add the folder name to store the spreadsheet in Google Drive:

image-20

Confirm the action and the Applet is ready and running:

image-23

Edit the Applet name and call it Medicine:

image-24

We are now ready to configure the button in the smartphone. Long-press the smartphone screen to show access to widgets (this may be different depending on your smartphone and operating system):

image-25


Then, look for the IFTTT widgets group and select the 1x1 widget:

image-26


Now we need to associate the widget with the Applet by selecting it:

image-27

The result is a button on the smartphone screen. When pressing the button, the Applet reads the information from the calendar and write it into the spreadsheet:

image-28


The shortcut to the spreadsheet let the user have easy access to the records:

image-29


With this solution, the Smart Mirror reminds the user to take medicines. When done, the user pushes the Medicine button on the smartphone registering the date and time they took the medication.