owlet_monitor icon indicating copy to clipboard operation
owlet_monitor copied to clipboard

This Python script monitors Owlet Smart Sock statistics such as heart rate, oxygen level, etc. Its implementation was made possible after reverse engineering the Owlet Android app version 1.1.41 (latest version as of April 2020) to understand how the data is recorded and fetched.

owlet_monitor prints the statistics every 10 seconds on stdout in CSV format. Your owlet username and password must be passed via environment variables. Log messages are printed on stderr.

Usage:

$ env [email protected] OWLET_PASS=xxx ./owlet_monitor >logfile
Logging in
Auth token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Getting DSN
Found Owlet monitor device serial number ACxxxxxxxxxxxxx
AC000W00XXXXXXX Status: 1532665440, 131, 100, still
AC000W00XXXXXXX Status: 1532665450, 125, 100, still
[...]

(If you are using an Owlet in Europe, set the OWLET_REGION environment variable to europe to use the European servers otherwise you may get a 400/EMAIL_NOT_FOUND error.)

Each CSV line consists of:

  • timestamp (seconds since UNIX Epoch time)
  • heart rate (BPM)
  • blood oxygen level (%)
  • movement (from sock sensor: baby still or wiggling)
  • device serial number (useful for multiple babies/owlet devices)

Technical details

  • The owlet account email and password are validated using Firebase Authentication — this returns a JWT
  • A GET request authenticated with the JWT is made to https://ayla-sso.owletdata.com/mini/ — this returns a mini_token
  • The mini_token is used to sign into the Ayla Networks cloud API
  • Heart rate, oxygen level, etc are periodically fetched from the Ayla API

Many details (app id/secret, property names, apparent need to set APP_ACTIVE=1) were reverse-enginered from Owlet's Android app.

You can place "index.html" and "logfile" in a directory served by a web server and browse "index.html?logfile" to see a chart.