This post should hopefully tie in what I do with my sleep tacking data and time tracking. It’s more complicated than it needs to be but automation and integration is still maturing with a large split between business focused (Zapier and Microsoft Flow) and consumer (IFTTT).
The aim of this to get the sleep duration and log the time into a time tracker.
I use the Withins app with the sleep mat as a data source because it has start and end times for each sleep activity. The downside to this data source is there is a delay because it only triggers on a daily basis and pushes all the sleep data at once. This is different from when you go to sleep which triggers when the sleep mat detects someone getting into bed and does not have the end date/time.
Sleep as Android would be my preferred data source however the Sleep as Android cloud sync only contains the start date and time so I can’t add the data to Toggl.
As you can see form the above, it’s not a simple data mapping of start and end date time. I’ve had to use two automation flow and 3 services to achieve what I want.
The app captures the sleep data from the sleep mat on Nokia’s server. You need an account so it can be linked to IFTTT.
Fortunately, Withings Sleep has integration on IFTTT so it’s as simple as connecting to your account and setting up a trigger. The trigger is called “Export my last sleep data” and then “Add row to spreadsheet” in Google Sheets.
IFTTT fortunately unfortunately displays dates in a human readable format rather than a computer format. Further down the line, Toggl uses the ISO 8601 date formats as YYYY-MM-ddTHH:mm:ss e.g
I have copied the “Formatted row” to a text file so you can copy and paste all the available fields and tweak where needed.
Create a new zap for a “New Spreadhseet Row” in Google Sheets. The next step is to create a time entry in Toggl using specific columns in the newly inserted row.
To get the zap, click here.
Withings only provide the sleep data once per day so if you miss it, you’re out of luck. Also this introduces a day lag in your recorded timers.
It seems needlessly complicated but shows how integrations are better when they are open. Also these are freemium services so there if you’re using more than the free tier I’m afraid it will cost to do this.
Sleeping accounts for 1/3 of my day and happens daily so it saves a lot of time and putting this data in manually.
More on what I do with the data later.