Peter Gamma (Physiologist & Director) Meditation Research Institute Switzerland (MRIS)

Which code to choose for sports sensors, Home Assistant, InfluxDB & Python?

Last Updated on December 21, 2022 by pg@petergamma.org

Since several years we are looking for an easy, low-cost and open solution to visualize, analyse and store (in a single database) of low-cost high quality physiological sensors. We do not have this solution yet.

For sport sensor data, we have Golden Cheetah, Strava, and other solution, and many more applications. For house sensors, we have Home Assistant, which is based on Python, InfluxDB and Grafana, which has a large community. We do not have this large community for physiological sensors in Home Assistant, we do not know whether this works at all.

For EEG data we have for instance the OpenBCI GUI. But what can we actually do with OpenBCI GUI? Harrison Kinsley showed us, what we can do with OpenBCI and Python.

We recently found a solution from Paul Warren Eaton from Finland who showed us how to manually inject .csv files into InfluxDB. Pauls solution is so easy, that we can imagine to do it easily, altough we usually don t code. But if we have to inject daily our .csv files into InfluxDB, is it not easier to connect the code of the applications to do it automatically?

The Adafruit Pyloton Bike Computer is based on Python, this what we conclude from the name of the project. We don t have studied the code in detail yet. If we want to use the Pyloton, then we suppose the Pyloton should work with that. To store sensor data from the Pyloton in InfluxDB, we can use the InfluxDB client for Python.

Several years ago, Andreas Bader published a project “track your heart rate with Raspberri ANT+”:

The code is well illustrated and had many followers. Then, we had the Raspberri ANT+ which sends sensor data to an MQTT brocker by Reto Roelli:

The code is well illustrated, and had many followers as well. In the Trainer Road forum, someone started a thread how to stream in the heart rate into Home Assistant over MQTT. We therefore suggest, that MQTT is the easiest way to connect an MQTT project to Home Assistant.

Another project is the Balena Health Raspberri Pi with Bluetooth low energy sensors, MQTT, InfluxDB, Balena OS and Balena Cloud. We do not know whether it is possible to connect the Balena Health to Home Assistant. We do not know whether the InfluxDB of the device is well illustrated and modifiable. But the device is well illustrated as well.

Home Assistant has the advantage, that there are already several options available for physiological sensors like the Apple Watch, Fitbit, Polar, Withing, Temper sensors, humidity, light, proximity sensors and many more. We therefore suggest that Home Assistant is a good choice to start doing experiments, and we suppose it is worth to try to connect the codes we discussed here to Home Assistant.

We have discussed here before many great projects, as for instance treadmills like the Xiaomi treadmill which can be controlled by user code. There are also treadmill sensors available. A lot is possible with these components. But what we miss is a software platform which is open and modern, in which these components are integrated, or can be integrated.