posted on June 19, 2016

Tracking Your Baby's Body Rhythms with Tasker and IFTTT

by: Nick Mosher

Overview

There are three different goals here but all for the same purpose. Helping sleep deprived parents keep their infant baby on track without needing to buy another device.

Problem:

Remembering the last sleep, changing, or feeding is hard, especially when sleep deprived.

Solution:

Using Tasker and your phone you can track sleep, changings, and feedings.

Requirements

Tasker, AutoRemote, IFTTT, Google Drive


Part 1) Sleep Tracking

The goal here is to create two tasks. The first “Baby Sleep” task creates a time stamp of the sleep and creates a notification in the drawer to activate task two: “Baby Wake”. This second tasks is meant to calculate the time asleep and push that value to a google spreadsheet. As a bonus you will be able to restart the sleep timer if you find out the kid wasn’t asleep at all.

Part 1) Task 1: Baby Awake

  1. Create a new task and call it “Baby Awake”
  2. Create the first action as a Variable Set. Name: %BSleepDuration to: %Time - %BSleepStart. Make sure it to check the “Do Maths” box.
  3. Create a Notify Cancel action to cancel the title: “Sleep From %BSleepStart” notification.
  4. Create an AutoRemote Message with the Recipient of IFTTT. Set the Message: sleep=:=%BSleepDuration=:=KidName
  5. Go into IFTTT and set up an action to accept that AutoRemote notification.
  6. Set THIS to “Maker” channel to the “Event Name” of “sleep”
  7. Set THIS to “Google Drive” channel. Give it a spreadsheet and the “Format Row” of ``

Now we should be ready to add the baby sleep task.

Part 1) Task 2: Baby Sleep

  1. Create a new task and name it “Baby Sleep”
  2. Create the first action as a Notify Cancel. Set the title to “Sleep From %BSleepStart”
  3. Create an action to “Variable Set”. Name: %BSleepStart value: %Time
  4. Create an action to create a notification with the Title of “Sleep From %BSleepStart” (no quotes.) Give it an icon and two actions (listed below)
  5. In your notification create an action and name it “Restart”. Make it reset your %BSleepStart variable to the current time.
  6. In your notification action create another sub-action and name it “Awake”. Make it perform the task “Baby Awake”.

Known issue: How can we make sure to calculate correctly over a day change?

Part 1) Conclusion

Now if you set up a shortcut on your home screen you can trigger the Baby Sleep action just as soon as your little one goes to bed. Then make corrections right within your notification drawer as things change.

Part 2) Changing Times

Ever find that you need to track your baby’s bowel movements? This tracker will help log those in a spreadsheet so that you don’t have to write them down or remember them. For the sleep deprived parent this could help a lot.

Part 2) Task 1: Potty Send

  1. Create a task and call it “Potty Send”
  2. Create an AutoRemote Message with the Recipient of IFTTT. Set the Message: potty=:=%Ptype=:=KidName
  3. Set THIS to “Maker” channel to the “Event Name” of “potty”
  4. Set THIS to “Google Drive” channel. Give it a spreadsheet and the “Format Row” of ``

Part 2) Tasks 2,3,4: Pee, Poo, Both

These three tasks will be very similar. Create all three first, before you go any further.

  1. Create a task and name it Pee/Poo/Both (one each).
  2. Add an action to set a Variable. Name: %PType to pee/poo/both.
  3. Add an action to Peform Task: Potty Send.

Part 2) Task 5: Potty

This task, when launched from a button on your home screen will ask you what type of potty your kid went and automatically log that to the spreadsheet using the other tasks in these instructions.

  1. Create a task and call it “Potty”
  2. Create an action Popup Task Buttons. Set the Text to “What Type?” with the tasks of Pee, Poo, and Both.

Part 3) Baby Fed

This part is only one task that notifies you of the last feeding and creates a time stamp on a spreadsheet to track the feedings. It could be expanded to accept values if you want to track in the amount of food eaten.

  1. Create a task and call it “Baby Fed”
  2. Add an action to Notify Cancel with the title of “Last Feeding %BFed”.
  3. Add an action to set a variable to Name: %BFed to %TIME
  4. Add an action to Notify with the title of “Last Feeding %BFed”.
  5. Create an AutoRemote Message with the Recipient of IFTTT. Set the Message: fed=:=KidName
  6. Set THIS to “Maker” channel to the “Event Name” of “fed”
  7. Set THIS to “Google Drive” channel. Give it a spreadsheet and the “Format Row” of {{OccurredAt}} ||| {{Value1}}
Join the Discussion!

Discuss this project in the Automate Your Life forums.

Nick Mosher bio image

About Nick Mosher

Nick is an Interaction and Experience designer. He creates web sites, intranet platforms, and web applications always with the customer's intuitive and effective use at the forefront of my planning. Currently, he works as a User Experience Designer for the American Academy of Family Physicians. At the AAFP, he works to champion the user experience on websites such as FamilyDoctor.org and AAFP.org.