Xiaomi Treadmill/WalkingPad Integration

Xiaomi Treadmills and WalkingPads connect via WiFi using MiHome app
It would be really nice to fire automations based on treadmills/walking pads states and speed


image

I’m not experienced in building Home Assistant integrations, but it looks like it would be pretty easy for someone with former experience to build it using this SDK: ph4r05/ph4-walkingpad: WalkingPad python controller (github.com).

This custom component now supports it ! :tada:

Have you been able to get it working?
Doesn’t work for me

We have a Newgen Medicals treatmill for practicing walking mediation and are looking for a way to calibrate and control the treadmill. There are now excellent treadmill speed sensors for treadmills available and also treadmill calibration methods with high speed video cameras, as we have reviewed here:

https://petergamma.org/how-can-we-get-the-most-accurate-readings-from-a-treadmill/

It should be possible to connect some of the components over the Android app a Training tracker to Strava and from there to Home Assistant and InfluxDB. But we eventually have to replace the treadmill with a KingSmith WalkingPad A1, because there is Python support for it:

We are very interested in this project. There are excellent components here like treadmill sensors, calibration methods, Python controlled treadmills, etc.

The job is to put all these components together and create a great device with many options. There are a lot of Peloton treadmills available, but they are complicated and expensive. The options listed here are are an affordable alternative, which might be interesting for many people.

We are interested in such devices on the long term, and we are convinced to find a community here. But it might be a lifetime journey, since development in the field of sports sensor devices is very slow.

Thanks, Alone, for your info about the Home Assistant integration for the Xiaomi walking pad. All Xiaomi devices where integrated via miot-spec, support Wi-Fi, BLE, ZigBee devices, Xioami HA integration is very alive, 193 issues where reported, 689 issues are closed. But did someone get the Xiaomi walking pad Home Assistant integration to work?

There are several example codes available how to control the KingSmith WalkingPad A1. We can find them by google search. But these have not yet been connected to HA.

i have a R1 Pro but it connects to the KS AP ( Kingsmith app) in which of the many Xiaomi apps would it be?

If I can help in any way - or you can help me integrate this into HA, very happy to do so

I started an integration for this. Currently only supports belt control and speed, but I plan on adding to it (contributions welcome). Check it out here: GitHub - indiefan/king_smith: Home Assistant Integration for King Smith treadmills (e.g. WalkingPad)

1 Like

Great work Marke,

I recently studied how to calibrate a threadmill. fellnr is an expert for this:

https://fellrnr.com/wiki/Treadmill_Calibration

But if we calibrate a treadmill should we not calibrate a Xiaomi Treadmill, one of view treadmills that offers electronic speed read out and contol of motor speed in Python?

The problem with threse treadmills is that they are usually very incaccurate what they indicate for speed. There are treadmill speed sensors availabe as the NPE Runn Treadmill Smart Sensor. But these sensors ususually only can be connected to sports watches and bike computers. But how to get access to these data in Python?

There is Balena Health which supports the Polar H10. But as far as I know it is possible to modify it for instance for treadmill speed sensors which use the foot pod profile…

We can connect a Raspberry Pi running Balena Health to a Raspberry Pi running Balena Home Assistant and connect those over the Balena cloud to get our threadmill speed sensor data in Home Assistant. A very compliated pathway.

Now we have Marke Hallowell who started an integration for the Xiaomo Treadmill which is great. Sports sensor companies make it difficult to acess sports sensor data. I have studied this topic intensely. One of the best sports sensors which can be used with Home Assistant is the Apple Watch:

And now Marke HallowellI started an integration for Xiaomi Treadmill/WalkingPad Integration. For sports sensors we have for instance the Adafruit Pyloton Open Source Bike Computer, then we have Balena Health, we have also Retö Röllins Raspberry Ant+ which sends sports sensor data to an MQTT brocker, Fenix 5 which sends sports senso data over an eventhub app to Azure cloud Power Bi. But who uses Microsoft Power Bi and who wants the Garmin heart rate there?

It would be highly desirable to have all these sports sensor data in Home Assistant and not only in Garmin Connect where we cannot do anything with those. The Apple watch and Xiaomi Treadmill/WalkingPad Integration are good starting point for such a project in which I am very interested in.

I am an expert how to access sport sensor data altough I never wanted to be one. But I have become one since it is so difficult to access those. And I have studied those intensely and there are many different projects. But my conclusion is to have those all in a modern platform such as Home Assistant would be a milestone for people who want to do something which their sports sensor data and not only look at those in Garmin connect.

I currently have a Newgen Medicals treatmill. I am looking for a treadmill which can be calibrated and is exactly as possible. I was not sure if I should buy King Smith WalkingPad A1 since it has a Home Assistant integration now, and if I should calibrate it according to the fellnr method:

https://fellrnr.com/wiki/Treadmill_Calibration

But this method uses a video camera and the Kinovea and is quiet difficult. Then I found the Universal Treadmill speed sensor for Zwift with Ant+ stick and Raspberry Pi:

This sensor is much better than the fellnr method. And I think it is also better than the King Smith WalkingPad A1 speed sensor. I do not know how good this speed sensor is. In contrast, the Raspberry Pi threadmill speed sensor is open source soft- and hardware. It would be great if it could be used with Home Assitant instead of Zwift, but I think this is not a big deal for a good coder.

Fellnr reported some issues with speed variations in treadmills when he calibrated those. Therefore for me personally the Rasperry Pi treadmill speed sensor is more interesting than the WalkingPad A1. Is a foldable treadmill of good quality? Is it not better to make first some tests with the Rasperry Pi threadmill sensor to find out about this?

I come back to the Xiaomi WalkingPad A1 and Home Assistant as a device for doing some experiments. «Toy treadmills» for doctors cost around 10 000 USD:

in the Dr. toys store. There must be a reason for this. Is it the motor and the mechanics? With the Xiaomi WalkingPad A1 and Home Assistant we can find out about this, but don’t expect too much. We can find out for instance out how good it runs and what we can do with it. Eventually we can add a Raspberry Pi treadmill sensor to get all the data for our evaluation:

I suppose it should be possible to build an exercise stress test treadmill out of a Xioami treadmill and OpenBCI ECG. These treadmills use the Bruce protocol:

This protocol lasts 21 min. and the treadmill becomes gradually faster controlled by a computer, and the tilt becomes gradually bigger. The Xiaomi K12 cannot uplift, but we can add this by ourselves. «doctor toys» treadmills used by medical doctors which can do this cost new 14 000 USD (and are about 5 times heavier). A Xiaomi K12 is 500 USD. and OpenBCI with 12 channel ECG costs between 600 USD and 2000 USD. What a bargain.

Hey. I just came across your repo. I am trying to add a walkingpad P1. Every time I am trying to add the integration the loading blanks out. Do you have any advice?