Fitbit app to read HR values and publish via mqtt.
- Smartwatch Fitbit Sense
- A phone with the fitbit app (Compation APP) paired to the smartwatch
- A PC to run the python script
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
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.
The app running on the smartwatch will read the heart rate and send it to the companion app via the socket that pair them.
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.
The python script running on a pc, that is listening to the websocket. Once data arrive, they are published on the MQTT topic
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
- 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