This application polls the API service (Ayla) which serves as a backend for the Owlet Smart Sock.
The app kinda sucks
This is based on the work of others (e.g. this Python implementation), but has been tweaked and edit to suit my needs. It's also written in Go.
To run locally, you will need a Postgres database running on port 5432. You will also need to populate a .env
file with the following:
# Same as the Owlet mobile app
OWLET_USERNAME='...'
OWLET_PASSWORD='...'
OWLET_REGION="europe"
# Postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_HOST=localhost
POSTGRES_PORT="5432"
POSTGRES_DB=owletDB
# Grafana
GF_SECURITY_ADMIN_PASSWORD=admin
To run while developing, run the following from the repo root:
go run .
Or build the docker image and the whole setup via Docker Compose:
docker build -t edfincham/owlet-sock-scraper:latest .
docker compose up
A dashboard JSON for display the heart rate and blood oxygenation is provided within the grafana
directory. To get this to work, a Postgres data source must be configured in the Grafana UI. Assuming the example .env
is used, the following fields should work:
- Name:
grafana-postgresql-datasource
- Host URL:
db:5432
- Database name:
owletDB
- Username:
postgres
- Password: ...
- TLS/SSL Mode:
disable
- PostgreSQL Version:
15
owlet | 2024/09/27 20:26:55 Failed to update vitals for sock AC000W016886224: Error sending request: Post "https://securetoken.googleapis.com/v1/token?key=AIzaSyDm6EhV70wudwN3iOSq3vTjtsdGjdFLuuM": http2: server sent GOAWAY and closed the connection; LastStreamID=1127, ErrCode=NO_ERROR, debug="session_timed_out"