This project aims to demonstrates the New Relic Telemetry SDK usage for Python for retrieving Owlet Smart Sock v2/v3 Sensor statistics such as heart rate, oxygen level, etc.
The script's implementation was made possible after others first reversed engineered the android app to understand how the data is recorded and fetched. Credit for the only known login API to work goes to @mbevand for their work in https://github.com/mbevand/owlet_monitor/blob/master/owlet_monitor. This script herein has been significantly enhanced for stability logic and Sock v3 sensor properties.
The script batch sends metrics and events when conditions are met every 10 seconds to New Relic. All credentials including NEW_RELIC_INSERT_KEY OWLET_USER
, OWLET_PASS
, and OWLET_REGION
must be passed via environment variables. Log messages are printed to disk in INFO level fasion.
- 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) have been reverse-enginered from Owlet's Android app.
You can import the "dashboard.json" directory to your new relic account to see the chart and metics.