but is there no method which is more robust than a camera which records color dots on a treatmill?
Unfortunately, we do not have standardized speed sensors for treadmills, like those for bike speed and cadence. What bike speed and cadence sensors actually measure is shown here:
But these sensors are not sensors which have for instance an MQTT interface, which would allow to connect them easily for instance to Home Assistant. Home Assistant or InfluxDB is a new platform for these kind of sensors. Developers welcome to solve this problem.