Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Fitbit app to read HR values and publish via mqtt

Notifications You must be signed in to change notification settings

manuandru/fitbit-heart-rate-mqtt

Repository files navigation

Fitbit Heart Rate MQTT

Fitbit app to read HR values and publish via mqtt.

Hardware requirements

  • Smartwatch Fitbit Sense
  • A phone with the fitbit app (Compation APP) paired to the smartwatch
  • A PC to run the python script

Software Architecture

The project is divided in two main components that work together to achive the data communication via MQTT

  • Fitbit app
    • Smartwatch app
    • Companion app
  • Python script

Fitbit App

The Fitbit App will read the data and send via websocket to the python script running on PC. According to the Fitbit Communications Guide the watch cannot directly send data through the internet, so it needs to transfer data before to the companion app and then it could use websockets.

Smartwatch App

The app running on the smartwatch will read the heart rate and send it to the companion app via the socket that pair them.

Companion App

The companion app is running on the phone and is listening to the socket for the incoming data. When new data are ready, they are sent to the python script via websocket.

Message Forwarder

The python script running on a pc, that is listening to the websocket. Once data arrive, they are published on the MQTT topic

Heart rate provioning app

In order to transform heart rate in arousal, the formula need a base heart rate ad hoc for each users. This module allow to measure heart rate for 1 minute and produce a mean

How to use

  • Clone the repository
  • Install the app on fitbit. There are two different ways:
    • Via Fitbit Studio, the web-based SDK with GUI
    • Via the SDK available on npm
  • Run the provisioning app to get the base heart rate of the user
  • Run the app on the swartwatch
  • Set the websocket server url on the companion app
  • Install python requirements with pip install -r requirements.txt
  • Set the configuration for the message forwarder in mqttConfig.json
  • Run the python script with base heart rate value as argument python main.py base-hr-value
  • Enable data trasfer on the companion app

About

Fitbit app to read HR values and publish via mqtt

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages